gd-design-library 0.4.0 → 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.
- package/CHANGELOG.md +36 -3
- package/assets/styles.css +1 -1
- package/components/core/DropdownItem/DropdownItem.js +30 -24
- package/components/core/DropdownItem/DropdownItemStyled.d.ts +1 -1
- package/components/core/Icon/Icon.js +25 -18
- package/components/core/Icon/Icon.types.d.ts +2 -0
- package/components/core/Image/Image.js +31 -30
- package/components/core/Image/Image.types.d.ts +2 -0
- package/components/core/Input/Input.d.ts +1 -1
- package/components/core/Input/Input.js +45 -44
- package/components/core/Input/Input.types.d.ts +3 -2
- package/components/core/Input/InputAdornment/InputAdornmentStyled.js +3 -3
- package/components/core/Input/InputHelper/InputHelperStyled.js +3 -3
- package/components/core/Input/InputStyled.d.ts +1 -1
- package/components/core/Input/InputWrapper/InputWrapper.js +6 -6
- package/components/core/Input/InputWrapper/InputWrapperStyled.js +10 -10
- package/components/core/Input/InputWrapper/constants.d.ts +0 -1
- package/components/core/Input/InputWrapper/constants.js +2 -3
- package/components/core/Label/Label.js +22 -21
- package/components/core/Label/Label.types.d.ts +3 -3
- package/components/core/Label/LabelStyled.d.ts +1 -1
- package/components/core/Label/LabelStyled.js +13 -9
- package/components/core/Loader/Loader.d.ts +1 -1
- package/components/core/Loader/Loader.js +20 -19
- package/components/core/Loader/Loader.types.d.ts +2 -1
- package/components/core/Loader/LoaderStyled.d.ts +1 -1
- package/components/core/Loader/LoaderStyled.js +12 -12
- package/components/core/Loader/utils.js +8 -8
- package/components/core/Menu/Menu.js +7 -7
- package/components/core/Modal/Modal.types.d.ts +4 -4
- package/components/core/Modal/ModalStyled.js +1 -1
- package/components/core/Portal/Portal.d.ts +1 -1
- package/components/core/Portal/Portal.js +12 -11
- package/components/core/Portal/Portal.types.d.ts +2 -1
- package/components/core/Select/Select.js +79 -82
- package/components/core/Select/Select.types.d.ts +3 -2
- package/components/core/Select/SelectStyled.js +6 -6
- package/components/core/Snackbar/Snackbar.js +25 -23
- package/components/core/Snackbar/Snackbar.types.d.ts +1 -0
- package/components/core/Snackbar/SnackbarManager.js +9 -9
- package/components/core/Snackbar/SnackbarStyled.js +3 -5
- package/components/core/Textarea/Textarea.d.ts +1 -1
- package/components/core/Textarea/Textarea.js +28 -34
- package/components/core/Textarea/Textarea.types.d.ts +1 -19
- package/components/core/Textarea/TextareaStyled.d.ts +1 -1
- package/components/core/Textarea/TextareaStyled.js +19 -21
- package/components/core/Textarea/hooks/useDynamicHeightAdjustment.d.ts +2 -2
- package/components/core/Tooltip/Tooltip.d.ts +1 -1
- package/components/core/Tooltip/Tooltip.js +24 -24
- package/components/core/Tooltip/Tooltip.types.d.ts +8 -10
- package/components/core/Tooltip/TooltipStyled.d.ts +2 -2
- package/components/core/Tooltip/TooltipStyled.js +10 -9
- package/components/core/Tooltip/utils.d.ts +1 -1
- package/components/core/Tooltip/utils.js +1 -1
- package/components/core/Wrapper/Wrapper.d.ts +1 -1
- package/components/core/Wrapper/Wrapper.js +13 -12
- package/components/core/Wrapper/Wrapper.types.d.ts +3 -1
- package/components/core/Wrapper/WrapperStyled.d.ts +1 -1
- package/components/core/Wrapper/WrapperStyled.js +14 -13
- package/components/core/types/index.types.d.ts +0 -1
- package/components/domainSpecific/Carousel/CarouselStyled.js +44 -44
- package/components/domainSpecific/ContentCarousel/ContentCarousel.js +42 -43
- package/components/domainSpecific/Counter/CounterStyled.d.ts +1 -1
- package/components/domainSpecific/Counter/CounterStyled.js +17 -18
- package/components/domainSpecific/DragAndDropFiles/DragAndDropFiles.d.ts +0 -52
- package/components/domainSpecific/ProgressBar/ProgressBar.types.d.ts +1 -2
- package/components/domainSpecific/ProgressBar/ProgressBarStyled.js +1 -1
- package/components/domainSpecific/Search/SearchStyled.d.ts +1 -1
- package/components/layout/ChatContainer/ChatContainer.d.ts +2 -25
- package/components/layout/ChatContainer/ChatContainer.js +41 -35
- package/components/layout/ChatContainer/ChatContainer.types.d.ts +6 -0
- package/components/layout/ChatContainer/ChatContainerStyled.js +35 -32
- package/components/layout/FlexContainer/FlexContainer.d.ts +1 -1
- package/components/layout/FlexContainer/FlexContainer.js +13 -16
- package/components/layout/FlexContainer/FlexContainer.types.d.ts +0 -5
- package/components/layout/FlexContainer/FlexContainerStyled.d.ts +1 -1
- package/components/layout/FlexContainer/FlexContainerStyled.js +14 -20
- package/package.json +1 -1
- package/stories/Introduction/ThemeJsonPreview.d.ts +3 -1
- package/tokens/button.d.ts +19 -4
- package/tokens/button.js +119 -65
- package/tokens/card.d.ts +1 -5
- package/tokens/card.js +5 -9
- package/tokens/carousel.d.ts +10 -19
- package/tokens/carousel.js +28 -36
- package/tokens/chat.d.ts +4 -0
- package/tokens/chat.js +27 -23
- package/tokens/colors.js +5 -5
- package/tokens/constants.js +1 -1
- package/tokens/counter.d.ts +13 -6
- package/tokens/counter.js +20 -12
- package/tokens/defaultTheme.d.ts +59 -38
- package/tokens/index.d.ts +52 -35
- package/tokens/input.d.ts +0 -1
- package/tokens/input.js +42 -43
- package/tokens/label.d.ts +1 -0
- package/tokens/label.js +4 -3
- package/tokens/loader.d.ts +3 -1
- package/tokens/loader.js +3 -1
- package/tokens/select.d.ts +1 -0
- package/tokens/select.js +20 -18
- package/tokens/snackbar.d.ts +1 -1
- package/tokens/snackbar.js +1 -1
- package/tokens/tabs.d.ts +2 -0
- package/tokens/tabs.js +11 -9
- package/tokens/tooltip.d.ts +4 -3
- package/tokens/tooltip.js +7 -8
- package/tokens/values.d.ts +3 -0
- package/tokens/values.js +5 -2
- package/components/core/types/common.types.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
|
|
52
52
|
---
|
|
53
53
|
|
|
54
|
-
## [
|
|
54
|
+
## [0.2.0] - 2025-06-12
|
|
55
55
|
|
|
56
56
|
### Added
|
|
57
57
|
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
|
|
73
73
|
- Deprecated `LegacyBanner` component (removed in v1.2.0)
|
|
74
74
|
|
|
75
|
-
## [
|
|
75
|
+
## [0.3.0] - 2025-07-14
|
|
76
76
|
|
|
77
77
|
### Features
|
|
78
78
|
|
|
@@ -116,7 +116,7 @@ This release delivers major enhancements to the chat system, full Emotion adopti
|
|
|
116
116
|
comprehensive documentation updates. The refactor improves maintainability, while new features like AI integration and
|
|
117
117
|
drag-and-drop elevate component capabilities.
|
|
118
118
|
|
|
119
|
-
## [
|
|
119
|
+
## [0.4.0] - 2025-08-18
|
|
120
120
|
|
|
121
121
|
### New Features
|
|
122
122
|
|
|
@@ -142,3 +142,36 @@ drag-and-drop elevate component capabilities.
|
|
|
142
142
|
- Eliminated console warnings in app.tsx and removed unused code
|
|
143
143
|
- Fixed hardcoded Google API key by adding environment variable support
|
|
144
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"
|
|
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
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { KEYBOARD_KEYS as
|
|
5
|
-
import { COMPONENT_NAME as
|
|
6
|
-
import { DropdownItemStyled as
|
|
7
|
-
import { useSelectContext as
|
|
8
|
-
import { useTheme as
|
|
9
|
-
import { TabIndex as
|
|
10
|
-
const
|
|
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:
|
|
12
|
+
children: b,
|
|
13
13
|
value: r,
|
|
14
14
|
onSelect: n,
|
|
15
15
|
customClass: o,
|
|
16
16
|
disabled: t,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
name: a,
|
|
18
|
+
...v
|
|
19
|
+
} = p, {
|
|
19
20
|
theme: w
|
|
20
|
-
} =
|
|
21
|
+
} = k(), {
|
|
21
22
|
onSelect: i,
|
|
22
23
|
value: s,
|
|
23
24
|
itemIdentifier: m
|
|
24
|
-
} =
|
|
25
|
-
if (
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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__ */
|
|
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
|
-
|
|
41
|
+
A.displayName = u;
|
|
36
42
|
export {
|
|
37
|
-
|
|
43
|
+
A as DropdownItem
|
|
38
44
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DropdownItemStyledProps } from './
|
|
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
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { IconsList as
|
|
5
|
-
import { useTheme as
|
|
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
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
...
|
|
7
|
+
let i = {};
|
|
8
|
+
const M = (o) => {
|
|
9
|
+
i = {
|
|
10
|
+
...i,
|
|
11
11
|
...o
|
|
12
12
|
};
|
|
13
|
-
},
|
|
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
|
-
|
|
20
|
+
size: I,
|
|
21
|
+
...a
|
|
21
22
|
} = o, {
|
|
22
|
-
theme:
|
|
23
|
-
} =
|
|
24
|
-
|
|
25
|
-
|
|
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__ */
|
|
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
|
-
|
|
36
|
+
N.displayName = l;
|
|
30
37
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
N as Icon,
|
|
39
|
+
M as registerCustomIcons
|
|
33
40
|
};
|
|
@@ -1,39 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as
|
|
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
|
|
6
|
-
import { Skeleton as
|
|
7
|
-
import { useTheme as
|
|
8
|
-
const
|
|
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:
|
|
11
|
-
src:
|
|
12
|
-
alt:
|
|
13
|
-
width:
|
|
14
|
-
height:
|
|
15
|
-
placeholder:
|
|
16
|
-
caption:
|
|
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:
|
|
19
|
-
onError:
|
|
18
|
+
onLoad: t,
|
|
19
|
+
onError: r,
|
|
20
20
|
objectFit: S,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
|
|
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
|
-
|
|
37
|
+
F.displayName = e;
|
|
37
38
|
export {
|
|
38
|
-
|
|
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,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
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { DEFAULT_PROPS as e, COMPONENT_NAME as o, FOCUS_EXCLUDED_LIST as
|
|
5
|
-
import { useInputHandlers as
|
|
6
|
-
import { InputStyled as
|
|
7
|
-
import { InputWrapper as
|
|
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
|
|
11
|
-
import { SizeVariant as
|
|
12
|
-
const
|
|
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
|
-
} =
|
|
15
|
+
} = v(), {
|
|
16
|
+
wrapperAs: y = "label",
|
|
16
17
|
// Layout props
|
|
17
|
-
width:
|
|
18
|
+
width: w,
|
|
18
19
|
className: N = e.className,
|
|
19
20
|
styles: S = e.styles,
|
|
20
21
|
// Input behavior props
|
|
21
|
-
variant:
|
|
22
|
-
color:
|
|
22
|
+
variant: s = e.variant,
|
|
23
|
+
color: i = e.color,
|
|
23
24
|
disabled: _ = e.disabled,
|
|
24
|
-
readOnly:
|
|
25
|
+
readOnly: x = e.readOnly,
|
|
25
26
|
// Accessibility props
|
|
26
|
-
ariaRequired:
|
|
27
|
-
role:
|
|
28
|
-
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:
|
|
32
|
-
onChange:
|
|
33
|
-
onKeyDown:
|
|
34
|
-
onMouseDown:
|
|
35
|
-
onBlur:
|
|
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:
|
|
41
|
+
label: a,
|
|
41
42
|
helperText: n,
|
|
42
|
-
...
|
|
43
|
-
} = f,
|
|
44
|
-
handlers:
|
|
45
|
-
isMouseInteraction:
|
|
46
|
-
} =
|
|
47
|
-
onKeyDown:
|
|
48
|
-
onBlur:
|
|
49
|
-
onMouseDown:
|
|
50
|
-
onChange:
|
|
51
|
-
debounceCallbackTime:
|
|
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__ */
|
|
54
|
-
|
|
55
|
-
/* @__PURE__ */
|
|
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(
|
|
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
|
-
} : {}, ...
|
|
60
|
-
|
|
61
|
-
/* @__PURE__ */ r("
|
|
62
|
-
/* @__PURE__ */ r("
|
|
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:
|
|
67
|
+
n && /* @__PURE__ */ r(u, { color: i, size: z.Sm, children: n })
|
|
67
68
|
] });
|
|
68
69
|
});
|
|
69
|
-
|
|
70
|
+
B.displayName = o;
|
|
70
71
|
export {
|
|
71
|
-
|
|
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
|
-
...
|
|
10
|
-
} = t,
|
|
11
|
-
return /* @__PURE__ */ r("
|
|
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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as l } from "@emotion/react/jsx-runtime";
|
|
3
3
|
import { get as t } from "../../../../utils/helpers.js";
|
|
4
|
-
const
|
|
4
|
+
const i = (s) => {
|
|
5
5
|
const {
|
|
6
6
|
theme: {
|
|
7
7
|
input: r
|
|
@@ -10,8 +10,8 @@ const u = (s) => {
|
|
|
10
10
|
$size: e,
|
|
11
11
|
...p
|
|
12
12
|
} = s, o = t(r, "helper", {}), c = [t(o, ["default", e], {}), t(o, [n, e], {})];
|
|
13
|
-
return /* @__PURE__ */ l("
|
|
13
|
+
return /* @__PURE__ */ l("span", { css: c, ...p });
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
i as InputHelperStyled
|
|
17
17
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { InputPropsStyled } from './
|
|
1
|
+
import { InputPropsStyled } from './';
|
|
2
2
|
export declare const InputStyled: import('react').ForwardRefExoticComponent<Omit<InputPropsStyled, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as d } from "@emotion/react/jsx-runtime";
|
|
3
3
|
import { forwardRef as f } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import { InputWrapperStyled as
|
|
6
|
-
import { useTheme as
|
|
4
|
+
import { COMPONENT_NAME as t } from "./constants.js";
|
|
5
|
+
import { InputWrapperStyled as n } from "./InputWrapperStyled.js";
|
|
6
|
+
import { useTheme as h } from "../../../../hooks/useTheme/useTheme.js";
|
|
7
7
|
const c = f((r, e) => {
|
|
8
8
|
const {
|
|
9
9
|
theme: o
|
|
10
|
-
} =
|
|
10
|
+
} = h(), {
|
|
11
11
|
children: p,
|
|
12
|
-
as: i
|
|
12
|
+
as: i,
|
|
13
13
|
width: m,
|
|
14
14
|
withGap: a,
|
|
15
15
|
...s
|
|
16
16
|
} = r;
|
|
17
|
-
return /* @__PURE__ */ d(
|
|
17
|
+
return /* @__PURE__ */ d(n, { $as: i, $width: m, $withGap: a, ref: e, theme: o, "data-testid": t, ...s, children: p });
|
|
18
18
|
});
|
|
19
19
|
c.displayName = t;
|
|
20
20
|
export {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as a } from "@emotion/react/jsx-runtime";
|
|
3
3
|
import { get as t } from "../../../../utils/helpers.js";
|
|
4
|
-
const
|
|
4
|
+
const d = (s) => {
|
|
5
5
|
const {
|
|
6
6
|
theme: {
|
|
7
|
-
input:
|
|
7
|
+
input: o
|
|
8
8
|
} = {},
|
|
9
9
|
$width: e,
|
|
10
|
-
$as:
|
|
11
|
-
$withGap:
|
|
12
|
-
styles:
|
|
13
|
-
...
|
|
14
|
-
} =
|
|
10
|
+
$as: n = "span",
|
|
11
|
+
$withGap: r,
|
|
12
|
+
styles: c = {},
|
|
13
|
+
...i
|
|
14
|
+
} = s, p = t(o, "wrapper", {}), m = [t(p, "default", {}), r ? t(p, "withGap", {}) : {}, e ? {
|
|
15
15
|
width: e
|
|
16
|
-
} : {},
|
|
17
|
-
return /* @__PURE__ */ a(
|
|
16
|
+
} : {}, c];
|
|
17
|
+
return /* @__PURE__ */ a(n, { css: m, ...i });
|
|
18
18
|
};
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
d as InputWrapperStyled
|
|
21
21
|
};
|