gd-design-library 1.5.0 → 1.6.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 (61) hide show
  1. package/ai/README.md +4 -4
  2. package/ai/schemas/components/Counter.d.ts +5 -0
  3. package/components/core/Image/Image.d.ts +0 -4
  4. package/components/core/Input/Input.d.ts +1 -1
  5. package/components/core/Input/Input.js +7 -7
  6. package/components/core/Input/Input.types.d.ts +3 -2
  7. package/components/core/Input/constants.d.ts +1 -3
  8. package/components/core/Input/constants.js +9 -10
  9. package/components/core/Loader/Loader.js +4 -4
  10. package/components/core/Modal/Modal.js +23 -21
  11. package/components/core/Switch/Switch.js +50 -36
  12. package/components/core/Switch/Switch.types.d.ts +4 -3
  13. package/components/core/Switch/SwitchStyled.js +59 -57
  14. package/components/core/Table/Table.d.ts +2 -2
  15. package/components/core/Table/Table.js +79 -78
  16. package/components/core/Table/Table.types.d.ts +12 -8
  17. package/components/core/Table/TablePagination.d.ts +1 -1
  18. package/components/core/Table/TablePagination.js +42 -53
  19. package/components/core/Table/TableStyled.d.ts +4 -0
  20. package/components/core/Table/TableStyled.js +91 -69
  21. package/components/core/Table/constants.js +1 -1
  22. package/components/domainSpecific/ChatBubble/ChatBubbleStyled.js +1 -1
  23. package/components/domainSpecific/ContentCarousel/ContentCarousel.js +72 -62
  24. package/components/domainSpecific/Counter/Counter.js +87 -40
  25. package/components/domainSpecific/Counter/Counter.types.d.ts +1 -1
  26. package/components/domainSpecific/RadioGroup/RadioGroup.js +4 -4
  27. package/components/domainSpecific/Search/Search.js +4 -4
  28. package/components/domainSpecific/Stepper/Stepper.js +15 -15
  29. package/components/domainSpecific/Stepper/utils.js +1 -1
  30. package/components/layout/ChatContainer/ChatContainer.js +27 -27
  31. package/gridKit_logo.png +0 -0
  32. package/hooks/useMediaQuery/useMediaQuery.d.ts +0 -3
  33. package/hooks/useMediaQuery/useMediaQuery.js +15 -10
  34. package/hooks/useTheme/NoOpTheme.d.ts +57 -19
  35. package/index.d.ts +0 -4
  36. package/llms.txt +5 -4
  37. package/package.json +1 -1
  38. package/tokens/badge.d.ts +1 -0
  39. package/tokens/badge.js +2 -1
  40. package/tokens/defaultTheme.d.ts +57 -19
  41. package/tokens/index.d.ts +26 -7
  42. package/tokens/input.js +6 -6
  43. package/tokens/snackbar.js +1 -2
  44. package/tokens/stepper.d.ts +12 -6
  45. package/tokens/stepper.js +56 -58
  46. package/tokens/switch.d.ts +13 -2
  47. package/tokens/switch.js +23 -16
  48. package/tokens/table.d.ts +30 -9
  49. package/tokens/table.js +38 -17
  50. package/tokens/tooltip.d.ts +1 -0
  51. package/tokens/tooltip.js +1 -0
  52. package/tokens/utils.js +0 -1
  53. package/tokens/values.d.ts +0 -3
  54. package/tokens/values.js +5 -10
  55. package/types/index.d.ts +0 -1
  56. package/types/input.d.ts +1 -0
  57. package/types/input.js +3 -3
  58. package/utils/common.d.ts +1 -0
  59. package/utils/common.js +3 -2
  60. package/types/label.d.ts +0 -4
  61. package/types/label.js +0 -4
package/ai/README.md CHANGED
@@ -266,7 +266,7 @@ export function FAQSection() {
266
266
  <Typography as="h3" variant="h5">How do I get started?</Typography>
267
267
  </AccordionHeader>
268
268
  <AccordionContent>
269
- <Typography variant="body">
269
+ <Typography variant="p">
270
270
  Follow these steps to begin using the design system in your project.
271
271
  </Typography>
272
272
  </AccordionContent>
@@ -276,7 +276,7 @@ export function FAQSection() {
276
276
  <Typography as="h3" variant="h5">What are the pricing options?</Typography>
277
277
  </AccordionHeader>
278
278
  <AccordionContent>
279
- <Typography variant="body">
279
+ <Typography variant="p">
280
280
  We offer three flexible pricing plans to meet your needs.
281
281
  </Typography>
282
282
  </AccordionContent>
@@ -310,7 +310,7 @@ export function StyledAccordionSection() {
310
310
  <Typography as="h3" variant="h5">Item with Box Props</Typography>
311
311
  </AccordionHeader>
312
312
  <AccordionContent>
313
- <Typography variant="body">
313
+ <Typography variant="p">
314
314
  This AccordionItem uses Box layout props like margin, padding, width, and maxWidth for flexible layout control.
315
315
  </Typography>
316
316
  </AccordionContent>
@@ -325,7 +325,7 @@ export function StyledAccordionSection() {
325
325
  <Typography as="h3" variant="h5">Flex Item</Typography>
326
326
  </AccordionHeader>
327
327
  <AccordionContent>
328
- <Typography variant="body">
328
+ <Typography variant="p">
329
329
  Using flex="1" for flexible width distribution in a flex container.
330
330
  </Typography>
331
331
  </AccordionContent>
@@ -19,6 +19,11 @@ declare const _default: {
19
19
  type: string;
20
20
  description: string;
21
21
  default: number;
22
+ } | {
23
+ name: string;
24
+ type: string;
25
+ description: string;
26
+ default: boolean;
22
27
  } | {
23
28
  name: string;
24
29
  type: string;
@@ -1,6 +1,2 @@
1
1
  import { ImageProps } from './';
2
- /**
3
- * @TODO: Cerebra
4
- * - as span
5
- */
6
2
  export declare const Image: import('react').ForwardRefExoticComponent<ImageProps & import('react').RefAttributes<HTMLImageElement>>;
@@ -1,2 +1,2 @@
1
1
  import { InputFieldProps } from './Input.types';
2
- export declare const Input: import('react').ForwardRefExoticComponent<(InputFieldProps & Partial<Omit<HTMLInputElement, "color" | "prefix" | "disabled" | "tabIndex" | "type" | "hidden" | "width" | "content" | "translate" | "name" | "label" | "children" | "className" | "styles" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "id" | "lang" | "nonce" | "slot" | "spellCheck" | "style" | "title" | "radioGroup" | "role" | "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>>;
2
+ export declare const Input: import('react').ForwardRefExoticComponent<(InputFieldProps & Partial<Omit<HTMLInputElement, "color" | "prefix" | "disabled" | "tabIndex" | "type" | "hidden" | "width" | "content" | "translate" | "name" | "label" | "children" | "className" | "styles" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "id" | "lang" | "nonce" | "slot" | "spellCheck" | "style" | "title" | "radioGroup" | "role" | "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" | "inputmode" | "wrapperAs" | "helperText">>) & import('react').RefAttributes<HTMLInputElement>>;
@@ -4,8 +4,8 @@ import { forwardRef as q } from "react";
4
4
  import { COMPONENT_NAME as o, DEFAULT_PROPS as e, FOCUS_EXCLUDED_LIST as x } from "./constants.js";
5
5
  import { useInputHandlers as z } from "./useInputHandlers.js";
6
6
  import { InputStyled as D } from "./InputStyled.js";
7
- import { InputWrapper as l } from "./InputWrapper/InputWrapper.js";
8
- import { InputHelper as u } from "./InputHelper/InputHelper.js";
7
+ import { InputWrapper as u } from "./InputWrapper/InputWrapper.js";
8
+ import { InputHelper as l } from "./InputHelper/InputHelper.js";
9
9
  import { InputAdornment as f } from "./InputAdornment/InputAdornment.js";
10
10
  import { useTheme as T } from "../../../hooks/useTheme/useTheme.js";
11
11
  import { SizeVariant as g } from "../../../types/common.js";
@@ -22,7 +22,7 @@ const G = q(({
22
22
  readOnly: O = e.readOnly,
23
23
  // Accessibility props
24
24
  ariaRequired: w = e.ariaRequired,
25
- role: y = e.role,
25
+ role: y,
26
26
  tabIndex: E = e.tabIndex,
27
27
  ariaDescribedBy: a,
28
28
  // Event handling props
@@ -51,9 +51,9 @@ const G = q(({
51
51
  onChange: M,
52
52
  debounceCallbackTime: F
53
53
  });
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: [
54
+ return /* @__PURE__ */ s(u, { as: h, withGap: P, className: _, width: N, styles: I, children: [
55
+ i && /* @__PURE__ */ r(l, { children: i }),
56
+ /* @__PURE__ */ s(u, { width: "100%", children: [
57
57
  p && /* @__PURE__ */ r(f, { children: p }),
58
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
59
  "aria-describedby": a
@@ -64,7 +64,7 @@ const G = q(({
64
64
  ] }),
65
65
  d && /* @__PURE__ */ r(f, { children: d })
66
66
  ] }),
67
- t && /* @__PURE__ */ r(u, { color: m, size: g.Sm, children: t })
67
+ t && /* @__PURE__ */ r(l, { color: m, size: g.Sm, children: t })
68
68
  ] });
69
69
  });
70
70
  G.displayName = o;
@@ -1,5 +1,5 @@
1
1
  import { ChangeEvent, FocusEvent, MouseEvent, KeyboardEvent, ReactNode, ElementType, PropsWithChildren } from 'react';
2
- import { EnumOrPrimitive, InputColorVariant, InputRole, InputVariantType, SizeVariant } from '../../../types';
2
+ import { EnumOrPrimitive, InputColorVariant, InputVariantType, SizeVariant } from '../../../types';
3
3
  import { CommonCssComponentProps, CommonCssComponentStyledProps } from '../..';
4
4
  export interface BaseInputFieldProps extends CommonCssComponentProps<HTMLInputElement> {
5
5
  readOnly?: boolean;
@@ -21,7 +21,8 @@ export interface BaseInputFieldProps extends CommonCssComponentProps<HTMLInputEl
21
21
  required?: boolean;
22
22
  ariaRequired?: boolean;
23
23
  ariaDescribedBy?: string;
24
- role?: EnumOrPrimitive<InputRole>;
24
+ role?: string;
25
+ inputmode?: string;
25
26
  tabIndex?: number;
26
27
  debounceCallbackTime?: number;
27
28
  }
@@ -1,4 +1,4 @@
1
- import { TabIndex, InputColorVariant, InputRole, InputVariantType } from '../../../types';
1
+ import { TabIndex, InputColorVariant, InputVariantType } from '../../../types';
2
2
  export declare const COMPONENT_NAME = "Input";
3
3
  export declare const DEFAULT_PROPS: {
4
4
  variant: InputVariantType;
@@ -6,8 +6,6 @@ export declare const DEFAULT_PROPS: {
6
6
  disabled: boolean;
7
7
  readOnly: boolean;
8
8
  ariaRequired: boolean;
9
- role: InputRole;
10
9
  tabIndex: TabIndex;
11
- styles: {};
12
10
  };
13
11
  export declare const FOCUS_EXCLUDED_LIST: InputVariantType[];
@@ -1,16 +1,15 @@
1
- import { InputVariantType as a, InputRole as e, InputColorVariant as o } from "../../../types/input.js";
2
- import { TabIndex as t } from "../../../types/accesability.js";
3
- const i = "Input", l = {
1
+ import { InputVariantType as a, InputColorVariant as e } from "../../../types/input.js";
2
+ import { TabIndex as r } from "../../../types/accesability.js";
3
+ const n = "Input", i = {
4
4
  variant: a.Text,
5
- color: o.Primary,
5
+ color: e.Primary,
6
6
  disabled: !1,
7
7
  readOnly: !1,
8
8
  ariaRequired: !1,
9
- role: e.Textbox,
10
- tabIndex: t.Default
11
- }, p = [a.Checkbox, a.Radio, a.Range];
9
+ tabIndex: r.Default
10
+ }, l = [a.Checkbox, a.Radio, a.Range];
12
11
  export {
13
- i as COMPONENT_NAME,
14
- l as DEFAULT_PROPS,
15
- p as FOCUS_EXCLUDED_LIST
12
+ n as COMPONENT_NAME,
13
+ i as DEFAULT_PROPS,
14
+ l as FOCUS_EXCLUDED_LIST
16
15
  };
@@ -13,16 +13,16 @@ const g = N((d, s) => {
13
13
  const {
14
14
  theme: t
15
15
  } = M(), {
16
- name: f,
16
+ name: f = "circle",
17
17
  variant: r = m.Inline,
18
18
  rounded: l = V(t, "loader.attrs.rounded", "none"),
19
19
  children: a,
20
- size: u = W.Md,
21
- animationProps: c = P,
20
+ size: c = W.Md,
21
+ animationProps: u = P,
22
22
  withWrapper: i = !0,
23
23
  WrapperView: n = "span",
24
24
  ...h
25
- } = d, e = () => a || /* @__PURE__ */ o($, { ref: s, theme: t, $name: f, $variant: r, $size: u, $animationProps: c, $rounded: l, "data-testid": p, ...h });
25
+ } = d, e = () => a || /* @__PURE__ */ o($, { ref: s, theme: t, $name: f, $variant: r, $size: c, $animationProps: u, $rounded: l, "data-testid": p, ...h });
26
26
  return r === m.FullPage ? /* @__PURE__ */ o(w, { wrapperVariant: r, withWrapper: i, WrapperView: n, children: e() }) : i ? /* @__PURE__ */ o(A, { variant: r, as: n, children: e() }) : e();
27
27
  });
28
28
  g.displayName = p;
@@ -1,56 +1,58 @@
1
1
  "use client";
2
2
  import { jsx as d, jsxs as y, Fragment as B } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as T, useCallback as s, useEffect as w } from "react";
3
+ import { forwardRef as T, useCallback as g, useEffect as w } from "react";
4
4
  import { COMPONENT_NAME as e } from "./constants.js";
5
5
  import { ModalOverlayStyled as x, ModalContentStyled as N, ModalHeaderStyled as P, ModalTitleStyled as A, CloseButtonStyled as K, ModalBodyStyled as L, ModalFooterStyled as j } from "./ModalStyled.js";
6
6
  import { useTheme as D } from "../../../hooks/useTheme/useTheme.js";
7
7
  import { useLogger as F } from "../../../hooks/useLogger/useLogger.js";
8
- import { get as g } from "../../../utils/helpers.js";
8
+ import { get as s } from "../../../utils/helpers.js";
9
9
  import { Portal as H } from "../Portal/Portal.js";
10
10
  import { convertToInlineBoxStyles as I } from "../../../tokens/utils.js";
11
11
  import { Icon as R } from "../Icon/Icon.js";
12
12
  import { KEYBOARD_KEYS as Y } from "../../../constants/keyboard.js";
13
13
  const _ = T(({
14
- isOpen: c = !1,
14
+ isOpen: l = !1,
15
15
  isCustomView: p = !1,
16
16
  onClose: t,
17
17
  showCloseButton: n = !0,
18
- closeOnClickOutside: o = !0,
18
+ closeOnClickOutside: m = !0,
19
19
  closeOnEscape: f,
20
- title: a,
21
- children: l,
20
+ title: i,
21
+ children: c,
22
22
  footer: u,
23
23
  styles: h,
24
24
  ...S
25
25
  }, b) => {
26
26
  const {
27
27
  theme: r
28
- } = D(), m = F(), M = g(r, "modal.icons", {}), k = a || !!(n && t), E = s(() => {
29
- m.debug(`${e}: Close`, {
28
+ } = D(), a = F(), M = s(r, "modal.icons", {}), k = i || !!(n && t), E = g(() => {
29
+ a.debug(`${e}: Close`, {
30
30
  trigger: "overlay",
31
- closeOnClickOutside: o
32
- }), o && (t == null || t());
33
- }, [t, o]), $ = s(() => {
34
- m.debug(`${e}: Close`, {
31
+ closeOnClickOutside: m
32
+ }), m && (t == null || t());
33
+ }, [t, m, a]), $ = g(() => {
34
+ a.debug(`${e}: Close`, {
35
35
  trigger: "closeButton"
36
36
  }), t == null || t();
37
- }, [t]);
37
+ }, [t, a]);
38
38
  return w(() => {
39
39
  if (!f) return;
40
- const i = (v) => {
41
- t && v.key === Y.ESCAPE && (m.debug(`${e}: Close`, {
40
+ const o = (v) => {
41
+ t && v.key === Y.ESCAPE && (a.debug(`${e}: Close`, {
42
42
  trigger: "escape"
43
43
  }), t == null || t());
44
44
  };
45
- return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
46
- }, [c, f, t]), c ? /* @__PURE__ */ d(H, { blocksScroll: !0, children: /* @__PURE__ */ d(x, { onClick: E, theme: r, children: /* @__PURE__ */ d(N, { ref: b, onClick: (i) => i.stopPropagation(), "data-testid": e, theme: r, styles: h, ...I(S), children: p ? l : /* @__PURE__ */ y(B, { children: [
47
- k && /* @__PURE__ */ y(P, { theme: r, $withTitle: !!a, "data-testid": `${e}-header`, children: [
48
- a && /* @__PURE__ */ d(A, { theme: r, "data-testid": `${e}-title`, children: a }),
49
- n && t && /* @__PURE__ */ d(K, { onClick: $, "data-testid": "close-button", theme: r, "aria-label": "Close modal", children: /* @__PURE__ */ d(R, { ...g(M, "close", {
45
+ return l && document.addEventListener("keydown", o), () => {
46
+ document.removeEventListener("keydown", o);
47
+ };
48
+ }, [l, f, t, a]), l ? /* @__PURE__ */ d(H, { blocksScroll: !0, children: /* @__PURE__ */ d(x, { onClick: E, theme: r, children: /* @__PURE__ */ d(N, { ref: b, onClick: (o) => o.stopPropagation(), "data-testid": e, theme: r, styles: h, ...I(S), children: p ? c : /* @__PURE__ */ y(B, { children: [
49
+ k && /* @__PURE__ */ y(P, { theme: r, $withTitle: !!i, "data-testid": `${e}-header`, children: [
50
+ i && /* @__PURE__ */ d(A, { theme: r, "data-testid": `${e}-title`, children: i }),
51
+ n && t && /* @__PURE__ */ d(K, { onClick: $, "data-testid": "close-button", theme: r, "aria-label": "Close modal", children: /* @__PURE__ */ d(R, { ...s(M, "close", {
50
52
  name: "cross"
51
53
  }) }) })
52
54
  ] }),
53
- l && /* @__PURE__ */ d(L, { theme: r, "data-testid": `${e}-body`, children: l }),
55
+ c && /* @__PURE__ */ d(L, { theme: r, "data-testid": `${e}-body`, children: c }),
54
56
  u && /* @__PURE__ */ d(j, { theme: r, "data-testid": `${e}-footer`, children: u })
55
57
  ] }) }) }) }) : null;
56
58
  });
@@ -1,46 +1,60 @@
1
1
  "use client";
2
- import { jsxs as m, jsx as a } from "@emotion/react/jsx-runtime";
3
- import { forwardRef as $, useState as g, useCallback as p, useEffect as x } from "react";
4
- import { COMPONENT_NAME as r } from "./constants.js";
5
- import { SwitchWrapperStyled as y, SwitchLabelStyled as C, SwitchStyled as N, SwitchSliderStyled as E, HiddenCheckboxStyled as j } from "./SwitchStyled.js";
6
- import { LabelPosition as I } from "../../../types/label.js";
7
- import { useTheme as L } from "../../../hooks/useTheme/useTheme.js";
8
- import { get as M } from "../../../utils/helpers.js";
9
- const W = $((S, b) => {
2
+ import { jsxs as h, jsx as o } from "@emotion/react/jsx-runtime";
3
+ import { forwardRef as N, useState as k, useCallback as u, useEffect as v } from "react";
4
+ import { COMPONENT_NAME as e } from "./constants.js";
5
+ import { SwitchWrapperStyled as E, SwitchLabelStyled as I, SwitchStyled as T, SwitchSliderStyled as j, HiddenCheckboxStyled as L } from "./SwitchStyled.js";
6
+ import { Loader as M } from "../Loader/Loader.js";
7
+ import { useTheme as O } from "../../../hooks/useTheme/useTheme.js";
8
+ import { useLogger as z } from "../../../hooks/useLogger/useLogger.js";
9
+ import { get as S } from "../../../utils/helpers.js";
10
+ const q = N(({
11
+ onValueChange: a,
12
+ checked: s,
13
+ disabled: $ = !1,
14
+ isLoading: f = !1,
15
+ label: g = "right",
16
+ children: m,
17
+ ...n
18
+ }, w) => {
10
19
  const {
11
- onValueChange: c,
12
- checked: e,
13
- disabled: s = !1,
14
- label: k = I.Right,
15
- children: l,
16
- ...o
17
- } = S, {
18
- theme: t
19
- } = L(), d = e !== void 0, [u, h] = g(e ?? !1), n = d ? e : u, f = p((i) => {
20
- d || h(i), c == null || c(i);
21
- }, [c, d]), w = p((i) => {
22
- s || f(M(i, "target.checked", !1));
23
- }, [s, f]);
24
- return x(() => {
25
- d && h(e);
26
- }, [e, d]), /* @__PURE__ */ m(y, { theme: t, ref: b, $disabled: s, "data-testid": `${r}-wrapper`, ...o, children: [
27
- l && /* @__PURE__ */ a(C, { className: "gd-switch-label", theme: t, $label: k, "data-testid": `${r}-label`, children: l }),
28
- /* @__PURE__ */ m(N, { "data-testid": r, theme: t, children: [
29
- /* @__PURE__ */ a(E, { className: "gd-switch-slider", theme: t, $checked: n, "data-testid": `${r}-slider` }),
30
- /* @__PURE__ */ a(
31
- j,
20
+ theme: r
21
+ } = O(), d = z(), t = s !== void 0, [x, p] = k(s ?? !1), c = t ? s : x, i = $ || f, b = u((l) => {
22
+ d.debug(`${e}: Value changed`, {
23
+ newChecked: l,
24
+ isControlled: t
25
+ }), t || p(l), a == null || a(l);
26
+ }, [a, t, d]), y = u((l) => {
27
+ d.debug(`${e}: Value change is disabled:`, {
28
+ isDisabled: i
29
+ }), !i && b(S(l, "target.checked", !1));
30
+ }, [i, b, d]);
31
+ return v(() => {
32
+ d.debug(`${e}: Update internal value when external value changes:`, {
33
+ checked: s,
34
+ isControlled: t
35
+ }), t && p(s);
36
+ }, [s, t, d]), /* @__PURE__ */ h(E, { theme: r, ref: w, $disabled: i, "data-testid": `${e}-wrapper`, ...n, children: [
37
+ m && /* @__PURE__ */ o(I, { className: "gd-switch-label", theme: r, $label: g, "data-testid": `${e}-label`, children: m }),
38
+ /* @__PURE__ */ h(T, { "data-testid": e, $checked: c, theme: r, children: [
39
+ f ? /* @__PURE__ */ o(M, { ...S(r, "switchToken.slider.loader.attrs", {}), styles: {
40
+ position: "relative",
41
+ zIndex: 1
42
+ } }) : null,
43
+ /* @__PURE__ */ o(j, { className: "gd-switch-slider", theme: r, $checked: c, $disabled: i, "data-testid": `${e}-slider` }),
44
+ /* @__PURE__ */ o(
45
+ L,
32
46
  {
33
- theme: t,
34
- checked: n,
35
- disabled: s,
36
- onChange: w,
37
- "data-testid": `${r}-checkbox`,
38
- ...o
47
+ theme: r,
48
+ checked: c,
49
+ disabled: i,
50
+ onChange: y,
51
+ "data-testid": `${e}-checkbox`,
52
+ ...n
39
53
  }
40
54
  )
41
55
  ] })
42
56
  ] });
43
57
  });
44
58
  export {
45
- W as Switch
59
+ q as Switch
46
60
  };
@@ -1,10 +1,11 @@
1
1
  import { PropsWithChildren } from 'react';
2
- import { EnumOrPrimitive, LabelPosition } from '../../../types';
3
2
  import { BoxCssComponentProps, BoxCssComponentStyledProps, CommonCssInputStyledProps } from '../..';
3
+ export type LabelPosition = 'left' | 'right';
4
4
  export interface SwitchProps<T> extends PropsWithChildren<BoxCssComponentProps<T>> {
5
- label?: EnumOrPrimitive<LabelPosition>;
5
+ label?: LabelPosition;
6
6
  name?: string;
7
7
  disabled?: boolean;
8
+ isLoading?: boolean;
8
9
  checked?: boolean;
9
10
  onValueChange?: (value: boolean) => void;
10
11
  }
@@ -13,7 +14,7 @@ export interface SwitchStyledProps<T> extends PropsWithChildren<BoxCssComponentS
13
14
  $checked?: boolean;
14
15
  }
15
16
  export interface SwitchLabelStyledProps extends PropsWithChildren<BoxCssComponentStyledProps> {
16
- $label?: EnumOrPrimitive<LabelPosition>;
17
+ $label?: LabelPosition;
17
18
  }
18
19
  export interface HiddenCheckboxStyledProps extends CommonCssInputStyledProps {
19
20
  disabled?: boolean;
@@ -1,81 +1,83 @@
1
1
  "use client";
2
- import { jsx as d } from "@emotion/react/jsx-runtime";
2
+ import { jsx as i } from "@emotion/react/jsx-runtime";
3
3
  import { forwardRef as w } from "react";
4
4
  import { getBoxStyles as y, tokensHandler as S } from "../../../tokens/utils.js";
5
- import { get as h } from "../../../utils/helpers.js";
6
- const x = (e) => {
5
+ import { get as t } from "../../../utils/helpers.js";
6
+ const b = (s) => {
7
7
  const {
8
8
  theme: {
9
- switchToken: t,
10
- ...s
9
+ switchToken: o,
10
+ ...r
11
11
  } = {},
12
- styles: o,
13
- ...r
14
- } = e, {
15
- boxStyles: c,
16
- restProps: n
17
- } = y(r), l = new Proxy(t || {}, S(s)), p = [h(l, "checkbox", {}), c, o];
18
- return /* @__PURE__ */ d("input", { type: "checkbox", css: p, ...n });
19
- }, b = w((e, t) => {
12
+ styles: c,
13
+ ...n
14
+ } = s, {
15
+ boxStyles: l,
16
+ restProps: d
17
+ } = y(n), p = new Proxy(o || {}, S(r)), e = [t(p, "checkbox", {}), l, c];
18
+ return /* @__PURE__ */ i("input", { type: "checkbox", css: e, ...d });
19
+ }, x = w((s, o) => {
20
20
  const {
21
21
  theme: {
22
- switchToken: s,
23
- ...o
22
+ switchToken: r,
23
+ ...c
24
24
  } = {},
25
- styles: r = {},
26
- $disabled: c,
27
- ...n
28
- } = e, {
29
- boxStyles: l,
30
- restProps: p
31
- } = y(n), i = new Proxy(s || {}, S(o));
32
- return /* @__PURE__ */ d("label", { css: [h(i, "wrapper.default", {}), c ? h(i, "wrapper.disabled", {}) : {}, l, r], ...p, ref: t });
33
- }), u = (e) => {
25
+ styles: n = {},
26
+ $disabled: l,
27
+ ...d
28
+ } = s, {
29
+ boxStyles: p,
30
+ restProps: e
31
+ } = y(d), h = new Proxy(r || {}, S(c));
32
+ return /* @__PURE__ */ i("label", { css: [t(h, "wrapper.default", {}), l ? t(h, "wrapper.disabled", {}) : {}, p, n], ...e, ref: o });
33
+ }), u = (s) => {
34
34
  const {
35
35
  theme: {
36
- switchToken: t,
37
- ...s
36
+ switchToken: o,
37
+ ...r
38
38
  } = {},
39
- $label: o,
40
- styles: r,
41
- ...c
42
- } = e, {
43
- boxStyles: n,
44
- restProps: l
45
- } = y(c), p = new Proxy(t || {}, S(s));
46
- return /* @__PURE__ */ d("span", { css: [h(p, "label.default", {}), h(p, ["label", o], {}), n, r], ...l });
47
- }, f = (e) => {
39
+ $label: c,
40
+ styles: n,
41
+ ...l
42
+ } = s, {
43
+ boxStyles: d,
44
+ restProps: p
45
+ } = y(l), e = new Proxy(o || {}, S(r));
46
+ return /* @__PURE__ */ i("span", { css: [t(e, "label.default", {}), t(e, ["label", c], {}), d, n], ...p });
47
+ }, f = (s) => {
48
48
  const {
49
49
  theme: {
50
- switchToken: t,
51
- ...s
50
+ switchToken: o,
51
+ ...r
52
52
  } = {},
53
- $checked: o,
54
- styles: r,
55
- ...c
56
- } = e, {
57
- boxStyles: n,
58
- restProps: l
59
- } = y(c), p = new Proxy(t || {}, S(s));
60
- return /* @__PURE__ */ d("span", { css: [h(p, "slider.default", {}), o ? h(p, "slider.checked", {}) : {}, n, r], ...l });
61
- }, T = (e) => {
53
+ $checked: c,
54
+ $disabled: n,
55
+ styles: l,
56
+ ...d
57
+ } = s, {
58
+ boxStyles: p,
59
+ restProps: e
60
+ } = y(d), h = new Proxy(o || {}, S(r));
61
+ return /* @__PURE__ */ i("span", { css: [t(h, "slider.default", {}), c ? t(h, "slider.checked", {}) : {}, n ? t(h, "slider.disabled", {}) : {}, p, l], ...e });
62
+ }, T = (s) => {
62
63
  const {
63
64
  theme: {
64
- switchToken: t,
65
- ...s
65
+ switchToken: o,
66
+ ...r
66
67
  } = {},
67
- styles: o,
68
- ...r
69
- } = e, {
70
- boxStyles: c,
71
- restProps: n
72
- } = y(r), l = new Proxy(t || {}, S(s));
73
- return /* @__PURE__ */ d("span", { css: [h(l, "default", {}), c, o], ...n });
68
+ styles: c,
69
+ $checked: n,
70
+ ...l
71
+ } = s, {
72
+ boxStyles: d,
73
+ restProps: p
74
+ } = y(l), e = new Proxy(o || {}, S(r)), h = [t(e, "default", {}), n && t(e, "checked", {}), d, c];
75
+ return /* @__PURE__ */ i("span", { css: h, ...p });
74
76
  };
75
77
  export {
76
- x as HiddenCheckboxStyled,
78
+ b as HiddenCheckboxStyled,
77
79
  u as SwitchLabelStyled,
78
80
  f as SwitchSliderStyled,
79
81
  T as SwitchStyled,
80
- b as SwitchWrapperStyled
82
+ x as SwitchWrapperStyled
81
83
  };
@@ -1,2 +1,2 @@
1
- import { TableProps, TableRef, TableRowData } from './Table.types';
2
- export declare const Table: import('react').ForwardRefExoticComponent<TableProps<TableRowData<Record<string, unknown>>> & import('react').RefAttributes<TableRef>>;
1
+ import { TableProps, TableRef } from './Table.types';
2
+ export declare const Table: import('react').ForwardRefExoticComponent<TableProps & import('react').RefAttributes<TableRef>>;