@4alldigital/foundation-ui--gamma 1.26.0 → 1.28.0

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 (119) hide show
  1. package/dist/foundation-ui.css +1 -1
  2. package/dist/index.esm.js +179 -166
  3. package/dist/index.js +189 -176
  4. package/dist/types/fui/components/Button/Button.d.ts +1 -1
  5. package/dist/types/fui/components/Button/Button.stories.d.ts +1 -0
  6. package/dist/types/fui/components/Button/Button.types.d.ts +1 -0
  7. package/dist/types/fui/components/Card/Card.d.ts +8 -0
  8. package/dist/types/fui/components/Card/Card.stories.d.ts +6 -0
  9. package/dist/types/fui/components/Card/Card.test.d.ts +1 -0
  10. package/dist/types/fui/components/Card/Card.types.d.ts +27 -0
  11. package/dist/types/fui/components/Card/index.d.ts +1 -0
  12. package/dist/types/fui/components/Card/types/CardBasic/CardBasic.d.ts +8 -0
  13. package/dist/types/fui/components/Card/types/CardBasic/CardBasic.stories.d.ts +6 -0
  14. package/dist/types/fui/components/Card/types/CardBasic/CardBasic.test.d.ts +1 -0
  15. package/dist/types/fui/components/Card/types/CardBasic/CardBasic.types.d.ts +4 -0
  16. package/dist/types/fui/components/Card/types/CardBasic/index.d.ts +1 -0
  17. package/dist/types/fui/components/Card/types/CardMedia/CardMedia.d.ts +8 -0
  18. package/dist/types/fui/components/Card/types/CardMedia/CardMedia.stories.d.ts +6 -0
  19. package/dist/types/fui/components/Card/types/CardMedia/CardMedia.test.d.ts +1 -0
  20. package/dist/types/fui/components/Card/types/CardMedia/CardMedia.types.d.ts +4 -0
  21. package/dist/types/fui/components/Card/types/CardMedia/index.d.ts +1 -0
  22. package/dist/types/fui/components/Card/types/CardVideo/CardVideo.d.ts +8 -0
  23. package/dist/types/fui/components/Card/types/CardVideo/CardVideo.stories.d.ts +6 -0
  24. package/dist/types/fui/components/Card/types/CardVideo/CardVideo.test.d.ts +1 -0
  25. package/dist/types/fui/components/Card/types/CardVideo/CardVideo.types.d.ts +4 -0
  26. package/dist/types/fui/components/Card/types/CardVideo/index.d.ts +1 -0
  27. package/dist/types/fui/components/Checkbox/Checkbox.types.d.ts +4 -1
  28. package/dist/types/fui/components/Container/Container.d.ts +1 -1
  29. package/dist/types/fui/components/Container/Container.types.d.ts +2 -0
  30. package/dist/types/fui/components/ContentPageLayout/ContentPageLayout.types.d.ts +2 -2
  31. package/dist/types/fui/components/ContentRowsLayout/ContentRowsLayout.types.d.ts +2 -2
  32. package/dist/types/fui/components/Copy/Copy.d.ts +1 -1
  33. package/dist/types/fui/components/Copy/Copy.types.d.ts +13 -11
  34. package/dist/types/fui/components/Form/Form.d.ts +1 -1
  35. package/dist/types/fui/components/Form/Form.types.d.ts +3 -0
  36. package/dist/types/fui/components/FormField/FormField.d.ts +1 -1
  37. package/dist/types/fui/components/FormField/FormField.stories.d.ts +1 -0
  38. package/dist/types/fui/components/FormField/FormField.types.d.ts +7 -4
  39. package/dist/types/fui/components/FormSelect/FormSelect.types.d.ts +5 -2
  40. package/dist/types/fui/components/Heading/Heading.types.d.ts +6 -6
  41. package/dist/types/fui/components/Label/Label.d.ts +1 -1
  42. package/dist/types/fui/components/Label/Label.types.d.ts +6 -2
  43. package/dist/types/fui/components/Link/Link.types.d.ts +1 -1
  44. package/dist/types/fui/components/Notice/Notice.d.ts +1 -1
  45. package/dist/types/fui/components/Notice/Notice.types.d.ts +1 -1
  46. package/dist/types/fui/components/Radio/Radio.types.d.ts +2 -1
  47. package/dist/types/fui/components/TextInput/TextInput.types.d.ts +2 -1
  48. package/dist/types/fui/components/index.d.ts +23 -0
  49. package/dist/types/fui/features/Search/Search.d.ts +5 -0
  50. package/dist/types/fui/features/Search/Search.stories.d.ts +6 -0
  51. package/dist/types/fui/features/Search/Search.test.d.ts +1 -0
  52. package/dist/types/fui/features/Search/Search.types.d.ts +10 -0
  53. package/dist/types/fui/features/Search/index.d.ts +1 -0
  54. package/dist/types/fui/features/Search/view-helpers/appendClassName.d.ts +1 -0
  55. package/dist/types/fui/features/Search/view-helpers/formatResult.d.ts +3 -0
  56. package/dist/types/fui/features/Search/view-helpers/getFilterValueDisplay.d.ts +1 -0
  57. package/dist/types/fui/features/Search/view-helpers/getUrlSanitizer.d.ts +6 -0
  58. package/dist/types/fui/features/Search/view-helpers/index.d.ts +4 -0
  59. package/dist/types/fui/features/Search/views/Layout/Layout.d.ts +7 -0
  60. package/dist/types/fui/features/Search/views/Layout/Layout.stories.d.ts +6 -0
  61. package/dist/types/fui/features/Search/views/Layout/Layout.test.d.ts +1 -0
  62. package/dist/types/fui/features/Search/views/Layout/Layout.types.d.ts +10 -0
  63. package/dist/types/fui/features/Search/views/Layout/index.d.ts +1 -0
  64. package/dist/types/fui/features/Search/views/MultiCheckboxFacet/MultiCheckboxFacet.d.ts +7 -0
  65. package/dist/types/fui/features/Search/views/MultiCheckboxFacet/MultiCheckboxFacet.stories.d.ts +6 -0
  66. package/dist/types/fui/features/Search/views/MultiCheckboxFacet/MultiCheckboxFacet.test.d.ts +1 -0
  67. package/dist/types/fui/features/Search/views/MultiCheckboxFacet/MultiCheckboxFacet.types.d.ts +4 -0
  68. package/dist/types/fui/features/Search/views/MultiCheckboxFacet/index.d.ts +1 -0
  69. package/dist/types/fui/features/Search/views/Paging/Paging.d.ts +7 -0
  70. package/dist/types/fui/features/Search/views/Paging/Paging.stories.d.ts +6 -0
  71. package/dist/types/fui/features/Search/views/Paging/Paging.test.d.ts +1 -0
  72. package/dist/types/fui/features/Search/views/Paging/Paging.types.d.ts +14 -0
  73. package/dist/types/fui/features/Search/views/Paging/index.d.ts +1 -0
  74. package/dist/types/fui/features/Search/views/PagingInfo/PagingInfo.d.ts +8 -0
  75. package/dist/types/fui/features/Search/views/PagingInfo/PagingInfo.stories.d.ts +6 -0
  76. package/dist/types/fui/features/Search/views/PagingInfo/PagingInfo.test.d.ts +1 -0
  77. package/dist/types/fui/features/Search/views/PagingInfo/PagingInfo.types.d.ts +16 -0
  78. package/dist/types/fui/features/Search/views/PagingInfo/index.d.ts +1 -0
  79. package/dist/types/fui/features/Search/views/Result/Result.d.ts +7 -0
  80. package/dist/types/fui/features/Search/views/Result/Result.stories.d.ts +6 -0
  81. package/dist/types/fui/features/Search/views/Result/Result.test.d.ts +1 -0
  82. package/dist/types/fui/features/Search/views/Result/Result.types.d.ts +22 -0
  83. package/dist/types/fui/features/Search/views/Result/index.d.ts +1 -0
  84. package/dist/types/fui/features/Search/views/Results/Results.d.ts +8 -0
  85. package/dist/types/fui/features/Search/views/Results/Results.stories.d.ts +6 -0
  86. package/dist/types/fui/features/Search/views/Results/Results.test.d.ts +1 -0
  87. package/dist/types/fui/features/Search/views/Results/Results.types.d.ts +19 -0
  88. package/dist/types/fui/features/Search/views/Results/index.d.ts +1 -0
  89. package/dist/types/fui/features/Search/views/ResultsPerPage/ResultsPerPage.d.ts +7 -0
  90. package/dist/types/fui/features/Search/views/ResultsPerPage/ResultsPerPage.stories.d.ts +6 -0
  91. package/dist/types/fui/features/Search/views/ResultsPerPage/ResultsPerPage.test.d.ts +1 -0
  92. package/dist/types/fui/features/Search/views/ResultsPerPage/ResultsPerPage.types.d.ts +17 -0
  93. package/dist/types/fui/features/Search/views/ResultsPerPage/index.d.ts +1 -0
  94. package/dist/types/fui/features/Search/views/SearchBox/SearchBox.d.ts +7 -0
  95. package/dist/types/fui/features/Search/views/SearchBox/SearchBox.stories.d.ts +6 -0
  96. package/dist/types/fui/features/Search/views/SearchBox/SearchBox.test.d.ts +1 -0
  97. package/dist/types/fui/features/Search/views/SearchBox/SearchBox.types.d.ts +6 -0
  98. package/dist/types/fui/features/Search/views/SearchBox/index.d.ts +1 -0
  99. package/dist/types/fui/features/Search/views/Sidebar/Sidebar.d.ts +8 -0
  100. package/dist/types/fui/features/Search/views/Sidebar/Sidebar.stories.d.ts +6 -0
  101. package/dist/types/fui/features/Search/views/Sidebar/Sidebar.test.d.ts +1 -0
  102. package/dist/types/fui/features/Search/views/Sidebar/Sidebar.types.d.ts +3 -0
  103. package/dist/types/fui/features/Search/views/Sidebar/index.d.ts +1 -0
  104. package/dist/types/fui/features/Search/views/SingleLinksFacet/SingleLinksFacet.d.ts +7 -0
  105. package/dist/types/fui/features/Search/views/SingleLinksFacet/SingleLinksFacet.stories.d.ts +6 -0
  106. package/dist/types/fui/features/Search/views/SingleLinksFacet/SingleLinksFacet.test.d.ts +1 -0
  107. package/dist/types/fui/features/Search/views/SingleLinksFacet/SingleLinksFacet.types.d.ts +4 -0
  108. package/dist/types/fui/features/Search/views/SingleLinksFacet/index.d.ts +1 -0
  109. package/dist/types/fui/features/Search/views/SingleSelectFacet/SingleSelectFacet.d.ts +7 -0
  110. package/dist/types/fui/features/Search/views/SingleSelectFacet/SingleSelectFacet.stories.d.ts +6 -0
  111. package/dist/types/fui/features/Search/views/SingleSelectFacet/SingleSelectFacet.test.d.ts +1 -0
  112. package/dist/types/fui/features/Search/views/SingleSelectFacet/SingleSelectFacet.types.d.ts +4 -0
  113. package/dist/types/fui/features/Search/views/SingleSelectFacet/index.d.ts +1 -0
  114. package/dist/types/fui/features/Search/views/Sorting/Sorting.d.ts +7 -0
  115. package/dist/types/fui/features/Search/views/Sorting/Sorting.stories.d.ts +6 -0
  116. package/dist/types/fui/features/Search/views/Sorting/Sorting.test.d.ts +1 -0
  117. package/dist/types/fui/features/Search/views/Sorting/Sorting.types.d.ts +20 -0
  118. package/dist/types/fui/features/Search/views/Sorting/index.d.ts +1 -0
  119. package/package.json +4 -31
package/dist/index.esm.js CHANGED
@@ -30,8 +30,28 @@ var BTN_SIZES;
30
30
  BTN_SIZES["LARGE"] = "large";
31
31
  })(BTN_SIZES || (BTN_SIZES = {}));
32
32
 
33
+ /**
34
+ * Icon component
35
+ * List of supported icons can be found at https://icon-sets.iconify.design.
36
+ */
37
+ var Icon = function (_a) {
38
+ var name = _a.name, _b = _a.size, size = _b === void 0 ? 24 : _b, color = _a.color, id = _a.id, className = _a.className, testID = _a.testID;
39
+ if (color) {
40
+ return (jsx(Icon$1, { "data-testid": testID || id || 'Icon', icon: name, width: size, height: size, color: color, className: className, fill: color || 'currentColor' }));
41
+ }
42
+ return (jsx(Icon$1, { "data-testid": testID || id || 'Icon', icon: name, width: size, height: size }));
43
+ };
44
+ Icon.displayName = 'Icon';
45
+
46
+ var Loader = function (_a) {
47
+ var color = _a.color, _b = _a.size, size = _b === void 0 ? 8 : _b, _c = _a.thickness, thickness = _c === void 0 ? 4 : _c;
48
+ var sizeClass = size ? "w-".concat(size, " h-").concat(size) : 'w-8 h-8';
49
+ return (jsx("div", { "data-testid": "Loader", className: 'mr-3 flex items-center justify-center', children: jsxs("div", { role: "status", className: 'flex items-center', children: [jsxs("svg", { className: "animate-spin ".concat(sizeClass, " text-white"), xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: color || 'currentColor', strokeWidth: thickness }), jsx("path", { className: "opacity-75", fill: color || 'currentColor', d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] }), jsx("span", { className: "sr-only", children: "Loading..." })] }) }));
50
+ };
51
+ Loader.displayName = 'Loader';
52
+
33
53
  var Button = function (_a) {
34
- var _b = _a.variant, variant = _b === void 0 ? BTN_VARIANTS.PRIMARY : _b, _c = _a.size, size = _c === void 0 ? BTN_SIZES.MEDIUM : _c, _d = _a.type, type = _d === void 0 ? BTN_TYPES.BUTTON : _d, _e = _a.wide, wide = _e === void 0 ? true : _e, _f = _a.rounded, rounded = _f === void 0 ? true : _f, _g = _a.raised, raised = _g === void 0 ? true : _g, uppercase = _a.uppercase, children = _a.children, id = _a.id, disabled = _a.disabled, ariaLabel = _a.ariaLabel, onClick = _a.onClick, icon = _a.icon, external = _a.external, iconFirst = _a.iconFirst, outline = _a.outline, testID = _a.testID, className = _a.className;
54
+ var _b = _a.variant, variant = _b === void 0 ? BTN_VARIANTS.PRIMARY : _b, _c = _a.size, size = _c === void 0 ? BTN_SIZES.MEDIUM : _c, _d = _a.type, type = _d === void 0 ? BTN_TYPES.BUTTON : _d, _e = _a.wide, wide = _e === void 0 ? true : _e, _f = _a.rounded, rounded = _f === void 0 ? true : _f, _g = _a.raised, raised = _g === void 0 ? true : _g, uppercase = _a.uppercase, children = _a.children, id = _a.id, disabled = _a.disabled, ariaLabel = _a.ariaLabel, onClick = _a.onClick, icon = _a.icon, external = _a.external, iconFirst = _a.iconFirst, outline = _a.outline, testID = _a.testID, className = _a.className, isLoading = _a.isLoading;
35
55
  var smallX = wide ? 'px-5' : 'px-3';
36
56
  var mediumX = wide ? 'px-8' : 'px-4';
37
57
  var largeX = wide ? 'px-11' : 'px-5';
@@ -58,50 +78,52 @@ var Button = function (_a) {
58
78
  icon: 'w-6 h-6',
59
79
  },
60
80
  };
61
- var classes = cx('font-bold flex items-center transition-all duration-200 transform active:scale-95 justify-around border-solid border rounded cursor-pointer focus:outline-none', { 'text-white border-primary hover:bg-primary-darker hover:border-primary-darker': variant === 'primary' }, { 'text-white border-secondary hover:bg-secondary-darker hover:border-secondary-darker': variant === 'secondary' }, { 'text-black border-tertiary hover:bg-tertiary-darker hover:border-tertiary-darker': variant === 'tertiary' }, { 'bg-primary': variant === 'primary' && !outline }, { 'bg-secondary': variant === 'secondary' && !outline }, { 'bg-tertiary': variant === 'tertiary' && !outline }, { 'bg-transparent': outline }, { shadow: raised }, { uppercase: uppercase }, { 'auto-cols-auto grid-cols-2 gap-2': icon || external }, { 'rounded-full': rounded }, { 'flex-row-reverse': iconFirst }, "".concat(sizes[size].y, " ").concat(sizes[size].x, " ").concat(sizes[size].text), className);
81
+ var classes = cx('appearance-none font-body flex items-center transition-all duration-200 transform active:scale-95 justify-around border-solid border rounded cursor-pointer outline-none focus:outline-none focus-visible:outline-none', { 'text-white border-primary hover:bg-primary-darker': variant === 'primary' }, { 'text-white border-secondary hover:bg-secondary-darker': variant === 'secondary' }, { 'text-black border-tertiary hover:bg-tertiary-darker': variant === 'tertiary' }, { 'bg-primary': variant === 'primary' }, { 'bg-secondary': variant === 'secondary' }, { 'bg-tertiary': variant === 'tertiary' }, { 'border-primary300 dark:border-primary400 hover:border-primary400 dark:hover:border-primary500': outline }, { shadow: raised }, { uppercase: uppercase }, { 'auto-cols-auto grid-cols-2 gap-2': icon || external }, { 'rounded-full': rounded }, { 'flex-row-reverse': iconFirst }, { 'opacity-50 cursor-not-allowed': disabled }, "".concat(sizes[size].y, " ").concat(sizes[size].x, " ").concat(sizes[size].text), className);
62
82
  var iconClasses = cx(sizes[size].icon);
63
- return (jsx("button", { id: id, "data-testid": testID || id || 'Button', onClick: onClick, className: classes, type: type, disabled: disabled, "aria-label": ariaLabel, role: "button", children: jsxs(Fragment, { children: [children, icon && !external && (jsx("span", { className: "flex items-center", children: jsx(Icon$1, { icon: icon, className: iconClasses }) })), external && (jsx("span", { className: "flex items-center", children: jsx(Icon$1, { icon: "carbon:launch", className: iconClasses }) }))] }) }));
83
+ return (jsx("button", { id: id, "data-testid": testID || id || 'Button', onClick: onClick, className: classes, type: type, disabled: disabled, "aria-label": ariaLabel, role: "button", children: jsxs(Fragment, { children: [isLoading && (jsx("div", { className: "flex items-center", children: jsx(Loader, { size: 4 }) })), children, icon && !external && (jsx("span", { className: "flex items-center", children: jsx(Icon, { name: icon, className: iconClasses }) })), external && (jsx("span", { className: "flex items-center", children: jsx(Icon, { name: "carbon:launch", className: iconClasses }) }))] }) }));
64
84
  };
65
85
  Button.displayName = 'Button';
66
86
 
67
- var ALIGN;
68
- (function (ALIGN) {
69
- ALIGN["LEFT"] = "left";
70
- ALIGN["CENTER"] = "center";
71
- ALIGN["RIGHT"] = "right";
72
- ALIGN["JUSTIFY"] = "justify";
73
- ALIGN["NOWRAP"] = "nowrap";
74
- })(ALIGN || (ALIGN = {}));
75
- var TRANSFORM;
76
- (function (TRANSFORM) {
77
- TRANSFORM["LOWERCASE"] = "lowercase";
78
- TRANSFORM["UPPERCASE"] = "uppercase";
79
- TRANSFORM["CAPITALIZE"] = "capitalize";
80
- TRANSFORM["NORMALCASE"] = "normal-case";
81
- })(TRANSFORM || (TRANSFORM = {}));
82
- var CONTEXTUAL;
83
- (function (CONTEXTUAL) {
84
- CONTEXTUAL["INVERTED"] = "inverted";
85
- CONTEXTUAL["MUTED"] = "muted";
86
- })(CONTEXTUAL || (CONTEXTUAL = {}));
87
- var SIZE$1;
88
- (function (SIZE) {
89
- SIZE["SMALL"] = "small";
90
- SIZE["LARGE"] = "large";
91
- SIZE["INTRO"] = "intro";
92
- })(SIZE$1 || (SIZE$1 = {}));
93
- var TAG;
94
- (function (TAG) {
95
- TAG["P"] = "p";
96
- TAG["SPAN"] = "span";
97
- TAG["DIV"] = "div";
98
- TAG["SMALL"] = "small";
99
- })(TAG || (TAG = {}));
87
+ var COPY_ALIGN;
88
+ (function (COPY_ALIGN) {
89
+ COPY_ALIGN["LEFT"] = "left";
90
+ COPY_ALIGN["CENTER"] = "center";
91
+ COPY_ALIGN["RIGHT"] = "right";
92
+ COPY_ALIGN["JUSTIFY"] = "justify";
93
+ COPY_ALIGN["NOWRAP"] = "nowrap";
94
+ })(COPY_ALIGN || (COPY_ALIGN = {}));
95
+ var COPY_TRANSFORM;
96
+ (function (COPY_TRANSFORM) {
97
+ COPY_TRANSFORM["LOWERCASE"] = "lowercase";
98
+ COPY_TRANSFORM["UPPERCASE"] = "uppercase";
99
+ COPY_TRANSFORM["CAPITALIZE"] = "capitalize";
100
+ COPY_TRANSFORM["NORMALCASE"] = "normal-case";
101
+ })(COPY_TRANSFORM || (COPY_TRANSFORM = {}));
102
+ var COPY_CONTEXTUAL;
103
+ (function (COPY_CONTEXTUAL) {
104
+ COPY_CONTEXTUAL["INVERTED"] = "inverted";
105
+ COPY_CONTEXTUAL["MUTED"] = "muted";
106
+ })(COPY_CONTEXTUAL || (COPY_CONTEXTUAL = {}));
107
+ var COPY_SIZE;
108
+ (function (COPY_SIZE) {
109
+ COPY_SIZE["SMALL"] = "small";
110
+ COPY_SIZE["LARGE"] = "large";
111
+ COPY_SIZE["INTRO"] = "intro";
112
+ })(COPY_SIZE || (COPY_SIZE = {}));
113
+ var COPY_TAG;
114
+ (function (COPY_TAG) {
115
+ COPY_TAG["P"] = "p";
116
+ COPY_TAG["SPAN"] = "span";
117
+ COPY_TAG["DIV"] = "div";
118
+ COPY_TAG["SMALL"] = "small";
119
+ })(COPY_TAG || (COPY_TAG = {}));
100
120
 
101
121
  var Copy = function (_a) {
102
122
  var _b;
103
- var children = _a.children, _c = _a.as, Tag = _c === void 0 ? TAG.P : _c, size = _a.size, _d = _a.align, align = _d === void 0 ? ALIGN.LEFT : _d, transform = _a.transform, id = _a.id, testID = _a.testID;
104
- var classes = cx((_b = {}, _b["text-".concat(align)] = align, _b), { 'text-sm': size === 'small' }, { 'text-lg': size === 'large' }, { 'text-2xl': size === 'intro' }, { 'mb-3 leading-5': Tag === 'p' }, { 'text-sm': Tag === 'small' }, 'body-text', transform);
123
+ var children = _a.children, _c = _a.as, Tag = _c === void 0 ? COPY_TAG.P : _c, size = _a.size, _d = _a.align, align = _d === void 0 ? COPY_ALIGN.LEFT : _d, transform = _a.transform, id = _a.id, className = _a.className, testID = _a.testID;
124
+ var classes = cx((_b = {}, _b["text-".concat(align)] = align, _b), { 'text-sm': size === 'small' }, { 'text-lg': size === 'large' }, { 'text-2xl': size === 'intro' }, { 'mb-3 leading-5 mt-0': Tag === 'p' }, { 'text-sm': Tag === 'small' },
125
+ //'body-text',
126
+ transform, className);
105
127
  return (jsx(Tag, { "data-testid": testID || id || 'Copy', className: classes, children: children }));
106
128
  };
107
129
  Copy.displayName = 'Copy';
@@ -109,33 +131,33 @@ Copy.displayName = 'Copy';
109
131
  var Hr = function () { return (jsx("hr", { className: cx('border-0 border-b border-dark-body-text dark:border-dark-body-text') })); };
110
132
  Hr.displayName = 'Hr';
111
133
 
112
- var HeadingTag;
113
- (function (HeadingTag) {
114
- HeadingTag["H1"] = "h1";
115
- HeadingTag["H2"] = "h2";
116
- HeadingTag["H3"] = "h3";
117
- HeadingTag["H4"] = "h4";
118
- HeadingTag["H5"] = "h5";
119
- })(HeadingTag || (HeadingTag = {}));
120
- var HeadingAlign;
121
- (function (HeadingAlign) {
122
- HeadingAlign["LEFT"] = "left";
123
- HeadingAlign["CENTER"] = "center";
124
- HeadingAlign["RIGHT"] = "right";
125
- HeadingAlign["JUSTIFY"] = "justify";
126
- HeadingAlign["NOWRAP"] = "nowrap";
127
- })(HeadingAlign || (HeadingAlign = {}));
128
- var HeadingTransform;
129
- (function (HeadingTransform) {
130
- HeadingTransform["LOWERCASE"] = "lowercase";
131
- HeadingTransform["UPPERCASE"] = "uppercase";
132
- HeadingTransform["CAPITALIZE"] = "capitalize";
133
- HeadingTransform["NORMAL_CASE"] = "normal-case";
134
- })(HeadingTransform || (HeadingTransform = {}));
134
+ var HEADING_TAGS;
135
+ (function (HEADING_TAGS) {
136
+ HEADING_TAGS["H1"] = "h1";
137
+ HEADING_TAGS["H2"] = "h2";
138
+ HEADING_TAGS["H3"] = "h3";
139
+ HEADING_TAGS["H4"] = "h4";
140
+ HEADING_TAGS["H5"] = "h5";
141
+ })(HEADING_TAGS || (HEADING_TAGS = {}));
142
+ var HEADING_ALIGN;
143
+ (function (HEADING_ALIGN) {
144
+ HEADING_ALIGN["LEFT"] = "left";
145
+ HEADING_ALIGN["CENTER"] = "center";
146
+ HEADING_ALIGN["RIGHT"] = "right";
147
+ HEADING_ALIGN["JUSTIFY"] = "justify";
148
+ HEADING_ALIGN["NOWRAP"] = "nowrap";
149
+ })(HEADING_ALIGN || (HEADING_ALIGN = {}));
150
+ var HEADING_TRANSFORM;
151
+ (function (HEADING_TRANSFORM) {
152
+ HEADING_TRANSFORM["LOWERCASE"] = "lowercase";
153
+ HEADING_TRANSFORM["UPPERCASE"] = "uppercase";
154
+ HEADING_TRANSFORM["CAPITALIZE"] = "capitalize";
155
+ HEADING_TRANSFORM["NORMAL_CASE"] = "normal-case";
156
+ })(HEADING_TRANSFORM || (HEADING_TRANSFORM = {}));
135
157
 
136
158
  var Heading = function (_a) {
137
159
  var _b;
138
- var children = _a.children, _c = _a.tag, tag = _c === void 0 ? HeadingTag.H1 : _c, transform = _a.transform, align = _a.align, id = _a.id, testID = _a.testID, flush = _a.flush, className = _a.className;
160
+ var children = _a.children, _c = _a.tag, tag = _c === void 0 ? HEADING_TAGS.H1 : _c, transform = _a.transform, align = _a.align, id = _a.id, testID = _a.testID, flush = _a.flush, className = _a.className;
139
161
  var fontSize = function () {
140
162
  switch (tag) {
141
163
  case 'h1':
@@ -154,24 +176,11 @@ var Heading = function (_a) {
154
176
  };
155
177
  var size = fontSize();
156
178
  var Tag = tag;
157
- var classes = cx("font-heading font-bold ".concat(size), (_b = {}, _b["text-".concat(align)] = align, _b), { 'm-0': flush }, transform, className);
179
+ var classes = cx("font-heading font-bold mb-2 ".concat(size), (_b = {}, _b["text-".concat(align)] = align, _b), { 'm-0': flush }, transform, className);
158
180
  return (jsx(Tag, { "data-testid": testID || id || 'Heading', className: classes, children: children }));
159
181
  };
160
182
  Heading.displayName = 'Heading';
161
183
 
162
- /**
163
- * Icon component
164
- * List of supported icons can be found at https://icon-sets.iconify.design.
165
- */
166
- var Icon = function (_a) {
167
- var name = _a.name, _b = _a.size, size = _b === void 0 ? 24 : _b, color = _a.color, id = _a.id, className = _a.className, testID = _a.testID;
168
- if (color) {
169
- return (jsx(Icon$1, { "data-testid": testID || id || 'Icon', icon: name, width: size, height: size, color: color, className: className, fill: color || 'currentColor' }));
170
- }
171
- return (jsx(Icon$1, { "data-testid": testID || id || 'Icon', icon: name, width: size, height: size }));
172
- };
173
- Icon.displayName = 'Icon';
174
-
175
184
  var Image = function (_a) {
176
185
  var src = _a.src, alt = _a.alt, title = _a.title, caption = _a.caption, _b = _a.figure, figure = _b === void 0 ? false : _b, onLoad = _a.onLoad, id = _a.id, className = _a.className, testID = _a.testID;
177
186
  var figureClasses = cx('m-0');
@@ -242,56 +251,49 @@ var ListItem = function (_a) {
242
251
  ListItem.displayName = 'ListItem';
243
252
 
244
253
  var Notice = function (_a) {
245
- var _b = _a.foo, foo = _b === void 0 ? 'bar' : _b, id = _a.id, testID = _a.testID;
246
- return (jsx("div", { "data-testid": testID || id || 'Notice', className: "foo-bar", children: foo }));
254
+ var _b = _a.custom, custom = _b === void 0 ? 'bar' : _b, id = _a.id, testID = _a.testID;
255
+ return (jsx("div", { "data-testid": testID || id || 'Notice', className: "foo-bar", children: custom }));
247
256
  };
248
257
  Notice.displayName = 'Notice';
249
258
 
250
- var Loader = function (_a) {
251
- var color = _a.color, _b = _a.size, size = _b === void 0 ? 8 : _b, _c = _a.thickness, thickness = _c === void 0 ? 4 : _c;
252
- var sizeClass = size ? "w-".concat(size, " h-").concat(size) : 'w-8 h-8';
253
- return (jsx("div", { "data-testid": "Loader", children: jsxs("div", { role: "status", children: [jsxs("svg", { className: "animate-spin -ml-1 mr-3 ".concat(sizeClass, " text-white"), xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: color || 'currentColor', strokeWidth: thickness }), jsx("path", { className: "opacity-75", fill: color || 'currentColor', d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] }), jsx("span", { className: "sr-only", children: "Loading..." })] }) }));
254
- };
255
- Loader.displayName = 'Loader';
256
-
257
259
  var Container = function (_a) {
258
- var children = _a.children, className = _a.className, spacing = _a.spacing, padded = _a.padded;
259
- var classes = cx('container', 'mx-auto', 'my-0', { 'px-4': padded }, { 'py-40': spacing === 'feature' }, { 'py-24': spacing === 'component' }, { 'py-16': spacing === 'module' }, { 'py-10': spacing === 'element' }, { 'py-4': spacing === 'atom' }, { 'py-0': spacing === 'none' }, className);
260
+ var children = _a.children, className = _a.className, spacing = _a.spacing, padded = _a.padded, isNarrow = _a.isNarrow, isCentered = _a.isCentered;
261
+ var classes = cx('container', 'mx-auto', 'my-0', { 'px-4': padded }, { 'py-40': spacing === 'feature' }, { 'py-24': spacing === 'component' }, { 'py-16': spacing === 'module' }, { 'py-10': spacing === 'element' }, { 'py-4': spacing === 'atom' }, { 'py-0': spacing === 'none' }, { 'max-w-3xl': isNarrow }, { 'flex items-center justify-center flex-col': isCentered }, className);
260
262
  return (jsx("div", { "data-testid": "Container", className: classes, children: children }));
261
263
  };
262
264
  Container.displayName = 'Container';
263
265
 
264
- var SPACING;
265
- (function (SPACING) {
266
- SPACING["NONE"] = "none";
267
- SPACING["ATOM"] = "atom";
268
- SPACING["DEFAULT"] = "default";
269
- SPACING["ELEMENT"] = "element";
270
- SPACING["COMPONENT"] = "component";
271
- SPACING["MODULE"] = "module";
272
- SPACING["FEATURE"] = "feature";
273
- })(SPACING || (SPACING = {}));
266
+ var CPL_SPACING;
267
+ (function (CPL_SPACING) {
268
+ CPL_SPACING["NONE"] = "none";
269
+ CPL_SPACING["ATOM"] = "atom";
270
+ CPL_SPACING["DEFAULT"] = "default";
271
+ CPL_SPACING["ELEMENT"] = "element";
272
+ CPL_SPACING["COMPONENT"] = "component";
273
+ CPL_SPACING["MODULE"] = "module";
274
+ CPL_SPACING["FEATURE"] = "feature";
275
+ })(CPL_SPACING || (CPL_SPACING = {}));
274
276
 
275
277
  var ContentPageLayout = function (_a) {
276
- var _b = _a.spacing, spacing = _b === void 0 ? SPACING.DEFAULT : _b, children = _a.children, narrow = _a.narrow, flush = _a.flush, className = _a.className;
278
+ var _b = _a.spacing, spacing = _b === void 0 ? CPL_SPACING.DEFAULT : _b, children = _a.children, narrow = _a.narrow, flush = _a.flush, className = _a.className;
277
279
  var classes = cx('flex', 'flex-col', 'flex-1', 'relative', { 'py-40': spacing === 'feature' }, { 'py-24': spacing === 'component' }, { 'py-16': spacing === 'module' }, { 'py-10': spacing === 'element' }, { 'py-8': spacing === 'default' }, { 'py-4': spacing === 'atom' }, { 'py-0': spacing === 'none' }, { 'max-w-5xl': narrow }, { 'p-0': flush }, className);
278
280
  return (jsx("div", { "data-testid": "ContentPageLayout", className: classes, children: children }));
279
281
  };
280
282
  ContentPageLayout.displayName = 'ContentPageLayout';
281
283
 
282
- var SIZE;
283
- (function (SIZE) {
284
- SIZE["NONE"] = "none";
285
- SIZE["ATOM"] = "atom";
286
- SIZE["DEFAULT"] = "default";
287
- SIZE["ELEMENT"] = "element";
288
- SIZE["COMPONENT"] = "component";
289
- SIZE["MODULE"] = "module";
290
- SIZE["FEATURE"] = "feature";
291
- })(SIZE || (SIZE = {}));
284
+ var CRL_SIZE;
285
+ (function (CRL_SIZE) {
286
+ CRL_SIZE["NONE"] = "none";
287
+ CRL_SIZE["ATOM"] = "atom";
288
+ CRL_SIZE["DEFAULT"] = "default";
289
+ CRL_SIZE["ELEMENT"] = "element";
290
+ CRL_SIZE["COMPONENT"] = "component";
291
+ CRL_SIZE["MODULE"] = "module";
292
+ CRL_SIZE["FEATURE"] = "feature";
293
+ })(CRL_SIZE || (CRL_SIZE = {}));
292
294
 
293
295
  var ContentRowsLayout = function (_a) {
294
- var className = _a.className, children = _a.children, _b = _a.size, size = _b === void 0 ? SIZE.DEFAULT : _b;
296
+ var className = _a.className, children = _a.children, _b = _a.size, size = _b === void 0 ? CRL_SIZE.DEFAULT : _b;
295
297
  var classes = cx('grid', 'auto-rows-min', 'grid-cols-1', 'gap-x-4', { 'gap-y-0 mb-0': size === 'none' }, { 'gap-y-2 mb-2': size === 'atom' }, { 'gap-y-4 mb-4': size === 'default' }, { 'gap-y-8 mb-8': size === 'element' }, { 'gap-y-16 mb-16': size === 'module' }, { 'gap-y-24 mb-24': size === 'component' }, { 'gap-y-40 mb-40': size === 'feature' }, className);
296
298
  return (jsx("div", { "data-testid": "ContentRowsLayout", className: classes, children: children }));
297
299
  };
@@ -343,9 +345,11 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
343
345
  };
344
346
 
345
347
  var Form = function (_a) {
346
- var children = _a.children, className = _a.className, submit = _a.submit, _b = _a.onSubmit, onSubmit = _b === void 0 ? function () { } : _b, onChange = _a.onChange, hideSubmit = _a.hideSubmit, ariaSubmitLabel = _a.ariaSubmitLabel, submitID = _a.submitID, _c = _a.submitVariant, submitVariant = _c === void 0 ? BTN_VARIANTS.PRIMARY : _c, _d = _a.initialValues, initialValues = _d === void 0 ? {} : _d;
348
+ var children = _a.children, className = _a.className, submit = _a.submit, _b = _a.onSubmit, onSubmit = _b === void 0 ? function () { } : _b, onChange = _a.onChange, hideSubmit = _a.hideSubmit, ariaSubmitLabel = _a.ariaSubmitLabel, submitID = _a.submitID, _c = _a.submitVariant, submitVariant = _c === void 0 ? BTN_VARIANTS.PRIMARY : _c, _d = _a.initialValues, initialValues = _d === void 0 ? {} : _d, _e = _a.isBoxed, isBoxed = _e === void 0 ? false : _e;
347
349
  var methods = useForm({
348
350
  defaultValues: initialValues,
351
+ mode: 'onBlur',
352
+ reValidateMode: 'onChange',
349
353
  });
350
354
  useEffect(function () {
351
355
  if (onChange && typeof onChange === 'function') {
@@ -354,28 +358,29 @@ var Form = function (_a) {
354
358
  }
355
359
  }, []);
356
360
  var submitClasses = cx({ 'sr-only': hideSubmit });
357
- return (jsx(FormProvider, __assign({}, methods, { children: jsx("div", { "data-testid": "Form", className: "w-full max-w-s @form @containers", children: jsxs("form", { onSubmit: methods.handleSubmit(onSubmit), className: cx('form px-8 pt-6 pb-8 mb-4 w-2xs', className), children: [children, submit && (jsx("div", { className: "flex items-center justify-end py-2", children: jsx(Button, { id: submitID || submit, className: submitClasses, ariaLabel: ariaSubmitLabel || submit || 'Submit', type: BTN_TYPES.SUBMIT, variant: submitVariant, children: submit }) }))] }) }) })));
361
+ return (jsx(FormProvider, __assign({}, methods, { children: jsx("div", { "data-testid": "Form", className: cx('w-full max-w-s @containers @form'), children: jsxs("form", { onSubmit: methods.handleSubmit(onSubmit), className: cx('mb-4 w-2xs relative', { 'form px-8 pt-6 pb-8 ': isBoxed }, { 'opacity-50': methods.formState.isSubmitting }, className), children: [children, submit && (jsx("div", { className: "flex items-center justify-end py-2", children: jsx(Button, { id: submitID || submit, className: submitClasses, ariaLabel: ariaSubmitLabel || submit || 'Submit', type: BTN_TYPES.SUBMIT, outline: true, isLoading: methods.formState.isSubmitting, disabled: methods.formState.isSubmitting || !methods.formState.isValid, variant: submitVariant, children: submit }) }))] }) }) })));
358
362
  };
359
363
  Form.displayName = 'Form';
360
364
 
361
- var FieldTypes;
362
- (function (FieldTypes) {
363
- FieldTypes["TEXT"] = "text";
364
- FieldTypes["TEXTAREA"] = "textarea";
365
- FieldTypes["SELECT"] = "select";
366
- FieldTypes["CHECKBOX"] = "checkbox";
367
- FieldTypes["RADIO"] = "radio";
368
- FieldTypes["SWITCH"] = "switch";
369
- FieldTypes["DATE"] = "date";
370
- FieldTypes["TIME"] = "time";
371
- FieldTypes["DATETIME"] = "datetime";
372
- FieldTypes["FILE"] = "file";
373
- FieldTypes["PASSWORD"] = "password";
374
- FieldTypes["EMAIL"] = "email";
375
- FieldTypes["NUMBER"] = "number";
376
- FieldTypes["TEL"] = "tel";
377
- FieldTypes["URL"] = "url";
378
- FieldTypes["SEARCH"] = "search";
365
+ var FIELD_TYPES;
366
+ (function (FIELD_TYPES) {
367
+ FIELD_TYPES["TEXT"] = "text";
368
+ FIELD_TYPES["TEXTAREA"] = "textarea";
369
+ FIELD_TYPES["SELECT"] = "select";
370
+ FIELD_TYPES["CHECKBOX"] = "checkbox";
371
+ FIELD_TYPES["RADIO"] = "radio";
372
+ FIELD_TYPES["SWITCH"] = "switch";
373
+ FIELD_TYPES["DATE"] = "date";
374
+ FIELD_TYPES["TIME"] = "time";
375
+ FIELD_TYPES["DATETIME"] = "datetime";
376
+ FIELD_TYPES["FILE"] = "file";
377
+ FIELD_TYPES["PASSWORD"] = "password";
378
+ FIELD_TYPES["EMAIL"] = "email";
379
+ FIELD_TYPES["NUMBER"] = "number";
380
+ FIELD_TYPES["TEL"] = "tel";
381
+ FIELD_TYPES["URL"] = "url";
382
+ FIELD_TYPES["SEARCH"] = "search";
383
+ FIELD_TYPES["HIDDEN"] = "hidden";
379
384
  // MONTH = 'month',
380
385
  // WEEK = 'week',
381
386
  // HIDDEN = 'hidden',
@@ -383,7 +388,7 @@ var FieldTypes;
383
388
  // RANGE = 'range',
384
389
  // CURRENCY = 'currency',
385
390
  // PERCENT = 'percent',
386
- })(FieldTypes || (FieldTypes = {}));
391
+ })(FIELD_TYPES || (FIELD_TYPES = {}));
387
392
 
388
393
  var InputType;
389
394
  (function (InputType) {
@@ -401,6 +406,7 @@ var InputType;
401
406
  InputType["WEEK"] = "week";
402
407
  InputType["FILE"] = "file";
403
408
  InputType["TEXTAREA"] = "textarea";
409
+ InputType["HIDDEN"] = "hidden";
404
410
  })(InputType || (InputType = {}));
405
411
 
406
412
  var TextInput = React.forwardRef(function MyInput(_a, ref) {
@@ -423,13 +429,13 @@ TextInput.displayName = 'TextInput';
423
429
 
424
430
  var Checkbox = React.forwardRef(function MyInput(_a, ref) {
425
431
  var id = _a.id, label = _a.label, required = _a.required, className = _a.className, disabled = _a.disabled, rest = __rest(_a, ["id", "label", "required", "className", "disabled"]);
426
- return (jsxs("div", { "data-testid": "Checkbox", className: cx('flex items-center', className), children: [jsxs("div", { className: "relative bg-none w-5 h-5 flex justify-center items-center", "aria-label": label, children: [jsx("input", __assign({ id: id, ref: ref, disabled: disabled, type: "checkbox", className: "form-item checkbox m-0 appearance-none peer h-full w-full shrink-0 focus:ring-2", required: required }, rest)), jsx("span", { className: "absolute transition-opacity opacity-0 pointer-events-none peer-checked:opacity-100 w-full h-full flex items-center justify-center top-0 left-0", children: jsx(Icon, { name: "mdi:check-bold", size: 12 }) })] }), label && (jsx("label", { className: "label pl-2 leading-none", htmlFor: id, children: label }))] }));
432
+ return (jsxs("div", { "data-testid": "Checkbox", className: cx('flex items-center', className), children: [jsxs("div", { className: "relative bg-none w-5 h-5 flex justify-center items-center", children: [jsx("input", __assign({ id: id, ref: ref, disabled: disabled, type: "checkbox", className: "form-item checkbox m-0 appearance-none peer h-full w-full shrink-0 focus:ring-2", required: required }, rest)), jsx("span", { className: "absolute transition-opacity opacity-0 pointer-events-none peer-checked:opacity-100 w-full h-full flex items-center justify-center top-0 left-0", children: jsx(Icon, { name: "mdi:check-bold", size: 12 }) })] }), label && (jsx("label", { className: "label pl-2 leading-none text-sm", htmlFor: id, children: label }))] }));
427
433
  });
428
434
  Checkbox.displayName = 'Checkbox';
429
435
 
430
436
  var Label = function (_a) {
431
- var label = _a.label, id = _a.id;
432
- return (jsx("label", { "data-testid": "Label", className: "label mb-1", htmlFor: id, children: label }));
437
+ var children = _a.children, id = _a.id, transform = _a.transform, className = _a.className;
438
+ return (jsx("label", { "data-testid": "Label", className: cx('label mb-2', transform, className), htmlFor: id, children: children }));
433
439
  };
434
440
  Label.displayName = 'Label';
435
441
 
@@ -438,13 +444,17 @@ var FormSelect = React.forwardRef(function MyInput(_a, ref) {
438
444
  if (!options) {
439
445
  throw new Error('FormSelect requires options prop');
440
446
  }
441
- return (jsx("div", { id: id, className: cx('pb-2', className), children: jsxs("div", { className: "relative", children: [jsx("select", __assign({ ref: ref, id: id, name: name, disabled: disabled, required: required, className: "form-item text-input" }, rest, { children: options.map(function (option) { return (jsx("option", { value: option.value, disabled: option.disabled, children: option.label }, option.value)); }) })), jsx("div", { className: "form-icon absolute inset-0 z-10 pointer-events-none h-full w-12 items-center justify-center top-0 right-0 left-auto flex", children: jsx(Icon, { name: "mdi:chevron-down", size: 24, className: "pointer-events-none" }) })] }) }));
447
+ return (jsx("div", { id: id, className: cx('pb-2 min-w-20', className), children: jsxs("div", { className: "relative", children: [jsx("select", __assign({ ref: ref, id: id, name: name, disabled: disabled, required: required, className: "form-item text-input" }, rest, { children: options.map(function (option) {
448
+ var _a, _b;
449
+ return (jsx("option", { value: (_a = option === null || option === void 0 ? void 0 : option.value) === null || _a === void 0 ? void 0 : _a.toString(), disabled: option.disabled, children: option.label }, (_b = option === null || option === void 0 ? void 0 : option.value) === null || _b === void 0 ? void 0 : _b.toString()));
450
+ }) })), jsx("div", { className: "form-icon absolute inset-0 z-10 pointer-events-none h-full w-12 items-center justify-center top-0 right-0 left-auto flex", children: jsx(Icon, { name: "mdi:chevron-down", size: 24, className: "pointer-events-none" }) })] }) }));
442
451
  });
443
452
  FormSelect.displayName = 'FormSelect';
444
453
 
445
454
  var Radio = React.forwardRef(function MyInput(_a, ref) {
446
- var id = _a.id, name = _a.name, label = _a.label, required = _a.required, className = _a.className, options = _a.options, rest = __rest(_a, ["id", "name", "label", "required", "className", "options"]);
447
- return (jsx("div", { "data-testid": "Radio", className: cx('flex items-center', className), children: jsx("div", { className: cx('flex flex-col gap-2', className), "aria-label": label, id: id, children: options === null || options === void 0 ? void 0 : options.map(function (option) { return (jsxs("div", { className: "flex items-center relative", children: [jsxs("div", { className: "relative flex items-center", children: [jsx("input", __assign({ id: option.value, ref: ref, name: name, type: "radio", value: option.value, required: required, className: "form-item radio peer appearance-none m-0 p-0 w-4 h-4" }, rest)), jsx("div", { className: "form-icon opacity-0 peer-checked:opacity-100 absolute w-4 h-4 flex items-center justify-center top-0 left-0 pointer-events-none", children: jsx(Icon, { name: "mdi:circle", size: 12 }) })] }), jsx("label", { className: "label pl-2 leading-none", htmlFor: option.value, children: option.label })] }, option.value)); }) }) }));
455
+ var name = _a.name, required = _a.required, className = _a.className, options = _a.options, rest = __rest(_a, ["name", "required", "className", "options"]);
456
+ console.log('Radio', __assign({ name: name, required: required, className: className, options: options }, rest));
457
+ return (jsx("div", { "data-testid": "Radio", className: cx('flex items-center', className), children: jsx("div", { className: cx('flex flex-col gap-2', className), children: options === null || options === void 0 ? void 0 : options.map(function (option) { return (jsxs("div", { className: "flex items-center relative", children: [jsxs("div", { className: "relative flex items-center", children: [jsx("input", __assign({ ref: ref, name: name, type: "radio", value: option.value, required: required, className: "form-item radio peer appearance-none m-0 p-0 w-4 h-4" }, rest, { id: option.value })), jsx("div", { className: "form-icon opacity-0 peer-checked:opacity-100 absolute w-4 h-4 flex items-center justify-center top-0 left-0 pointer-events-none", children: jsx(Icon, { name: "mdi:circle", size: 12 }) })] }), jsx("label", { className: "label pl-2 leading-none", htmlFor: option.value, children: option.label })] }, option.value)); }) }) }));
448
458
  });
449
459
  Radio.displayName = 'Radio';
450
460
 
@@ -461,46 +471,49 @@ var FileUpload = React.forwardRef(function MyInput(_a, ref) {
461
471
  FileUpload.displayName = 'FileUpload';
462
472
 
463
473
  var FormField = function (_a) {
464
- var name = _a.name, type = _a.type, label = _a.label, required = _a.required, className = _a.className, icon = _a.icon, options = _a.options, disabled = _a.disabled, description = _a.description, showPasswordLabel = _a.showPasswordLabel, hidePasswordLabel = _a.hidePasswordLabel;
465
- var _b = React.useState(false), passwordShowStatus = _b[0], setPasswordShow = _b[1];
466
- var _c = useFormContext(), control = _c.control, register = _c.register;
474
+ var _b;
475
+ var name = _a.name, type = _a.type, label = _a.label, required = _a.required, className = _a.className, icon = _a.icon, options = _a.options, disabled = _a.disabled, description = _a.description, showPasswordLabel = _a.showPasswordLabel, hidePasswordLabel = _a.hidePasswordLabel, _c = _a.validations, validations = _c === void 0 ? {} : _c;
476
+ var _d = React.useState(false), passwordShowStatus = _d[0], setPasswordShow = _d[1];
477
+ var _e = useFormContext(), control = _e.control, register = _e.register, errors = _e.formState.errors;
467
478
  var renderType = function (type) {
468
479
  switch (type) {
469
- case FieldTypes.TEXT:
470
- return (jsx(TextInput, __assign({ type: InputType.TEXT, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
471
- case FieldTypes.PASSWORD: {
480
+ case FIELD_TYPES.HIDDEN:
481
+ return jsx("input", __assign({ type: InputType.HIDDEN, disabled: disabled }, register(name)));
482
+ case FIELD_TYPES.TEXT:
483
+ return (jsx(TextInput, __assign({ type: InputType.TEXT, required: required, icon: icon, className: className, disabled: disabled }, register(name, validations))));
484
+ case FIELD_TYPES.PASSWORD: {
472
485
  var toggleType = passwordShowStatus ? InputType.TEXT : InputType.PASSWORD;
473
486
  var btnClass = 'appearance-none border-none bg-transparent flex items-center';
474
- return (jsxs("div", { className: "relative", children: [jsx("span", { className: "absolute right-0 top-0 flex items-center justify-center h-full z-10 pr-2", onClick: function () { return setPasswordShow(function (pS) { return !pS; }); }, role: "button", tabIndex: 0, children: passwordShowStatus ? (jsx("button", { type: "button", "aria-label": hidePasswordLabel, className: cx(btnClass, 'form-icon'), children: jsx(Icon, { name: "mdi:eye-off", size: 24 }) })) : (jsx("button", { type: "button", "aria-label": showPasswordLabel, className: cx(btnClass, 'form-icon'), children: jsx(Icon, { name: "mdi:eye", size: 24 }) })) }), jsx(TextInput, __assign({ type: toggleType, required: required, icon: icon, className: className, disabled: disabled }, register(name)))] }));
487
+ return (jsxs("div", { className: "relative", children: [jsx("span", { className: "absolute right-0 top-0 flex items-center justify-center h-full z-10 pr-2", onClick: function () { return setPasswordShow(function (pS) { return !pS; }); }, role: "button", tabIndex: 0, children: passwordShowStatus ? (jsx("button", { type: "button", "aria-label": hidePasswordLabel, className: cx(btnClass, 'form-icon'), children: jsx(Icon, { name: "mdi:eye-off", size: 24 }) })) : (jsx("button", { type: "button", "aria-label": showPasswordLabel, className: cx(btnClass, 'form-icon'), children: jsx(Icon, { name: "mdi:eye", size: 24 }) })) }), jsx(TextInput, __assign({ type: toggleType, required: required, icon: icon, className: className, disabled: disabled }, register(name, validations)))] }));
475
488
  }
476
- case FieldTypes.TEXTAREA:
477
- return (jsx(TextInput, __assign({ type: InputType.TEXTAREA, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
478
- case FieldTypes.EMAIL:
479
- return (jsx(TextInput, __assign({ type: InputType.EMAIL, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
480
- case FieldTypes.DATE:
481
- return (jsx(TextInput, __assign({ type: InputType.DATE, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
482
- case FieldTypes.DATETIME:
483
- return (jsx(TextInput, __assign({ type: InputType.DATETIME, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
484
- case FieldTypes.NUMBER:
485
- return (jsx(TextInput, __assign({ type: InputType.NUMBER, required: required, icon: icon, className: className, disabled: disabled }, register(name))));
486
- case FieldTypes.CHECKBOX:
487
- return (jsx(Checkbox, __assign({ required: required, id: name, className: className, label: label, disabled: disabled }, register(name))));
488
- case FieldTypes.RADIO:
489
- return (jsx(Radio, __assign({ required: required, id: name, className: className, label: label, options: options, disabled: disabled }, register(name))));
490
- case FieldTypes.SWITCH:
489
+ case FIELD_TYPES.TEXTAREA:
490
+ return (jsx(TextInput, __assign({ type: InputType.TEXTAREA, required: required, icon: icon, className: className, disabled: disabled }, register(name, validations))));
491
+ case FIELD_TYPES.EMAIL:
492
+ return (jsx(TextInput, __assign({ type: InputType.EMAIL, required: required, icon: icon, className: className, disabled: disabled }, register(name, validations))));
493
+ case FIELD_TYPES.DATE:
494
+ return (jsx(TextInput, __assign({ type: InputType.DATE, required: required, icon: icon, className: className, disabled: disabled }, register(name, validations))));
495
+ case FIELD_TYPES.DATETIME:
496
+ return (jsx(TextInput, __assign({ type: InputType.DATETIME, required: required, icon: icon, className: className, disabled: disabled }, register(name, validations))));
497
+ case FIELD_TYPES.NUMBER:
498
+ return (jsx(TextInput, __assign({ type: InputType.NUMBER, required: required, icon: icon, className: className, disabled: disabled }, register(name, validations))));
499
+ case FIELD_TYPES.CHECKBOX:
500
+ return (jsx(Checkbox, __assign({ required: required, id: name, className: className, label: label, disabled: disabled }, register(name, validations))));
501
+ case FIELD_TYPES.RADIO:
502
+ return (jsx(Radio, __assign({ required: required, id: name, className: className, label: label, options: options, disabled: disabled }, register(name, validations))));
503
+ case FIELD_TYPES.SWITCH:
491
504
  return jsx(Switch, __assign({ id: name, required: required, className: className, disabled: disabled }, register(name)));
492
- case FieldTypes.SELECT:
493
- return (jsx(FormSelect, __assign({ required: required, id: name, className: className, disabled: disabled, label: label, options: options }, register(name))));
494
- case FieldTypes.FILE:
495
- return (jsx(FileUpload, __assign({ required: required, id: name, className: className, disabled: disabled }, register(name))));
505
+ case FIELD_TYPES.SELECT:
506
+ return (jsx(FormSelect, __assign({ required: required, id: name, className: className, disabled: disabled, label: label, options: options }, register(name, validations))));
507
+ case FIELD_TYPES.FILE:
508
+ return (jsx(FileUpload, __assign({ required: required, id: name, className: className, disabled: disabled }, register(name, validations))));
496
509
  default:
497
- return (jsx(TextInput, __assign({ type: InputType.TEXT, required: required, disabled: disabled, icon: icon, className: className }, register(name))));
510
+ return (jsx(TextInput, __assign({ type: InputType.TEXT, required: required, disabled: disabled, icon: icon, className: className }, register(name, validations))));
498
511
  }
499
512
  };
500
513
  // TODO: HELPER CLASSES : data-[invalid=true]:bg-error data-[valid]:bg-success
501
- var showLabel = label && type !== FieldTypes.CHECKBOX;
502
- return (jsx("div", { className: "relative", children: jsxs("div", { "data-testid": "FormField", className: "mb-4", children: [showLabel && (jsx("div", { className: "flex items-baseline justify-between", children: jsx(Label, { label: label, id: name }) })), jsx(Controller, { name: name, control: control, rules: { required: required }, render: function () { return renderType(type); } }), description && jsx(Copy, { size: SIZE$1.SMALL, children: description })] }) }));
514
+ var showLabel = label && type !== FIELD_TYPES.CHECKBOX;
515
+ return (jsx("div", { className: "relative", children: jsxs("div", { "data-testid": "FormField", className: "mb-4", children: [showLabel && (jsx("div", { className: "flex items-baseline justify-between", children: jsx(Label, { id: name, children: label }) })), jsx("div", { className: "mb-1", children: jsx(Controller, { name: name, control: control, render: function () { return renderType(type); } }) }), description && (jsx("div", { className: "formfield-description", children: jsx(Copy, { size: COPY_SIZE.SMALL, children: description }) })), errors[name] && (jsx("div", { className: "formfield-error text-error italic", children: jsx(Copy, { size: COPY_SIZE.SMALL, children: (_b = errors === null || errors === void 0 ? void 0 : errors[name]) === null || _b === void 0 ? void 0 : _b.message }) }))] }) }));
503
516
  };
504
517
  FormField.displayName = 'FormField';
505
518
 
506
- export { Blockquote, Button, Container, ContentPageLayout, ContentRowsLayout, Copy, Form, FormField, Heading, Hr, Icon, Image, Link, List, ListItem, Loader, Notice };
519
+ export { BTN_SIZES, BTN_TYPES, BTN_VARIANTS, Blockquote, Button, COPY_ALIGN, COPY_CONTEXTUAL, COPY_SIZE, COPY_TAG, COPY_TRANSFORM, CPL_SPACING, CRL_SIZE, Container, ContentPageLayout, ContentRowsLayout, Copy, FIELD_TYPES, Form, FormField, HEADING_ALIGN, HEADING_TAGS, HEADING_TRANSFORM, Heading, Hr, Icon, Image, Link, List, ListItem, ListTag, Loader, Notice, Variants };