gd-design-library 0.3.5 → 0.5.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 (127) hide show
  1. package/CHANGELOG.md +119 -17
  2. package/assets/styles.css +1 -1
  3. package/components/core/DropdownItem/DropdownItem.js +30 -24
  4. package/components/core/DropdownItem/DropdownItemStyled.d.ts +1 -1
  5. package/components/core/Icon/Icon.js +25 -18
  6. package/components/core/Icon/Icon.types.d.ts +2 -0
  7. package/components/core/Image/Image.js +31 -30
  8. package/components/core/Image/Image.types.d.ts +2 -0
  9. package/components/core/Image/ImageStyled.js +14 -13
  10. package/components/core/Input/Input.d.ts +1 -1
  11. package/components/core/Input/Input.js +45 -44
  12. package/components/core/Input/Input.types.d.ts +3 -2
  13. package/components/core/Input/InputAdornment/InputAdornmentStyled.js +3 -3
  14. package/components/core/Input/InputHelper/InputHelperStyled.js +3 -3
  15. package/components/core/Input/InputStyled.d.ts +1 -1
  16. package/components/core/Input/InputWrapper/InputWrapper.js +6 -6
  17. package/components/core/Input/InputWrapper/InputWrapperStyled.js +10 -10
  18. package/components/core/Input/InputWrapper/constants.d.ts +0 -1
  19. package/components/core/Input/InputWrapper/constants.js +2 -3
  20. package/components/core/Label/Label.js +22 -21
  21. package/components/core/Label/Label.types.d.ts +3 -3
  22. package/components/core/Label/LabelStyled.d.ts +1 -1
  23. package/components/core/Label/LabelStyled.js +13 -9
  24. package/components/core/Loader/Loader.d.ts +1 -1
  25. package/components/core/Loader/Loader.js +20 -19
  26. package/components/core/Loader/Loader.types.d.ts +2 -1
  27. package/components/core/Loader/LoaderStyled.d.ts +1 -1
  28. package/components/core/Loader/LoaderStyled.js +12 -12
  29. package/components/core/Loader/utils.js +8 -8
  30. package/components/core/Menu/Menu.js +7 -7
  31. package/components/core/Modal/Modal.types.d.ts +4 -4
  32. package/components/core/Modal/ModalStyled.js +1 -1
  33. package/components/core/Portal/Portal.d.ts +1 -1
  34. package/components/core/Portal/Portal.js +12 -11
  35. package/components/core/Portal/Portal.types.d.ts +2 -1
  36. package/components/core/Select/Select.js +79 -82
  37. package/components/core/Select/Select.types.d.ts +3 -2
  38. package/components/core/Select/SelectStyled.js +6 -6
  39. package/components/core/Snackbar/Snackbar.js +25 -23
  40. package/components/core/Snackbar/Snackbar.types.d.ts +1 -0
  41. package/components/core/Snackbar/SnackbarManager.js +9 -9
  42. package/components/core/Snackbar/SnackbarStyled.js +18 -20
  43. package/components/core/Textarea/Textarea.d.ts +1 -1
  44. package/components/core/Textarea/Textarea.js +28 -34
  45. package/components/core/Textarea/Textarea.types.d.ts +1 -19
  46. package/components/core/Textarea/TextareaStyled.d.ts +1 -1
  47. package/components/core/Textarea/TextareaStyled.js +19 -21
  48. package/components/core/Textarea/hooks/useDynamicHeightAdjustment.d.ts +2 -2
  49. package/components/core/Tooltip/Tooltip.d.ts +1 -1
  50. package/components/core/Tooltip/Tooltip.js +24 -24
  51. package/components/core/Tooltip/Tooltip.types.d.ts +8 -10
  52. package/components/core/Tooltip/TooltipStyled.d.ts +2 -2
  53. package/components/core/Tooltip/TooltipStyled.js +10 -9
  54. package/components/core/Tooltip/utils.d.ts +1 -1
  55. package/components/core/Tooltip/utils.js +1 -1
  56. package/components/core/Wrapper/Wrapper.d.ts +1 -1
  57. package/components/core/Wrapper/Wrapper.js +13 -12
  58. package/components/core/Wrapper/Wrapper.types.d.ts +3 -1
  59. package/components/core/Wrapper/WrapperStyled.d.ts +1 -1
  60. package/components/core/Wrapper/WrapperStyled.js +14 -13
  61. package/components/core/types/index.types.d.ts +0 -1
  62. package/components/domainSpecific/Carousel/Carousel.js +15 -15
  63. package/components/domainSpecific/Carousel/Carousel.types.d.ts +1 -12
  64. package/components/domainSpecific/Carousel/CarouselStyled.js +45 -45
  65. package/components/domainSpecific/ContentCarousel/ContentCarousel.js +42 -43
  66. package/components/domainSpecific/Counter/CounterStyled.d.ts +1 -1
  67. package/components/domainSpecific/Counter/CounterStyled.js +17 -18
  68. package/components/domainSpecific/DragAndDropFiles/DragAndDropFiles.d.ts +0 -52
  69. package/components/domainSpecific/ProgressBar/ProgressBar.types.d.ts +1 -2
  70. package/components/domainSpecific/ProgressBar/ProgressBarStyled.js +1 -1
  71. package/components/domainSpecific/RadioGroup/RadioGroupItem/RadioGroupItem.js +2 -2
  72. package/components/domainSpecific/Search/SearchStyled.d.ts +1 -1
  73. package/components/layout/ChatContainer/ChatContainer.d.ts +2 -25
  74. package/components/layout/ChatContainer/ChatContainer.js +41 -35
  75. package/components/layout/ChatContainer/ChatContainer.types.d.ts +6 -0
  76. package/components/layout/ChatContainer/ChatContainerStyled.js +35 -32
  77. package/components/layout/FlexContainer/FlexContainer.d.ts +1 -1
  78. package/components/layout/FlexContainer/FlexContainer.js +13 -16
  79. package/components/layout/FlexContainer/FlexContainer.types.d.ts +0 -5
  80. package/components/layout/FlexContainer/FlexContainerStyled.d.ts +1 -1
  81. package/components/layout/FlexContainer/FlexContainerStyled.js +14 -20
  82. package/constants/positioning.js +1 -0
  83. package/hooks/useTheme/useTheme.js +28 -27
  84. package/index.js +256 -257
  85. package/package.json +1 -1
  86. package/stories/Introduction/ThemeJsonPreview.d.ts +3 -1
  87. package/tokens/breakpoints.d.ts +8 -0
  88. package/tokens/breakpoints.js +12 -0
  89. package/tokens/button.d.ts +19 -4
  90. package/tokens/button.js +119 -65
  91. package/tokens/carousel.d.ts +10 -19
  92. package/tokens/carousel.js +28 -36
  93. package/tokens/chat.d.ts +8 -0
  94. package/tokens/chat.js +27 -19
  95. package/tokens/chatbubble.d.ts +1 -3
  96. package/tokens/chatbubble.js +44 -25
  97. package/tokens/colors.js +5 -5
  98. package/tokens/constants.js +1 -1
  99. package/tokens/counter.d.ts +13 -6
  100. package/tokens/counter.js +20 -12
  101. package/tokens/defaultTheme.d.ts +185 -64
  102. package/tokens/defaultTheme.js +21 -11
  103. package/tokens/index.d.ts +95 -61
  104. package/tokens/index.js +100 -97
  105. package/tokens/input.d.ts +0 -1
  106. package/tokens/input.js +42 -43
  107. package/tokens/label.d.ts +1 -0
  108. package/tokens/label.js +4 -3
  109. package/tokens/loader.d.ts +3 -1
  110. package/tokens/loader.js +3 -1
  111. package/tokens/select.d.ts +1 -0
  112. package/tokens/select.js +20 -18
  113. package/tokens/shadow.js +11 -10
  114. package/tokens/snackbar.d.ts +31 -29
  115. package/tokens/snackbar.js +32 -30
  116. package/tokens/tabs.d.ts +2 -0
  117. package/tokens/tabs.js +11 -9
  118. package/tokens/tooltip.d.ts +4 -3
  119. package/tokens/tooltip.js +7 -8
  120. package/tokens/utils.d.ts +6 -0
  121. package/tokens/utils.js +27 -24
  122. package/tokens/values.d.ts +3 -0
  123. package/tokens/values.js +5 -2
  124. package/types/carousel.d.ts +12 -1
  125. package/types/index.d.ts +1 -0
  126. package/components/core/types/common.types.d.ts +0 -2
  127. /package/{components/domainSpecific/Carousel/Carousel.types.js → types/carousel.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Changelog
4
4
 
5
- ## [0.1.0]
5
+ ## [0.1.0] - 2025-05-15
6
6
 
7
7
  ### Features
8
8
 
@@ -51,25 +51,127 @@
51
51
 
52
52
  ---
53
53
 
54
- ## Previous Changes
54
+ ## [0.2.0] - 2025-06-12
55
55
 
56
- <details>
57
- <summary>Expand full history</summary>
56
+ ### Added
58
57
 
59
- ### Older Features
58
+ - New `Stepper` component with horizontal/vertical orientation
59
+ - `Button` now supports `loading` prop
60
60
 
61
- - **Search**: Added search functionality based on select (#102)
62
- - **Tabs**: Implemented Tabs component (#139)
63
- - **Stepper**: Added stepper view (#46)
64
- - **Form**: Added base form concept (#32)
65
- - **Textarea**: Added core textarea functionality (#26)
66
- - **Link**: Added Link component (#27)
67
- - **Input**: Added base input component (#13)
61
+ ### Changed
68
62
 
69
- ### Infrastructure
63
+ - `Input` now accepts `size="small" | "medium" | "large"`
64
+ - Improved `Modal` focus trap behavior
70
65
 
71
- - **Monorepo**: Integrated Nx monorepo setup
72
- - **Linting**: Configured ESLint and Prettier (#6)
73
- - **Testing**: Added Jest and React Testing Library (#11)
66
+ ### Fixed
74
67
 
75
- </details>
68
+ - Fixed `Tooltip` not displaying on keyboard focus
69
+ - `Checkbox` label alignment issue in Safari
70
+
71
+ ### Removed
72
+
73
+ - Deprecated `LegacyBanner` component (removed in v1.2.0)
74
+
75
+ ## [0.3.0] - 2025-07-14
76
+
77
+ ### Features
78
+
79
+ - Integrated Google Generative AI with markdown support and file uploads in ChatDemo.
80
+ - Added multi-chat session support with search functionality and chat caching.
81
+ - Introduced ChatBubble component with status-based styling (pending, fulfilled, rejected).
82
+ - Implemented AI feedback loop for iterative improvements in chat interactions.
83
+ - Added DragAndDrop widget with file validation and upload progress indicators.
84
+ - New Separator component for visual content division.
85
+ - Enhanced Loader with customizable name prop for targeted styling.
86
+ - Added use client directive for Next.js compatibility.
87
+ - Dynamic theme support in ChatBubble using commonHeader tokens.
88
+
89
+ ### Refactor
90
+
91
+ - Full migration from styled-components to @emotion/styled across all components.
92
+ - Restructured Storybook stories and updated meta titles for consistency.
93
+ - Replaced static styles with array-based computed styles (e.g., Avatar, Carousel).
94
+ - Standardized prop names (e.g., wrap → isWrap in Row/Column).
95
+ - Library imports are optimized for tree-shaking and performance.
96
+
97
+ ### Fixes
98
+
99
+ - Fixed OptionPicker accessibility by adding explicit type="radio".
100
+ - Resolved textarea dynamic height reset and added minHeight/maxHeight support.
101
+ - Addressed chat container overflow, snackbar shadow clipping, and file card rendering issues.
102
+ - Patched type errors, linter warnings, and CI/CD pipeline failures.
103
+ - Restored automation step in Jenkins workflow.
104
+ - Fixed ChatDemo image handling and scroll behavior.
105
+
106
+ ### Documentation
107
+
108
+ - Updated Storybook documentation for all components post-Emotion migration.
109
+ - Revised theming guide to use @emotion/styled and gd-design-library.
110
+ - Added .env.example for ChatDemo API key setup.
111
+ - Enhanced component docs with JSDoc examples and usage guidelines.
112
+
113
+ ### Summary
114
+
115
+ This release delivers major enhancements to the chat system, full Emotion adoption for styling, critical UX fixes, and
116
+ comprehensive documentation updates. The refactor improves maintainability, while new features like AI integration and
117
+ drag-and-drop elevate component capabilities.
118
+
119
+ ## [0.4.0] - 2025-08-18
120
+
121
+ ### New Features
122
+
123
+ - Added responsiveness documentation for layout composition techniques
124
+ - Implemented TokenViewer for visual theme token representation in Storybook
125
+ - Added styleVariant prop to Typography for combined styles (bold/italic/underline)
126
+ - Introduced theme export script with downloadable defaultTheme.json in documentation
127
+
128
+ ### Improvements
129
+
130
+ - Enhanced theme styles, fixed typos, and improved documentation across components
131
+ - Updated mobile responsiveness and documentation for ChatBubble, ChatContainer, and Breadcrumbs
132
+ - Refined Storybook controls and documentation for Button, Modal, and Card
133
+ - Improved Textarea usability (removed deprecated props, added rows, updated docs)
134
+ - Optimized build with tree shaking, dependency updates, and external library dependencies
135
+
136
+ ### Bug Fixes
137
+
138
+ - Fixed Carousel SSR type errors and Dropdown linting issues
139
+ - Adjusted Snackbar documentation and fixed style inconsistencies
140
+ - Fixed Image styles, Carousel token styles, and RadioGroupItem behavior
141
+ - Resolved avatar and chat page responsiveness issues
142
+ - Eliminated console warnings in app.tsx and removed unused code
143
+ - Fixed hardcoded Google API key by adding environment variable support
144
+ - Patched entry point configuration and Portal import errors
145
+
146
+ ## [0.5.0] - 2025-09-01
147
+
148
+ ### Features
149
+
150
+ - **Input**: Added wrapperAs prop for custom wrapper elements and improved styling customization
151
+ - **Form**: Introduced core form configuration system with state management and field dependencies
152
+ - **Loader**: Added customizable WrapperView prop and enhanced theme integration
153
+ - **ChatContainer**: New component for chat-based interfaces
154
+ - **Theme**: Added detailed theme previews in Storybook for colors, fonts, and spacing tokens
155
+ - **Snackbar**: Added animated close functionality and improved customization options
156
+ - **Icons**: Introduced standardized size variants (Xs, Sm, Md, Lg, Xl) for consistent scaling
157
+
158
+ ### Improvements
159
+
160
+ - **Tooltip**: Enhanced type handling, prop interfaces, and theme usage
161
+ - **Counter**: Improved type handling and theme configuration
162
+ - **Stepper**: Refactored layout using FlexContainer for better mobile experience
163
+ - **Tabs**: Enhanced styling with overflow handling and improved documentation
164
+ - **Selector**: Replaced div elements with span for better accessibility
165
+ - **Textarea**: Added dynamic height adjustment based on content
166
+ - **Documentation**: Enhanced Storybook docs with detailed prop descriptions
167
+ - **Theme**: Updated default colors and improved token structure
168
+ - **Carousel**: Refactored styles and improved content navigation flexibility
169
+
170
+ ### Fixes
171
+
172
+ - **Button**: Fixed border styling issues in disabled state
173
+ - **Textarea**: Fixed dynamic height adjustment behavior
174
+ - **Selector**: Corrected semantic HTML usage and import paths
175
+ - **Build**: Fixed dist output paths and dependency isolation
176
+ - **Types**: Resolved various TypeScript compatibility issues
177
+ - **Storybook**: Corrected TokenViewer import paths and theme consistency
package/assets/styles.css CHANGED
@@ -1 +1 @@
1
- @import"https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap";*{margin:0;padding:0;box-sizing:border-box}html,body{height:100%;font-family:Fira Sans,sans-serif;line-height:1.6}ol,ul{list-style:none}table{border-collapse:collapse}img{max-width:100%;height:auto;display:block}a{text-decoration:none;color:inherit}
1
+ @import"https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap";*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:Fira Sans,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}
@@ -1,38 +1,44 @@
1
1
  "use client";
2
- import { jsx as S } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as h, useMemo as v, useCallback as x } from "react";
4
- import { KEYBOARD_KEYS as y } from "../../../constants/keyboard.js";
5
- import { COMPONENT_NAME as f } from "./constants.js";
6
- import { DropdownItemStyled as I } from "./DropdownItemStyled.js";
7
- import { useSelectContext as C } from "../Select/hooks/useSelectContext.js";
8
- import { useTheme as K } from "../../../hooks/useTheme/useTheme.js";
9
- import { TabIndex as a } from "../../../types/accesability.js";
10
- const T = h((u, p) => {
2
+ import { jsx as h } from "@emotion/react/jsx-runtime";
3
+ import { forwardRef as x, useMemo as y, useCallback as I } from "react";
4
+ import { KEYBOARD_KEYS as C } from "../../../constants/keyboard.js";
5
+ import { COMPONENT_NAME as u } from "./constants.js";
6
+ import { DropdownItemStyled as K } from "./DropdownItemStyled.js";
7
+ import { useSelectContext as T } from "../Select/hooks/useSelectContext.js";
8
+ import { useTheme as k } from "../../../hooks/useTheme/useTheme.js";
9
+ import { TabIndex as f } from "../../../types/accesability.js";
10
+ const A = x((p, D) => {
11
11
  const {
12
- children: D,
12
+ children: b,
13
13
  value: r,
14
14
  onSelect: n,
15
15
  customClass: o,
16
16
  disabled: t,
17
- ...b
18
- } = u, {
17
+ name: a,
18
+ ...v
19
+ } = p, {
19
20
  theme: w
20
- } = K(), {
21
+ } = k(), {
21
22
  onSelect: i,
22
23
  value: s,
23
24
  itemIdentifier: m
24
- } = C(), c = s !== void 0 && m ? m(s, r) : o == null ? void 0 : o.includes("active"), E = v(() => `${o || ""} ${c ? "active" : ""}`, [o, c]), d = x((e, l) => {
25
- if (!t)
26
- return n ? n({
27
- event: e,
28
- value: l
29
- }) : i && i(e, l), l;
30
- }, [n, i, t]), N = (e) => {
31
- t || e.key === y.ENTER && (e.preventDefault(), d(e, r));
25
+ } = T(), c = s !== void 0 && m ? m(s, r) : o == null ? void 0 : o.includes("active"), E = y(() => `${o || ""} ${c ? "active" : ""}`, [o, c]), d = I((e, S) => {
26
+ if (t)
27
+ return;
28
+ const l = {
29
+ name: a,
30
+ data: S
31
+ };
32
+ return n ? n({
33
+ event: e,
34
+ value: l
35
+ }) : i && i(e, l), l;
36
+ }, [n, i, a, t]), N = (e) => {
37
+ t || e.key === C.ENTER && (e.preventDefault(), d(e, r));
32
38
  };
33
- return /* @__PURE__ */ S(I, { ref: p, theme: w, $disabled: t, tabIndex: t ? a.Disabled : a.Default, "data-testid": f, className: E, onClick: (e) => d(e, r), onKeyDown: N, ...b, children: D });
39
+ return /* @__PURE__ */ h(K, { ref: D, theme: w, $disabled: t, tabIndex: t ? f.Disabled : f.Default, "data-testid": u, className: E, onClick: (e) => d(e, r), onKeyDown: N, ...v, children: b });
34
40
  });
35
- T.displayName = f;
41
+ A.displayName = u;
36
42
  export {
37
- T as DropdownItem
43
+ A as DropdownItem
38
44
  };
@@ -1,2 +1,2 @@
1
- import { DropdownItemStyledProps } from './DropdownItem.types';
1
+ import { DropdownItemStyledProps } from './';
2
2
  export declare const DropdownItemStyled: import('react').ForwardRefExoticComponent<Omit<DropdownItemStyledProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,33 +1,40 @@
1
1
  "use client";
2
- import { jsx as d } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as p } from "react";
4
- import { IconsList as g, COMPONENT_NAME as l } from "./constants.js";
5
- import { useTheme as h } from "../../../hooks/useTheme/useTheme.js";
2
+ import { jsx as h } from "@emotion/react/jsx-runtime";
3
+ import { forwardRef as S } from "react";
4
+ import { IconsList as $, COMPONENT_NAME as l } from "./constants.js";
5
+ import { useTheme as L } from "../../../hooks/useTheme/useTheme.js";
6
6
  import { get as n } from "../../../utils/helpers.js";
7
- let r = {};
8
- const x = (o) => {
9
- r = {
10
- ...r,
7
+ let i = {};
8
+ const M = (o) => {
9
+ i = {
10
+ ...i,
11
11
  ...o
12
12
  };
13
- }, $ = p((o, m) => {
13
+ }, N = S((o, m) => {
14
14
  const {
15
15
  name: t,
16
16
  width: f,
17
17
  height: u,
18
18
  fill: s,
19
19
  fillSvg: e,
20
- ...I
20
+ size: I,
21
+ ...a
21
22
  } = o, {
22
- theme: a
23
- } = h(), i = n(a, "colors", {}), c = {
24
- ...g,
25
- ...r
23
+ theme: d
24
+ } = L(), {
25
+ icon: p,
26
+ colors: r
27
+ } = d || {}, g = n(p, ["size", I], {
28
+ width: f,
29
+ height: u
30
+ }), c = {
31
+ ...$,
32
+ ...i
26
33
  }[t];
27
- return c ? /* @__PURE__ */ d(c, { ref: m, "data-testid": `${l}-${t}`, width: f, height: u, fill: s && n(i, s, s), fillSvg: e && n(i, e, e), ...I }) : (console.warn(`Icon "${String(t)}" not found.`), null);
34
+ return c ? /* @__PURE__ */ h(c, { ref: m, "data-testid": `${l}-${t}`, fill: s && n(r, s, s), fillSvg: e && n(r, e, e), ...g, ...a }) : (console.warn(`Icon "${String(t)}" not found.`), null);
28
35
  });
29
- $.displayName = l;
36
+ N.displayName = l;
30
37
  export {
31
- $ as Icon,
32
- x as registerCustomIcons
38
+ N as Icon,
39
+ M as registerCustomIcons
33
40
  };
@@ -1,7 +1,9 @@
1
+ import { EnumOrPrimitive, SizeVariant } from '../../../types';
1
2
  export interface IconProps {
2
3
  name: string;
3
4
  width?: number;
4
5
  height?: number;
5
6
  fill?: string;
6
7
  fillSvg?: string;
8
+ size?: EnumOrPrimitive<SizeVariant>;
7
9
  }
@@ -1,39 +1,40 @@
1
1
  "use client";
2
- import { jsxs as L, jsx as o } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as N, useState as $ } from "react";
2
+ import { jsxs as j, jsx as a } from "@emotion/react/jsx-runtime";
3
+ import { forwardRef as w, useState as p, useCallback as h } from "react";
4
4
  import { COMPONENT_NAME as e } from "./constants.js";
5
- import { ImageWrapperStyled as b, PlaceholderStyled as j, ImageStyled as w, CaptionStyled as x } from "./ImageStyled.js";
6
- import { Skeleton as E } from "../Skeleton/Skeleton.js";
7
- import { useTheme as M } from "../../../hooks/useTheme/useTheme.js";
8
- const O = N((m, p) => {
5
+ import { ImageWrapperStyled as x, PlaceholderStyled as M, ImageStyled as O, CaptionStyled as P } from "./ImageStyled.js";
6
+ import { Skeleton as T } from "../Skeleton/Skeleton.js";
7
+ import { useTheme as A } from "../../../hooks/useTheme/useTheme.js";
8
+ const F = w((f, g) => {
9
9
  const {
10
- id: h,
11
- src: f,
12
- alt: g,
13
- width: i,
14
- height: d,
15
- placeholder: s,
16
- caption: l,
10
+ id: u,
11
+ src: C,
12
+ alt: k,
13
+ width: s,
14
+ height: i,
15
+ placeholder: l,
16
+ caption: d,
17
17
  onClick: y,
18
- onLoad: r,
19
- onError: a,
18
+ onLoad: t,
19
+ onError: r,
20
20
  objectFit: S,
21
- styles: u,
22
- ...C
23
- } = m, [n, c] = $(!0), {
24
- theme: t
25
- } = M(), k = () => {
26
- c(!1), r == null || r();
27
- }, I = () => {
28
- c(!1), a == null || a();
29
- };
30
- return /* @__PURE__ */ L(b, { "data-testid": `${e}-wrapper`, id: h, width: i, height: d, theme: t, ...C, children: [
31
- n && s && /* @__PURE__ */ o(j, { "data-testid": `${e}-placeholder`, theme: t, children: /* @__PURE__ */ o(E, { height: "100%", children: s }) }),
32
- /* @__PURE__ */ o(w, { "data-testid": e, theme: t, src: f, alt: g, width: i, height: d, objectFit: S, $isLoading: n, onLoad: k, onError: I, onClick: y, styles: u, ref: p }),
33
- l && /* @__PURE__ */ o(x, { "data-testid": `${e}-caption`, theme: t, children: l })
21
+ fallbackComponent: n,
22
+ styles: b,
23
+ ...E
24
+ } = f, {
25
+ theme: o
26
+ } = A(), [c, m] = p(!0), [I, L] = p(!1), N = h(() => {
27
+ m(!1), t == null || t();
28
+ }, [t]), $ = h(() => {
29
+ m(!1), L(!0), r == null || r();
30
+ }, [r]);
31
+ return /* @__PURE__ */ j(x, { "data-testid": `${e}-wrapper`, id: u, width: s, height: i, theme: o, ...E, children: [
32
+ c && l && /* @__PURE__ */ a(M, { "data-testid": `${e}-placeholder`, theme: o, children: /* @__PURE__ */ a(T, { height: "100%", children: l }) }),
33
+ I && n ? n : /* @__PURE__ */ a(O, { "data-testid": e, theme: o, src: C, alt: k, width: s, height: i, objectFit: S, $isLoading: c, onLoad: N, onError: $, onClick: y, styles: b, ref: g }),
34
+ d && /* @__PURE__ */ a(P, { "data-testid": `${e}-caption`, theme: o, children: d })
34
35
  ] });
35
36
  });
36
- O.displayName = e;
37
+ F.displayName = e;
37
38
  export {
38
- O as Image
39
+ F as Image
39
40
  };
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  import { CommonCssComponentProps, CommonCssComponentStyledProps } from '../..';
2
3
  export interface ImageProps extends CommonCssComponentProps {
3
4
  id?: string;
@@ -11,6 +12,7 @@ export interface ImageProps extends CommonCssComponentProps {
11
12
  onClick?: () => void;
12
13
  onError?: () => void;
13
14
  onLoad?: () => void;
15
+ fallbackComponent?: ReactNode;
14
16
  objectFit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
15
17
  }
16
18
  export interface ImageWrapperStyledProps extends Pick<ImageProps, 'width' | 'height' | 'id' | 'className'>, CommonCssComponentStyledProps {
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx as r } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as n } from "react";
3
+ import { forwardRef as a } from "react";
4
4
  import { get as c } from "../../../utils/helpers.js";
5
- const g = (o) => {
5
+ const h = (o) => {
6
6
  const {
7
7
  width: t,
8
8
  height: e,
@@ -15,20 +15,21 @@ const g = (o) => {
15
15
  height: `${e ? `${e}px` : "100%"}`
16
16
  }];
17
17
  return /* @__PURE__ */ r("div", { css: p, ...i });
18
- }, h = n((o, t) => {
18
+ }, u = a((o, t) => {
19
19
  const {
20
20
  objectFit: e = "cover",
21
21
  $isLoading: s,
22
22
  theme: {
23
23
  image: i
24
24
  } = {},
25
- ...p
26
- } = o, m = [c(i, "default", {}), {
25
+ styles: p,
26
+ ...m
27
+ } = o, n = [c(i, "default", {}), {
27
28
  objectFit: e,
28
29
  opacity: `${s ? 0 : 1}`
29
- }];
30
- return /* @__PURE__ */ r("img", { css: m, ...p, ref: t });
31
- }), u = (o) => {
30
+ }, p];
31
+ return /* @__PURE__ */ r("img", { css: n, ...m, ref: t });
32
+ }), y = (o) => {
32
33
  const {
33
34
  theme: {
34
35
  image: t
@@ -36,7 +37,7 @@ const g = (o) => {
36
37
  ...e
37
38
  } = o, s = [c(t, "placeholder", {})];
38
39
  return /* @__PURE__ */ r("div", { css: s, ...e });
39
- }, y = (o) => {
40
+ }, f = (o) => {
40
41
  const {
41
42
  theme: {
42
43
  image: t
@@ -46,8 +47,8 @@ const g = (o) => {
46
47
  return /* @__PURE__ */ r("figcaption", { css: s, ...e });
47
48
  };
48
49
  export {
49
- y as CaptionStyled,
50
- h as ImageStyled,
51
- g as ImageWrapperStyled,
52
- u as PlaceholderStyled
50
+ f as CaptionStyled,
51
+ u as ImageStyled,
52
+ h as ImageWrapperStyled,
53
+ y as PlaceholderStyled
53
54
  };
@@ -1,2 +1,2 @@
1
1
  import { InputFieldProps } from './Input.types';
2
- export declare const Input: import('react').ForwardRefExoticComponent<InputFieldProps & import('react').RefAttributes<HTMLInputElement>>;
2
+ export declare const Input: import('react').ForwardRefExoticComponent<(InputFieldProps & Partial<Omit<HTMLInputElement, "color" | "prefix" | "disabled" | "tabIndex" | "type" | "hidden" | "children" | "className" | "role" | "width" | "content" | "translate" | "name" | "label" | "styles" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "id" | "lang" | "nonce" | "slot" | "spellCheck" | "style" | "title" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "variant" | "placeholder" | "adornmentStart" | "adornmentEnd" | "debounceCallbackTime" | "readOnly" | "required" | "ariaRequired" | "ariaDescribedBy" | "wrapperAs" | "helperText">>) & import('react').RefAttributes<HTMLInputElement>>;
@@ -1,72 +1,73 @@
1
1
  "use client";
2
- import { jsxs as a, jsx as r, Fragment as A } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as H } from "react";
4
- import { DEFAULT_PROPS as e, COMPONENT_NAME as o, FOCUS_EXCLUDED_LIST as L } from "./constants.js";
5
- import { useInputHandlers as P } from "./useInputHandlers.js";
6
- import { InputStyled as U } from "./InputStyled.js";
7
- import { InputWrapper as p } from "./InputWrapper/InputWrapper.js";
2
+ import { jsxs as t, jsx as r, Fragment as L } from "@emotion/react/jsx-runtime";
3
+ import { forwardRef as P } from "react";
4
+ import { DEFAULT_PROPS as e, COMPONENT_NAME as o, FOCUS_EXCLUDED_LIST as U } from "./constants.js";
5
+ import { useInputHandlers as g } from "./useInputHandlers.js";
6
+ import { InputStyled as j } from "./InputStyled.js";
7
+ import { InputWrapper as c } from "./InputWrapper/InputWrapper.js";
8
8
  import { InputHelper as u } from "./InputHelper/InputHelper.js";
9
9
  import { InputAdornment as h } from "./InputAdornment/InputAdornment.js";
10
- import { useTheme as g } from "../../../hooks/useTheme/useTheme.js";
11
- import { SizeVariant as j } from "../../../types/common.js";
12
- const z = H((f, b) => {
10
+ import { useTheme as v } from "../../../hooks/useTheme/useTheme.js";
11
+ import { SizeVariant as z } from "../../../types/common.js";
12
+ const B = P((f, b) => {
13
13
  const {
14
14
  theme: I
15
- } = g(), {
15
+ } = v(), {
16
+ wrapperAs: y = "label",
16
17
  // Layout props
17
- width: y,
18
+ width: w,
18
19
  className: N = e.className,
19
20
  styles: S = e.styles,
20
21
  // Input behavior props
21
- variant: i = e.variant,
22
- color: s = e.color,
22
+ variant: s = e.variant,
23
+ color: i = e.color,
23
24
  disabled: _ = e.disabled,
24
- readOnly: w = e.readOnly,
25
+ readOnly: x = e.readOnly,
25
26
  // Accessibility props
26
- ariaRequired: x = e.ariaRequired,
27
- role: D = e.role,
28
- tabIndex: E = e.tabIndex,
27
+ ariaRequired: D = e.ariaRequired,
28
+ role: E = e.role,
29
+ tabIndex: O = e.tabIndex,
29
30
  ariaDescribedBy: l,
30
31
  // Event handling props
31
- debounceCallbackTime: O,
32
- onChange: T,
33
- onKeyDown: C,
34
- onMouseDown: M,
35
- onBlur: v,
32
+ debounceCallbackTime: T,
33
+ onChange: C,
34
+ onKeyDown: M,
35
+ onMouseDown: A,
36
+ onBlur: F,
36
37
  // Adornments
37
38
  adornmentStart: d,
38
39
  adornmentEnd: m,
39
40
  // Helper text
40
- label: t,
41
+ label: a,
41
42
  helperText: n,
42
- ...F
43
- } = f, c = !L.includes(i), R = !!(t || n), {
44
- handlers: $,
45
- isMouseInteraction: q
46
- } = P({
47
- onKeyDown: C,
48
- onBlur: v,
49
- onMouseDown: M,
50
- onChange: T,
51
- debounceCallbackTime: O
43
+ ...R
44
+ } = f, p = !U.includes(s), $ = !!(a || n), {
45
+ handlers: q,
46
+ isMouseInteraction: H
47
+ } = g({
48
+ onKeyDown: M,
49
+ onBlur: F,
50
+ onMouseDown: A,
51
+ onChange: C,
52
+ debounceCallbackTime: T
52
53
  });
53
- return /* @__PURE__ */ a(p, { as: "label", withGap: R, className: N, width: y, styles: S, children: [
54
- t && /* @__PURE__ */ r(u, { children: t }),
55
- /* @__PURE__ */ a(p, { children: [
54
+ return /* @__PURE__ */ t(c, { as: y, withGap: $, className: N, width: w, styles: S, children: [
55
+ a && /* @__PURE__ */ r(u, { children: a }),
56
+ /* @__PURE__ */ t(c, { width: "100%", children: [
56
57
  d && /* @__PURE__ */ r(h, { children: d }),
57
- /* @__PURE__ */ r(U, { $isMouseInteraction: q && c, $color: s, ref: b, disabled: _, role: D, theme: I, type: i, readOnly: w, tabIndex: E, "aria-required": x, "data-testid": o, ...$, ...l ? {
58
+ /* @__PURE__ */ r(j, { $isMouseInteraction: H && p, $color: i, ref: b, disabled: _, role: E, theme: I, type: s, readOnly: x, tabIndex: O, "aria-required": D, "data-testid": o, ...q, ...l ? {
58
59
  "aria-describedby": l
59
- } : {}, ...F }),
60
- c && /* @__PURE__ */ a(A, { children: [
61
- /* @__PURE__ */ r("div", { className: `${o}__border` }),
62
- /* @__PURE__ */ r("div", { className: `${o}__outline` })
60
+ } : {}, ...R }),
61
+ p && /* @__PURE__ */ t(L, { children: [
62
+ /* @__PURE__ */ r("span", { className: `${o}__border` }),
63
+ /* @__PURE__ */ r("span", { className: `${o}__outline` })
63
64
  ] }),
64
65
  m && /* @__PURE__ */ r(h, { children: m })
65
66
  ] }),
66
- n && /* @__PURE__ */ r(u, { color: s, size: j.Sm, children: n })
67
+ n && /* @__PURE__ */ r(u, { color: i, size: z.Sm, children: n })
67
68
  ] });
68
69
  });
69
- z.displayName = o;
70
+ B.displayName = o;
70
71
  export {
71
- z as Input
72
+ B as Input
72
73
  };
@@ -8,8 +8,8 @@ export interface BaseInputFieldProps extends CommonCssComponentProps<HTMLInputEl
8
8
  variant?: EnumOrPrimitive<InputVariantType>;
9
9
  color?: EnumOrPrimitive<InputColorVariant>;
10
10
  label?: string;
11
+ value?: string;
11
12
  placeholder?: string;
12
- value?: string | number;
13
13
  defaultValue?: string | number;
14
14
  onClick?: (event: MouseEvent<HTMLInputElement>) => void;
15
15
  onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
@@ -25,11 +25,11 @@ export interface BaseInputFieldProps extends CommonCssComponentProps<HTMLInputEl
25
25
  tabIndex?: number;
26
26
  debounceCallbackTime?: number;
27
27
  }
28
+ export type InputFieldRestHtmlProps = Partial<Omit<HTMLInputElement, keyof InputFieldProps | 'type'>>;
28
29
  export interface RadioButtonProps extends Omit<BaseInputFieldProps, 'type'> {
29
30
  type: InputVariantType.Radio;
30
31
  checked?: boolean;
31
32
  defaultChecked?: boolean;
32
- value: string | number;
33
33
  }
34
34
  export interface CheckboxFieldProps extends Omit<BaseInputFieldProps, 'type' | 'value'> {
35
35
  type: InputVariantType;
@@ -37,6 +37,7 @@ export interface CheckboxFieldProps extends Omit<BaseInputFieldProps, 'type' | '
37
37
  defaultChecked?: boolean;
38
38
  }
39
39
  export type InputFieldProps = (BaseInputFieldProps | RadioButtonProps | CheckboxFieldProps) & {
40
+ wrapperAs?: keyof HTMLElementTagNameMap | ElementType;
40
41
  width?: string;
41
42
  label?: ReactNode;
42
43
  helperText?: ReactNode;
@@ -6,9 +6,9 @@ const c = (t) => {
6
6
  theme: {
7
7
  input: e
8
8
  } = {},
9
- ...o
10
- } = t, n = [s(e, "adornment.default", {})];
11
- return /* @__PURE__ */ r("div", { css: n, ...o });
9
+ ...n
10
+ } = t, o = [s(e, "adornment.default", {})];
11
+ return /* @__PURE__ */ r("span", { css: o, ...n });
12
12
  };
13
13
  export {
14
14
  c as InputAdornmentStyled