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.
- package/ai/README.md +4 -4
- package/ai/schemas/components/Counter.d.ts +5 -0
- package/components/core/Image/Image.d.ts +0 -4
- package/components/core/Input/Input.d.ts +1 -1
- package/components/core/Input/Input.js +7 -7
- package/components/core/Input/Input.types.d.ts +3 -2
- package/components/core/Input/constants.d.ts +1 -3
- package/components/core/Input/constants.js +9 -10
- package/components/core/Loader/Loader.js +4 -4
- package/components/core/Modal/Modal.js +23 -21
- package/components/core/Switch/Switch.js +50 -36
- package/components/core/Switch/Switch.types.d.ts +4 -3
- package/components/core/Switch/SwitchStyled.js +59 -57
- package/components/core/Table/Table.d.ts +2 -2
- package/components/core/Table/Table.js +79 -78
- package/components/core/Table/Table.types.d.ts +12 -8
- package/components/core/Table/TablePagination.d.ts +1 -1
- package/components/core/Table/TablePagination.js +42 -53
- package/components/core/Table/TableStyled.d.ts +4 -0
- package/components/core/Table/TableStyled.js +91 -69
- package/components/core/Table/constants.js +1 -1
- package/components/domainSpecific/ChatBubble/ChatBubbleStyled.js +1 -1
- package/components/domainSpecific/ContentCarousel/ContentCarousel.js +72 -62
- package/components/domainSpecific/Counter/Counter.js +87 -40
- package/components/domainSpecific/Counter/Counter.types.d.ts +1 -1
- package/components/domainSpecific/RadioGroup/RadioGroup.js +4 -4
- package/components/domainSpecific/Search/Search.js +4 -4
- package/components/domainSpecific/Stepper/Stepper.js +15 -15
- package/components/domainSpecific/Stepper/utils.js +1 -1
- package/components/layout/ChatContainer/ChatContainer.js +27 -27
- package/gridKit_logo.png +0 -0
- package/hooks/useMediaQuery/useMediaQuery.d.ts +0 -3
- package/hooks/useMediaQuery/useMediaQuery.js +15 -10
- package/hooks/useTheme/NoOpTheme.d.ts +57 -19
- package/index.d.ts +0 -4
- package/llms.txt +5 -4
- package/package.json +1 -1
- package/tokens/badge.d.ts +1 -0
- package/tokens/badge.js +2 -1
- package/tokens/defaultTheme.d.ts +57 -19
- package/tokens/index.d.ts +26 -7
- package/tokens/input.js +6 -6
- package/tokens/snackbar.js +1 -2
- package/tokens/stepper.d.ts +12 -6
- package/tokens/stepper.js +56 -58
- package/tokens/switch.d.ts +13 -2
- package/tokens/switch.js +23 -16
- package/tokens/table.d.ts +30 -9
- package/tokens/table.js +38 -17
- package/tokens/tooltip.d.ts +1 -0
- package/tokens/tooltip.js +1 -0
- package/tokens/utils.js +0 -1
- package/tokens/values.d.ts +0 -3
- package/tokens/values.js +5 -10
- package/types/index.d.ts +0 -1
- package/types/input.d.ts +1 -0
- package/types/input.js +3 -3
- package/utils/common.d.ts +1 -0
- package/utils/common.js +3 -2
- package/types/label.d.ts +0 -4
- 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="
|
|
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="
|
|
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="
|
|
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="
|
|
328
|
+
<Typography variant="p">
|
|
329
329
|
Using flex="1" for flexible width distribution in a flex container.
|
|
330
330
|
</Typography>
|
|
331
331
|
</AccordionContent>
|
|
@@ -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
|
|
8
|
-
import { InputHelper as
|
|
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
|
|
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(
|
|
55
|
-
i && /* @__PURE__ */ r(
|
|
56
|
-
/* @__PURE__ */ s(
|
|
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(
|
|
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,
|
|
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?:
|
|
24
|
+
role?: string;
|
|
25
|
+
inputmode?: string;
|
|
25
26
|
tabIndex?: number;
|
|
26
27
|
debounceCallbackTime?: number;
|
|
27
28
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TabIndex, InputColorVariant,
|
|
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,
|
|
2
|
-
import { TabIndex as
|
|
3
|
-
const
|
|
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:
|
|
5
|
+
color: e.Primary,
|
|
6
6
|
disabled: !1,
|
|
7
7
|
readOnly: !1,
|
|
8
8
|
ariaRequired: !1,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}, p = [a.Checkbox, a.Radio, a.Range];
|
|
9
|
+
tabIndex: r.Default
|
|
10
|
+
}, l = [a.Checkbox, a.Radio, a.Range];
|
|
12
11
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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:
|
|
21
|
-
animationProps:
|
|
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:
|
|
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
|
|
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
|
|
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:
|
|
14
|
+
isOpen: l = !1,
|
|
15
15
|
isCustomView: p = !1,
|
|
16
16
|
onClose: t,
|
|
17
17
|
showCloseButton: n = !0,
|
|
18
|
-
closeOnClickOutside:
|
|
18
|
+
closeOnClickOutside: m = !0,
|
|
19
19
|
closeOnEscape: f,
|
|
20
|
-
title:
|
|
21
|
-
children:
|
|
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(),
|
|
29
|
-
|
|
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:
|
|
32
|
-
}),
|
|
33
|
-
}, [t,
|
|
34
|
-
|
|
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
|
|
41
|
-
t && v.key === Y.ESCAPE && (
|
|
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",
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
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
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { COMPONENT_NAME as
|
|
5
|
-
import { SwitchWrapperStyled as
|
|
6
|
-
import {
|
|
7
|
-
import { useTheme as
|
|
8
|
-
import {
|
|
9
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
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:
|
|
34
|
-
checked:
|
|
35
|
-
disabled:
|
|
36
|
-
onChange:
|
|
37
|
-
"data-testid": `${
|
|
38
|
-
...
|
|
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
|
-
|
|
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?:
|
|
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?:
|
|
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
|
|
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
|
|
6
|
-
const
|
|
5
|
+
import { get as t } from "../../../utils/helpers.js";
|
|
6
|
+
const b = (s) => {
|
|
7
7
|
const {
|
|
8
8
|
theme: {
|
|
9
|
-
switchToken:
|
|
10
|
-
...
|
|
9
|
+
switchToken: o,
|
|
10
|
+
...r
|
|
11
11
|
} = {},
|
|
12
|
-
styles:
|
|
13
|
-
...
|
|
14
|
-
} =
|
|
15
|
-
boxStyles:
|
|
16
|
-
restProps:
|
|
17
|
-
} = y(
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
},
|
|
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:
|
|
23
|
-
...
|
|
22
|
+
switchToken: r,
|
|
23
|
+
...c
|
|
24
24
|
} = {},
|
|
25
|
-
styles:
|
|
26
|
-
$disabled:
|
|
27
|
-
...
|
|
28
|
-
} =
|
|
29
|
-
boxStyles:
|
|
30
|
-
restProps:
|
|
31
|
-
} = y(
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
}), u = (
|
|
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:
|
|
37
|
-
...
|
|
36
|
+
switchToken: o,
|
|
37
|
+
...r
|
|
38
38
|
} = {},
|
|
39
|
-
$label:
|
|
40
|
-
styles:
|
|
41
|
-
...
|
|
42
|
-
} =
|
|
43
|
-
boxStyles:
|
|
44
|
-
restProps:
|
|
45
|
-
} = y(
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
}, f = (
|
|
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:
|
|
51
|
-
...
|
|
50
|
+
switchToken: o,
|
|
51
|
+
...r
|
|
52
52
|
} = {},
|
|
53
|
-
$checked:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
},
|
|
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:
|
|
65
|
-
...
|
|
65
|
+
switchToken: o,
|
|
66
|
+
...r
|
|
66
67
|
} = {},
|
|
67
|
-
styles:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
78
|
+
b as HiddenCheckboxStyled,
|
|
77
79
|
u as SwitchLabelStyled,
|
|
78
80
|
f as SwitchSliderStyled,
|
|
79
81
|
T as SwitchStyled,
|
|
80
|
-
|
|
82
|
+
x as SwitchWrapperStyled
|
|
81
83
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { TableProps, TableRef
|
|
2
|
-
export declare const Table: import('react').ForwardRefExoticComponent<TableProps
|
|
1
|
+
import { TableProps, TableRef } from './Table.types';
|
|
2
|
+
export declare const Table: import('react').ForwardRefExoticComponent<TableProps & import('react').RefAttributes<TableRef>>;
|