gd-design-library 1.3.0 → 1.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 (113) hide show
  1. package/ai/README.md +1 -1
  2. package/ai/schemas/components/Badge.d.ts +57 -0
  3. package/ai/schemas/components/ContentCarousel.d.ts +21 -2
  4. package/ai/schemas/components/InputFile.d.ts +1 -1
  5. package/ai/schemas/components/Table.d.ts +78 -0
  6. package/ai/schemas/components/Truncate.d.ts +46 -0
  7. package/components/core/Badge/Badge.d.ts +2 -0
  8. package/components/core/Badge/Badge.js +30 -0
  9. package/components/core/Badge/Badge.types.d.ts +20 -0
  10. package/components/core/Badge/BadgeStyled.d.ts +5 -0
  11. package/components/core/Badge/BadgeStyled.js +54 -0
  12. package/components/core/Badge/constants.d.ts +1 -0
  13. package/components/core/Badge/constants.js +4 -0
  14. package/components/core/Badge/index.d.ts +2 -0
  15. package/components/core/Box/index.d.ts +0 -1
  16. package/components/core/Button/Button.js +14 -14
  17. package/components/core/DropdownItem/DropdownItem.js +34 -33
  18. package/components/core/Input/Input.js +61 -61
  19. package/components/core/Input/Input.types.d.ts +0 -1
  20. package/components/core/Input/InputWrapper/InputWrapper.js +10 -11
  21. package/components/core/Input/InputWrapper/InputWrapperStyled.js +13 -16
  22. package/components/core/Input/constants.d.ts +0 -1
  23. package/components/core/Input/constants.js +10 -12
  24. package/components/core/Modal/Modal.js +42 -53
  25. package/components/core/Modal/Modal.stories.play.d.ts +5 -0
  26. package/components/core/Modal/Modal.types.d.ts +1 -0
  27. package/components/core/Select/Select.js +215 -179
  28. package/components/core/Select/Select.stories.play.d.ts +10 -0
  29. package/components/core/Select/Select.types.d.ts +6 -4
  30. package/components/core/Select/SelectStyled.d.ts +1 -2
  31. package/components/core/Select/SelectStyled.js +7 -8
  32. package/components/core/Table/Table.d.ts +2 -0
  33. package/components/core/Table/Table.js +275 -0
  34. package/components/core/Table/Table.stories.play.d.ts +14 -0
  35. package/components/core/Table/Table.types.d.ts +94 -0
  36. package/components/core/Table/TableBody.d.ts +2 -0
  37. package/components/core/Table/TableBody.js +20 -0
  38. package/components/core/Table/TableCell.d.ts +2 -0
  39. package/components/core/Table/TableCell.js +20 -0
  40. package/components/core/Table/TableFooter.d.ts +2 -0
  41. package/components/core/Table/TableFooter.js +21 -0
  42. package/components/core/Table/TableHead.d.ts +2 -0
  43. package/components/core/Table/TableHead.js +20 -0
  44. package/components/core/Table/TableHeaderCell.d.ts +2 -0
  45. package/components/core/Table/TableHeaderCell.js +20 -0
  46. package/components/core/Table/TablePagination.d.ts +2 -0
  47. package/components/core/Table/TablePagination.js +66 -0
  48. package/components/core/Table/TableRow.d.ts +2 -0
  49. package/components/core/Table/TableRow.js +28 -0
  50. package/components/core/Table/TableStyled.d.ts +11 -0
  51. package/components/core/Table/TableStyled.js +141 -0
  52. package/components/core/Table/constants.d.ts +9 -0
  53. package/components/core/Table/constants.js +12 -0
  54. package/components/core/Table/index.d.ts +9 -0
  55. package/components/core/Textarea/Textarea.d.ts +0 -4
  56. package/components/core/Textarea/Textarea.js +30 -28
  57. package/components/core/Textarea/Textarea.types.d.ts +7 -13
  58. package/components/core/Textarea/Textarea.types.js +2 -4
  59. package/components/core/Textarea/TextareaStyled.js +25 -24
  60. package/components/core/Tooltip/Tooltip.js +49 -58
  61. package/components/core/Tooltip/utils.js +90 -50
  62. package/components/core/Truncate/Truncate.d.ts +2 -0
  63. package/components/core/Truncate/Truncate.js +52 -0
  64. package/components/core/Truncate/Truncate.stories.play.d.ts +4 -0
  65. package/components/core/Truncate/Truncate.types.d.ts +12 -0
  66. package/components/core/Truncate/TruncateStyled.d.ts +2 -0
  67. package/components/core/Truncate/TruncateStyled.js +22 -0
  68. package/components/core/Truncate/constants.d.ts +1 -0
  69. package/components/core/Truncate/constants.js +4 -0
  70. package/components/core/Truncate/index.d.ts +2 -0
  71. package/components/core/index.d.ts +3 -0
  72. package/components/domainSpecific/ContentCarousel/ContentCarousel.js +86 -53
  73. package/components/domainSpecific/ContentCarousel/ContentCarousel.types.d.ts +4 -0
  74. package/components/domainSpecific/ContentCarousel/ContentCarouselStyled.d.ts +5 -1
  75. package/components/domainSpecific/ContentCarousel/ContentCarouselStyled.js +27 -18
  76. package/components/domainSpecific/Counter/Counter.stories.play.d.ts +6 -0
  77. package/components/domainSpecific/DragAndDropFiles/DragAndDropFiles.stories.play.d.ts +5 -0
  78. package/components/domainSpecific/Price/Price.stories.play.d.ts +8 -0
  79. package/components/domainSpecific/Search/Search.js +4 -4
  80. package/components/domainSpecific/Search/Search.stories.play.d.ts +5 -0
  81. package/hooks/useCarousel/useCarousel.js +16 -16
  82. package/hooks/useTheme/NoOpTheme.d.ts +433 -43
  83. package/index.js +352 -332
  84. package/llms.txt +24 -6
  85. package/package.json +4 -2
  86. package/tokens/badge.d.ts +235 -0
  87. package/tokens/badge.js +239 -0
  88. package/tokens/borders.d.ts +1 -1
  89. package/tokens/borders.js +8 -9
  90. package/tokens/button.d.ts +1 -1
  91. package/tokens/defaultTheme.d.ts +433 -43
  92. package/tokens/defaultTheme.js +103 -97
  93. package/tokens/index.d.ts +310 -43
  94. package/tokens/index.js +89 -83
  95. package/tokens/input.d.ts +14 -13
  96. package/tokens/input.js +50 -49
  97. package/tokens/table.d.ts +124 -0
  98. package/tokens/table.js +128 -0
  99. package/tokens/tabs.d.ts +3 -1
  100. package/tokens/tabs.js +10 -12
  101. package/tokens/textarea.d.ts +45 -32
  102. package/tokens/textarea.js +51 -32
  103. package/tokens/tooltip.d.ts +2 -1
  104. package/tokens/tooltip.js +2 -1
  105. package/tokens/truncate.d.ts +9 -0
  106. package/tokens/truncate.js +12 -0
  107. package/tokens/utils.d.ts +1 -1
  108. package/tokens/utils.js +32 -33
  109. package/tokens/values.js +17 -20
  110. package/utils/play/index.d.ts +1 -0
  111. package/utils/play/interactionUtils.d.ts +16 -0
  112. package/utils/play/mockUtils.d.ts +14 -0
  113. package/utils/play/waitUtils.d.ts +7 -0
package/ai/README.md CHANGED
@@ -85,7 +85,7 @@ Component catalog
85
85
  - Forms: Form, Input, Select, Search, Label, Textarea, Switch, Toggle, RadioGroup, Slider, InputFile, DragAndDropFiles
86
86
  - Feedback & overlays: InlineNotification, Loader, Skeleton, Snackbar, SnackbarManager, Tooltip, Modal, Portal
87
87
  - Navigation & structure: Breadcrumbs, Tabs, Stepper, List, Accordion (with subcomponents: AccordionItem, AccordionHeader, AccordionContent), Link
88
- - Display & content: Typography, Button, Icon, Image, Card, Avatar, Carousel, ContentCarousel, Counter, Price, ProgressBar, Rating, ChatContainer, ChatBubble
88
+ - Display & content: Typography, Button, Icon, Image, Card, Avatar, Carousel, ContentCarousel (with visibleItems, scrollStep, scrollAlignment props), Counter, Price, ProgressBar, Rating, ChatContainer, ChatBubble
89
89
  - Not part of gd-design-library (do not request/use): Grid, Stack, Alert, Toast, Table, Badge, ButtonGroup, Dropdown, Drawer, Popover, Pagination, Heading, Spinner.
90
90
 
91
91
  Important component structures:
@@ -0,0 +1,57 @@
1
+ declare const _default: {
2
+ component: {
3
+ name: string;
4
+ import: string;
5
+ description: string;
6
+ category: string;
7
+ complexity: string;
8
+ accessibility: string;
9
+ performance: string;
10
+ dependencies: string[];
11
+ peerDependencies: string[];
12
+ bundleSize: string;
13
+ browserSupport: string;
14
+ touchSupport: boolean;
15
+ keyboardSupport: boolean;
16
+ screenReaderSupport: boolean;
17
+ props: ({
18
+ name: string;
19
+ type: string;
20
+ description: string;
21
+ default: string;
22
+ enum: string[];
23
+ required?: undefined;
24
+ } | {
25
+ name: string;
26
+ type: string;
27
+ description: string;
28
+ default: string;
29
+ enum?: undefined;
30
+ required?: undefined;
31
+ } | {
32
+ name: string;
33
+ type: string;
34
+ description: string;
35
+ default?: undefined;
36
+ enum?: undefined;
37
+ required?: undefined;
38
+ } | {
39
+ name: string;
40
+ type: string;
41
+ description: string;
42
+ required: boolean;
43
+ default?: undefined;
44
+ enum?: undefined;
45
+ } | {
46
+ name: string;
47
+ type: string;
48
+ description: string;
49
+ default: {};
50
+ enum?: undefined;
51
+ required?: undefined;
52
+ })[];
53
+ examples: string[];
54
+ };
55
+ compositionTips: string[];
56
+ };
57
+ export default _default;
@@ -50,6 +50,24 @@ declare const _default: {
50
50
  required?: undefined;
51
51
  examples?: undefined;
52
52
  recommended?: undefined;
53
+ } | {
54
+ name: string;
55
+ type: string;
56
+ description: string;
57
+ default: string;
58
+ examples: number[];
59
+ recommended: string;
60
+ required?: undefined;
61
+ accessibility?: undefined;
62
+ } | {
63
+ name: string;
64
+ type: string;
65
+ description: string;
66
+ default: string;
67
+ examples: string[];
68
+ recommended: string;
69
+ required?: undefined;
70
+ accessibility?: undefined;
53
71
  } | {
54
72
  name: string;
55
73
  type: string;
@@ -72,8 +90,9 @@ declare const _default: {
72
90
  quickStart: {
73
91
  basic: string;
74
92
  withNavigation: string;
75
- itemByItem: string;
76
- accessible: string;
93
+ multipleVisible: string;
94
+ centered: string;
95
+ customScrollStep: string;
77
96
  };
78
97
  commonPatterns: {
79
98
  'Product Gallery': {
@@ -25,7 +25,7 @@ declare const _default: {
25
25
  name: string;
26
26
  type: string;
27
27
  description: string;
28
- enum: (string | boolean)[];
28
+ enum: readonly ["user", "environment"];
29
29
  default: string;
30
30
  required?: undefined;
31
31
  } | {
@@ -0,0 +1,78 @@
1
+ declare const _default: {
2
+ component: {
3
+ name: string;
4
+ import: string;
5
+ description: string;
6
+ category: string;
7
+ complexity: string;
8
+ accessibility: string;
9
+ performance: string;
10
+ dependencies: string[];
11
+ peerDependencies: string[];
12
+ bundleSize: string;
13
+ browserSupport: string;
14
+ touchSupport: boolean;
15
+ keyboardSupport: boolean;
16
+ screenReaderSupport: boolean;
17
+ props: ({
18
+ name: string;
19
+ type: string;
20
+ description: string;
21
+ required: boolean;
22
+ example: string;
23
+ default?: undefined;
24
+ } | {
25
+ name: string;
26
+ type: string;
27
+ description: string;
28
+ default: boolean;
29
+ required?: undefined;
30
+ example?: undefined;
31
+ } | {
32
+ name: string;
33
+ type: string;
34
+ description: string;
35
+ default: number;
36
+ required?: undefined;
37
+ example?: undefined;
38
+ } | {
39
+ name: string;
40
+ type: string;
41
+ description: string;
42
+ example: string;
43
+ required?: undefined;
44
+ default?: undefined;
45
+ } | {
46
+ name: string;
47
+ type: string;
48
+ description: string;
49
+ default: number[];
50
+ example: string;
51
+ required?: undefined;
52
+ } | {
53
+ name: string;
54
+ type: string;
55
+ description: string;
56
+ required?: undefined;
57
+ example?: undefined;
58
+ default?: undefined;
59
+ })[];
60
+ ref: {
61
+ type: string;
62
+ description: string;
63
+ methods: {
64
+ name: string;
65
+ type: string;
66
+ description: string;
67
+ example: string;
68
+ }[];
69
+ example: string;
70
+ };
71
+ examples: string[];
72
+ bestPractices: string[];
73
+ commonMistakes: string[];
74
+ relatedComponents: string[];
75
+ };
76
+ compositionTips: string[];
77
+ };
78
+ export default _default;
@@ -0,0 +1,46 @@
1
+ declare const _default: {
2
+ component: {
3
+ name: string;
4
+ import: string;
5
+ description: string;
6
+ category: string;
7
+ complexity: string;
8
+ accessibility: string;
9
+ performance: string;
10
+ dependencies: string[];
11
+ peerDependencies: string[];
12
+ bundleSize: string;
13
+ browserSupport: string;
14
+ touchSupport: boolean;
15
+ keyboardSupport: boolean;
16
+ screenReaderSupport: boolean;
17
+ props: ({
18
+ name: string;
19
+ type: string;
20
+ description: string;
21
+ required: boolean;
22
+ default?: undefined;
23
+ } | {
24
+ name: string;
25
+ type: string;
26
+ description: string;
27
+ default: number;
28
+ required?: undefined;
29
+ } | {
30
+ name: string;
31
+ type: string;
32
+ description: string;
33
+ default: {};
34
+ required?: undefined;
35
+ } | {
36
+ name: string;
37
+ type: string;
38
+ description: string;
39
+ required?: undefined;
40
+ default?: undefined;
41
+ })[];
42
+ examples: string[];
43
+ };
44
+ compositionTips: string[];
45
+ };
46
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import { BadgeProps } from './';
2
+ export declare const Badge: import('react').ForwardRefExoticComponent<BadgeProps & import('react').RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { jsxs as p, jsx as d } from "@emotion/react/jsx-runtime";
3
+ import { forwardRef as f } from "react";
4
+ import { convertToInlineBoxStyles as u } from "../../../tokens/utils.js";
5
+ import { COMPONENT_NAME as e } from "./constants.js";
6
+ import { BadgeStyled as y, BadgeStartIconStyled as $, BadgeContentStyled as B, BadgeEndIconStyled as g } from "./BadgeStyled.js";
7
+ import { useTheme as h } from "../../../hooks/useTheme/useTheme.js";
8
+ const S = f(({
9
+ variant: n = "primary",
10
+ appearance: o = "filled",
11
+ size: l = "md",
12
+ children: i,
13
+ disabled: m,
14
+ iconStart: r = null,
15
+ iconEnd: a = null,
16
+ ...s
17
+ }, c) => {
18
+ const {
19
+ theme: t
20
+ } = h();
21
+ return /* @__PURE__ */ p(y, { ref: c, $variant: n, $appearance: o, $size: l, theme: t, $disabled: m, "data-testid": e, ...u(s), children: [
22
+ r ? /* @__PURE__ */ d($, { theme: t, "data-testid": `${e}-icon-start`, children: r }) : null,
23
+ /* @__PURE__ */ d(B, { theme: t, "data-testid": `${e}-content`, children: i }),
24
+ a ? /* @__PURE__ */ d(g, { theme: t, "data-testid": `${e}-icon-end`, children: a }) : null
25
+ ] });
26
+ });
27
+ S.displayName = e;
28
+ export {
29
+ S as Badge
30
+ };
@@ -0,0 +1,20 @@
1
+ import { PropsWithChildren, ReactNode } from 'react';
2
+ import { EnumOrPrimitive } from '../../../types';
3
+ import { BoxCssComponentProps, BoxCssComponentStyledProps } from '../..';
4
+ export type BadgeVariant = 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'quinary';
5
+ export type BadgeAppearance = 'outline' | 'outlineFilledLight' | 'filled' | 'filledLight';
6
+ export type BadgeSize = 'sm' | 'md';
7
+ export interface BadgeProps extends BoxCssComponentProps<HTMLSpanElement>, PropsWithChildren {
8
+ variant?: EnumOrPrimitive<BadgeVariant>;
9
+ disabled?: boolean;
10
+ appearance?: EnumOrPrimitive<BadgeAppearance>;
11
+ size?: EnumOrPrimitive<BadgeSize>;
12
+ iconStart?: ReactNode;
13
+ iconEnd?: ReactNode;
14
+ }
15
+ export interface BadgeStyledProps extends BoxCssComponentStyledProps<HTMLSpanElement>, PropsWithChildren {
16
+ $variant?: EnumOrPrimitive<BadgeVariant>;
17
+ $appearance?: EnumOrPrimitive<BadgeAppearance>;
18
+ $size?: EnumOrPrimitive<BadgeSize>;
19
+ $disabled?: boolean;
20
+ }
@@ -0,0 +1,5 @@
1
+ import { BadgeStyledProps } from './';
2
+ export declare const BadgeStyled: import('react').ForwardRefExoticComponent<Omit<BadgeStyledProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
3
+ export declare const BadgeContentStyled: import('react').ForwardRefExoticComponent<Omit<BadgeStyledProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
4
+ export declare const BadgeStartIconStyled: import('react').ForwardRefExoticComponent<Omit<BadgeStyledProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
5
+ export declare const BadgeEndIconStyled: import('react').ForwardRefExoticComponent<Omit<BadgeStyledProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,54 @@
1
+ import { jsx as d } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as a } from "react";
3
+ import { getBoxStyles as i, tokensHandler as B } from "../../../tokens/utils.js";
4
+ import { get as e } from "../../../utils/helpers.js";
5
+ const I = a(({
6
+ theme: {
7
+ badge: s,
8
+ ...n
9
+ } = {},
10
+ $variant: t,
11
+ $appearance: o,
12
+ $size: r,
13
+ $disabled: l,
14
+ className: m,
15
+ styles: f = {},
16
+ ...g
17
+ }, p) => {
18
+ const {
19
+ boxStyles: y,
20
+ restProps: S
21
+ } = i(g), c = new Proxy(s || {}, B(n)), u = [e(c, "default", {}), e(c, [t, o, "default"], {}), l ? e(c, [t, o, "disabled"], {}) : {}, r ? e(c, ["size", r], {}) : {}, y, f];
22
+ return /* @__PURE__ */ d("span", { css: u, className: m, ...S, ref: p });
23
+ }), N = a(({
24
+ theme: {
25
+ badge: s
26
+ } = {},
27
+ styles: n,
28
+ ...t
29
+ }, o) => {
30
+ const r = e(s, "content", {});
31
+ return /* @__PURE__ */ d("span", { css: [e(r, "default", {}), n], className: "gd-badge__content", ...t, ref: o });
32
+ }), P = a(({
33
+ theme: {
34
+ badge: s
35
+ } = {},
36
+ ...n
37
+ }, t) => {
38
+ const o = e(s, "startIcon", {});
39
+ return /* @__PURE__ */ d("span", { css: e(o, "default", {}), className: "gd-badge__icon-start", ...n, ref: t });
40
+ }), w = a(({
41
+ theme: {
42
+ badge: s
43
+ } = {},
44
+ ...n
45
+ }, t) => {
46
+ const o = e(s, "endIcon", {});
47
+ return /* @__PURE__ */ d("span", { css: e(o, "default", {}), className: "gd-badge__icon-end", ...n, ref: t });
48
+ });
49
+ export {
50
+ N as BadgeContentStyled,
51
+ w as BadgeEndIconStyled,
52
+ P as BadgeStartIconStyled,
53
+ I as BadgeStyled
54
+ };
@@ -0,0 +1 @@
1
+ export declare const COMPONENT_NAME = "Badge";
@@ -0,0 +1,4 @@
1
+ const N = "Badge";
2
+ export {
3
+ N as COMPONENT_NAME
4
+ };
@@ -0,0 +1,2 @@
1
+ export * from './Badge';
2
+ export * from './Badge.types';
@@ -1,3 +1,2 @@
1
1
  export * from './Box';
2
2
  export * from './Box.types';
3
- export * from './constants';
@@ -8,32 +8,32 @@ import { ButtonVariant as v, ButtonTypes as P, ButtonRole as M } from "../../../
8
8
  import { useTheme as O } from "../../../hooks/useTheme/useTheme.js";
9
9
  import { get as R } from "../../../utils/helpers.js";
10
10
  import { TabIndex as W } from "../../../types/accesability.js";
11
- const g = x((u, m) => {
11
+ const g = x((s, u) => {
12
12
  const {
13
13
  theme: t
14
14
  } = O(), {
15
- variant: c = v.Primary,
16
- rounded: f = R(t, "button.attrs.rounded", "none"),
15
+ variant: m = v.Primary,
16
+ rounded: c = R(t, "button.attrs.rounded", "none"),
17
17
  children: o,
18
18
  iconStart: r = null,
19
19
  iconEnd: a = null,
20
- type: p = P.Button,
21
- disabled: y = !1,
22
- isIcon: h = !1,
20
+ type: f = P.Button,
21
+ disabled: p = !1,
22
+ isIcon: y = !1,
23
23
  ariaLabel: i,
24
24
  ariaPressed: l,
25
- role: B = M.Button,
26
- fullWidth: I = !1,
27
- tabIndex: S = W.Default,
28
- onClick: $,
25
+ role: h = M.Button,
26
+ fullWidth: B = !1,
27
+ tabIndex: I = W.Default,
28
+ onClick: S,
29
29
  justifyContent: d,
30
- ...s
31
- } = u;
32
- return /* @__PURE__ */ b(C, { ref: m, $variant: c, $isIcon: h, $fullWidth: I, $rounded: f, disabled: y, onClick: $, type: p, role: B, theme: t, tabIndex: S, "data-testid": e, ...T(s), ...i ? {
30
+ ...$
31
+ } = s;
32
+ return /* @__PURE__ */ b(C, { ref: u, $variant: m, $isIcon: y, $fullWidth: B, $rounded: c, disabled: p, onClick: S, type: f, role: h, theme: t, tabIndex: I, "data-testid": e, ...T($), ...i ? {
33
33
  "aria-label": i
34
34
  } : {}, ...l ? {
35
35
  "aria-pressed": l
36
- } : {}, ...s, children: [
36
+ } : {}, children: [
37
37
  r ? /* @__PURE__ */ n(E, { theme: t, "data-testid": `${e}-icon-start`, children: r }) : null,
38
38
  o ? /* @__PURE__ */ n(N, { theme: t, styles: d ? {
39
39
  justifyContent: d
@@ -1,45 +1,46 @@
1
1
  "use client";
2
2
  import { jsx as E } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as x, useMemo as I, useCallback as u } from "react";
4
- import { KEYBOARD_KEYS as O } from "../../../constants/keyboard.js";
3
+ import { forwardRef as x, useMemo as O, useCallback as p } from "react";
4
+ import { KEYBOARD_KEYS as K } from "../../../constants/keyboard.js";
5
5
  import { COMPONENT_NAME as D } from "./constants.js";
6
- import { DropdownItemStyled as v } from "./DropdownItemStyled.js";
7
- import { useSelectContext as K } from "../Select/hooks/useSelectContext.js";
8
- import { useTheme as T } from "../../../hooks/useTheme/useTheme.js";
9
- import { TabIndex as p } from "../../../types/accesability.js";
10
- const k = x((S, N) => {
6
+ import { DropdownItemStyled as N } 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 y } from "../../../types/accesability.js";
10
+ const I = x((S, v) => {
11
11
  const {
12
- children: y,
13
- value: n,
14
- onSelect: i,
15
- className: o,
16
- disabled: e,
17
- name: d,
12
+ children: A,
13
+ value: a,
14
+ onSelect: l,
15
+ className: e,
16
+ disabled: t,
17
+ name: c,
18
18
  ...b
19
19
  } = S, {
20
20
  theme: h
21
- } = T(), {
21
+ } = k(), {
22
22
  onSelect: s,
23
- value: l,
24
- itemIdentifier: m
25
- } = K(), r = {
26
- name: d,
27
- value: n
28
- }, c = JSON.stringify(r), f = l !== void 0 && m ? m(l, r) : o == null ? void 0 : o.includes("active"), w = I(() => `${o || ""} ${f ? "active" : ""}`, [o, f]), a = u((t) => {
29
- if (!e)
30
- return i ? i({
31
- event: t,
32
- data: r
23
+ value: n,
24
+ itemIdentifier: i,
25
+ multiple: u
26
+ } = T(), o = {
27
+ name: c,
28
+ value: a
29
+ }, f = JSON.stringify(o), m = n === void 0 ? e == null ? void 0 : e.includes("active") : u && Array.isArray(n) ? n.some((r) => (i == null ? void 0 : i(r, o)) ?? r.value === o.value) : !u && !Array.isArray(n) && i ? i(n, o) : e == null ? void 0 : e.includes("active"), w = O(() => `${e || ""} ${m ? "active" : ""}`, [e, m]), d = p((r) => {
30
+ if (!t)
31
+ return l ? l({
32
+ event: r,
33
+ data: o
33
34
  }) : s && s({
34
- event: t,
35
- data: r
36
- }), n;
37
- }, [i, s, c, JSON.stringify(n), e]), C = u((t) => {
38
- e || t.key === O.ENTER && (t.preventDefault(), a(t));
39
- }, [a, e, c]);
40
- return /* @__PURE__ */ E(v, { ref: N, theme: h, $disabled: e, tabIndex: e ? p.Disabled : p.Default, "data-testid": D, className: w, onClick: a, onKeyDown: C, ...b, children: y || d });
35
+ event: r,
36
+ data: o
37
+ }), a;
38
+ }, [l, s, f, JSON.stringify(a), t]), C = p((r) => {
39
+ t || r.key === K.ENTER && (r.preventDefault(), d(r));
40
+ }, [d, t, f]);
41
+ return /* @__PURE__ */ E(N, { ref: v, theme: h, $disabled: t, tabIndex: t ? y.Disabled : y.Default, "data-testid": D, className: w, onClick: d, onKeyDown: C, ...b, children: A || c });
41
42
  });
42
- k.displayName = D;
43
+ I.displayName = D;
43
44
  export {
44
- k as DropdownItem
45
+ I as DropdownItem
45
46
  };
@@ -1,73 +1,73 @@
1
1
  "use client";
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";
2
+ import { jsxs as s, jsx as r, Fragment as j } from "@emotion/react/jsx-runtime";
3
+ import { forwardRef as q } from "react";
4
+ import { COMPONENT_NAME as o, DEFAULT_PROPS as e, FOCUS_EXCLUDED_LIST as x } from "./constants.js";
5
+ import { useInputHandlers as z } from "./useInputHandlers.js";
6
+ import { InputStyled as D } from "./InputStyled.js";
7
+ import { InputWrapper as l } from "./InputWrapper/InputWrapper.js";
8
8
  import { InputHelper as u } from "./InputHelper/InputHelper.js";
9
- import { InputAdornment as h } from "./InputAdornment/InputAdornment.js";
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) => {
9
+ import { InputAdornment as f } from "./InputAdornment/InputAdornment.js";
10
+ import { useTheme as T } from "../../../hooks/useTheme/useTheme.js";
11
+ import { SizeVariant as g } from "../../../types/common.js";
12
+ const G = q(({
13
+ wrapperAs: h = "label",
14
+ // Layout props
15
+ styles: I = {},
16
+ className: _ = "",
17
+ width: N,
18
+ // Input behavior props
19
+ variant: n = e.variant,
20
+ color: m = e.color,
21
+ disabled: S = e.disabled,
22
+ readOnly: O = e.readOnly,
23
+ // Accessibility props
24
+ ariaRequired: w = e.ariaRequired,
25
+ role: y = e.role,
26
+ tabIndex: E = e.tabIndex,
27
+ ariaDescribedBy: a,
28
+ // Event handling props
29
+ debounceCallbackTime: F,
30
+ onChange: M,
31
+ onKeyDown: $,
32
+ onMouseDown: b,
33
+ onBlur: A,
34
+ // Adornments
35
+ adornmentStart: p,
36
+ adornmentEnd: d,
37
+ // Helper text
38
+ label: i,
39
+ helperText: t,
40
+ ...C
41
+ }, H) => {
13
42
  const {
14
- theme: I
15
- } = v(), {
16
- wrapperAs: y = "label",
17
- // Layout props
18
- width: w,
19
- className: N = e.className,
20
- styles: S = e.styles,
21
- // Input behavior props
22
- variant: s = e.variant,
23
- color: i = e.color,
24
- disabled: _ = e.disabled,
25
- readOnly: x = e.readOnly,
26
- // Accessibility props
27
- ariaRequired: D = e.ariaRequired,
28
- role: E = e.role,
29
- tabIndex: O = e.tabIndex,
30
- ariaDescribedBy: l,
31
- // Event handling props
32
- debounceCallbackTime: T,
33
- onChange: C,
34
- onKeyDown: M,
35
- onMouseDown: A,
36
- onBlur: F,
37
- // Adornments
38
- adornmentStart: d,
39
- adornmentEnd: m,
40
- // Helper text
41
- label: a,
42
- helperText: n,
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
43
+ theme: L
44
+ } = T(), c = !x.includes(n), P = !!(i || t), {
45
+ handlers: R,
46
+ isMouseInteraction: U
47
+ } = z({
48
+ onKeyDown: $,
49
+ onBlur: A,
50
+ onMouseDown: b,
51
+ onChange: M,
52
+ debounceCallbackTime: F
53
53
  });
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: [
57
- d && /* @__PURE__ */ r(h, { children: d }),
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 ? {
59
- "aria-describedby": l
60
- } : {}, ...R }),
61
- p && /* @__PURE__ */ t(L, { children: [
54
+ return /* @__PURE__ */ s(l, { as: h, withGap: P, className: _, width: N, styles: I, children: [
55
+ i && /* @__PURE__ */ r(u, { children: i }),
56
+ /* @__PURE__ */ s(l, { width: "100%", children: [
57
+ p && /* @__PURE__ */ r(f, { children: p }),
58
+ /* @__PURE__ */ r(D, { $isMouseInteraction: U && c, $color: m, ref: H, disabled: S, role: y, theme: L, type: n, readOnly: O, tabIndex: E, "aria-required": w, "data-testid": o, ...R, ...a ? {
59
+ "aria-describedby": a
60
+ } : {}, ...C }),
61
+ c && /* @__PURE__ */ s(j, { children: [
62
62
  /* @__PURE__ */ r("span", { className: `${o}__border` }),
63
63
  /* @__PURE__ */ r("span", { className: `${o}__outline` })
64
64
  ] }),
65
- m && /* @__PURE__ */ r(h, { children: m })
65
+ d && /* @__PURE__ */ r(f, { children: d })
66
66
  ] }),
67
- n && /* @__PURE__ */ r(u, { color: i, size: z.Sm, children: n })
67
+ t && /* @__PURE__ */ r(u, { color: m, size: g.Sm, children: t })
68
68
  ] });
69
69
  });
70
- B.displayName = o;
70
+ G.displayName = o;
71
71
  export {
72
- B as Input
72
+ G as Input
73
73
  };
@@ -57,7 +57,6 @@ export interface InputHelperProps extends CommonCssComponentProps, PropsWithChil
57
57
  }
58
58
  export interface InputWrapperPropsStyled extends CommonCssComponentStyledProps<HTMLBaseElement>, PropsWithChildren {
59
59
  $as?: keyof HTMLElementTagNameMap | ElementType;
60
- $width?: string;
61
60
  $withGap?: boolean;
62
61
  }
63
62
  export interface InputHelperPropsStyled extends CommonCssComponentStyledProps, PropsWithChildren {