@raystack/apsara 0.38.0 → 0.39.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/dist/style.css +1 -1
- package/dist/v1/components/dialog/dialog.cjs +12 -5
- package/dist/v1/components/dialog/dialog.cjs.map +1 -1
- package/dist/v1/components/dialog/dialog.d.ts +13 -2
- package/dist/v1/components/dialog/dialog.d.ts.map +1 -1
- package/dist/v1/components/dialog/dialog.js +13 -6
- package/dist/v1/components/dialog/dialog.js.map +1 -1
- package/dist/v1/components/dialog/dialog.module.css.cjs +1 -1
- package/dist/v1/components/dialog/dialog.module.css.js +1 -1
- package/dist/v1/components/input-field/input-field.cjs +7 -2
- package/dist/v1/components/input-field/input-field.cjs.map +1 -1
- package/dist/v1/components/input-field/input-field.d.ts +3 -1
- package/dist/v1/components/input-field/input-field.d.ts.map +1 -1
- package/dist/v1/components/input-field/input-field.js +7 -2
- package/dist/v1/components/input-field/input-field.js.map +1 -1
- package/dist/v1/components/input-field/input-field.module.css.cjs +1 -1
- package/dist/v1/components/input-field/input-field.module.css.js +1 -1
- package/dist/v1/components/search/search.cjs +10 -15
- package/dist/v1/components/search/search.cjs.map +1 -1
- package/dist/v1/components/search/search.d.ts +4 -17
- package/dist/v1/components/search/search.d.ts.map +1 -1
- package/dist/v1/components/search/search.js +11 -16
- package/dist/v1/components/search/search.js.map +1 -1
- package/dist/v1/components/search/search.module.css.cjs +1 -1
- package/dist/v1/components/search/search.module.css.js +1 -1
- package/dist/v1/icons/assets/bell-slash.svg.cjs +45 -0
- package/dist/v1/icons/assets/bell-slash.svg.cjs.map +1 -0
- package/dist/v1/icons/assets/bell-slash.svg.js +24 -0
- package/dist/v1/icons/assets/bell-slash.svg.js.map +1 -0
- package/dist/v1/icons/assets/bell.svg.cjs +42 -0
- package/dist/v1/icons/assets/bell.svg.cjs.map +1 -0
- package/dist/v1/icons/assets/bell.svg.js +21 -0
- package/dist/v1/icons/assets/bell.svg.js.map +1 -0
- package/dist/v1/icons/assets/check-circle-filled.svg.cjs +2 -0
- package/dist/v1/icons/assets/check-circle-filled.svg.cjs.map +1 -1
- package/dist/v1/icons/assets/check-circle-filled.svg.js +2 -0
- package/dist/v1/icons/assets/check-circle-filled.svg.js.map +1 -1
- package/dist/v1/icons/assets/coin-colored.svg.cjs +54 -0
- package/dist/v1/icons/assets/coin-colored.svg.cjs.map +1 -0
- package/dist/v1/icons/assets/coin-colored.svg.js +33 -0
- package/dist/v1/icons/assets/coin-colored.svg.js.map +1 -0
- package/dist/v1/icons/assets/coin.svg.cjs +40 -0
- package/dist/v1/icons/assets/coin.svg.cjs.map +1 -0
- package/dist/v1/icons/assets/coin.svg.js +19 -0
- package/dist/v1/icons/assets/coin.svg.js.map +1 -0
- package/dist/v1/icons/assets/cross-circle-filled.svg.cjs +2 -1
- package/dist/v1/icons/assets/cross-circle-filled.svg.cjs.map +1 -1
- package/dist/v1/icons/assets/cross-circle-filled.svg.js +2 -1
- package/dist/v1/icons/assets/cross-circle-filled.svg.js.map +1 -1
- package/dist/v1/icons/assets/filter.svg.cjs +2 -1
- package/dist/v1/icons/assets/filter.svg.cjs.map +1 -1
- package/dist/v1/icons/assets/filter.svg.js +2 -1
- package/dist/v1/icons/assets/filter.svg.js.map +1 -1
- package/dist/v1/icons/assets/organization.svg.cjs +2 -1
- package/dist/v1/icons/assets/organization.svg.cjs.map +1 -1
- package/dist/v1/icons/assets/organization.svg.js +2 -1
- package/dist/v1/icons/assets/organization.svg.js.map +1 -1
- package/dist/v1/icons/assets/shopping-bag-filled.svg.cjs +42 -0
- package/dist/v1/icons/assets/shopping-bag-filled.svg.cjs.map +1 -0
- package/dist/v1/icons/assets/shopping-bag-filled.svg.js +21 -0
- package/dist/v1/icons/assets/shopping-bag-filled.svg.js.map +1 -0
- package/dist/v1/icons/assets/sidebar.svg.cjs +2 -1
- package/dist/v1/icons/assets/sidebar.svg.cjs.map +1 -1
- package/dist/v1/icons/assets/sidebar.svg.js +2 -1
- package/dist/v1/icons/assets/sidebar.svg.js.map +1 -1
- package/dist/v1/icons/index.cjs +10 -0
- package/dist/v1/icons/index.cjs.map +1 -1
- package/dist/v1/icons/index.d.ts +5 -0
- package/dist/v1/icons/index.d.ts.map +1 -1
- package/dist/v1/icons/index.js +5 -0
- package/dist/v1/icons/index.js.map +1 -1
- package/dist/v1/style.css +1 -1
- package/package.json +1 -2
|
@@ -6,23 +6,30 @@ var reactIcons_esm = require('../../node_modules/.pnpm/@radix-ui_react-icons@1.3
|
|
|
6
6
|
var index$1 = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
|
|
7
7
|
var clsx = require('../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.cjs');
|
|
8
8
|
var React = require('react');
|
|
9
|
+
var flex = require('../flex/flex.cjs');
|
|
9
10
|
var dialog_module = require('./dialog.module.css.cjs');
|
|
10
11
|
|
|
11
12
|
const dialogContent = index$1.cva(dialog_module.default.dialogContent);
|
|
12
|
-
const DialogContent = React.forwardRef(({ className, children, ariaLabel, ariaDescription, overlayBlur = false, overlayClassName, overlayStyle, width,
|
|
13
|
+
const DialogContent = React.forwardRef(({ className, children, ariaLabel, ariaDescription, overlayBlur = false, overlayClassName, overlayStyle, width, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsxs(index.Portal, { children: [jsxRuntime.jsxRuntimeExports.jsx(index.Overlay, { className: clsx.clsx(dialog_module.default.dialogOverlay, overlayClassName, overlayBlur && dialog_module.default.overlayBlur), style: overlayStyle, "aria-hidden": "true", role: "presentation" }), jsxRuntime.jsxRuntimeExports.jsx(index.Content, { ref: ref, className: dialogContent({ className }), style: { width, ...props.style }, "aria-label": ariaLabel, "aria-describedby": ariaDescription ? "dialog-description" : undefined, ...props, children: children })] })));
|
|
13
14
|
DialogContent.displayName = index.Content.displayName;
|
|
15
|
+
const DialogHeader = ({ children, className, }) => (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { justify: "between", align: "center", className: clsx.clsx(dialog_module.default.header, className), children: children }));
|
|
16
|
+
const DialogFooter = ({ children, className, }) => (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { gap: 5, justify: "end", className: clsx.clsx(dialog_module.default.footer, className), children: children }));
|
|
17
|
+
const DialogBody = ({ children, className, }) => (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { direction: "column", gap: 3, className: clsx.clsx(dialog_module.default.body, className), children: children }));
|
|
14
18
|
function CloseButton({ children = jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.Cross1Icon, {}), className, ...props }) {
|
|
15
|
-
return (jsxRuntime.jsxRuntimeExports.jsx(index.Close, { className: dialog_module.default.close, "aria-label": "Close dialog", ...props, children: children }));
|
|
19
|
+
return (jsxRuntime.jsxRuntimeExports.jsx(index.Close, { className: clsx.clsx(dialog_module.default.close, className), "aria-label": "Close dialog", ...props, children: children }));
|
|
16
20
|
}
|
|
17
|
-
function DialogTitle({ children, ...props }) {
|
|
18
|
-
return (jsxRuntime.jsxRuntimeExports.jsx(index.Title, { ...props, role: "heading", "aria-level": 1, children: children }));
|
|
21
|
+
function DialogTitle({ children, className, ...props }) {
|
|
22
|
+
return (jsxRuntime.jsxRuntimeExports.jsx(index.Title, { ...props, role: "heading", "aria-level": 1, className: clsx.clsx(dialog_module.default.title, className), children: children }));
|
|
19
23
|
}
|
|
20
24
|
function DialogDescription({ children, className, ...props }) {
|
|
21
|
-
return (jsxRuntime.jsxRuntimeExports.jsx(index.Description, { ...props, className: className, id: "dialog-description", role: "document", children: children }));
|
|
25
|
+
return (jsxRuntime.jsxRuntimeExports.jsx(index.Description, { ...props, className: clsx.clsx(dialog_module.default.description, className), id: "dialog-description", role: "document", children: children }));
|
|
22
26
|
}
|
|
23
27
|
const Dialog = Object.assign(index.Root, {
|
|
24
28
|
Trigger: index.Trigger,
|
|
25
29
|
Content: DialogContent,
|
|
30
|
+
Header: DialogHeader,
|
|
31
|
+
Footer: DialogFooter,
|
|
32
|
+
Body: DialogBody,
|
|
26
33
|
Close: CloseButton,
|
|
27
34
|
Title: DialogTitle,
|
|
28
35
|
Description: DialogDescription,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.cjs","sources":["../../../../v1/components/dialog/dialog.tsx"],"sourcesContent":["import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { Cross1Icon } from \"@radix-ui/react-icons\";\nimport { cva, VariantProps } from \"class-variance-authority\";\nimport { clsx } from \"clsx\";\nimport {\n ComponentProps,\n ComponentPropsWithoutRef,\n ElementRef,\n forwardRef,\n} from \"react\";\n\nimport styles from \"./dialog.module.css\";\n\nconst dialogContent = cva(styles.dialogContent);\n\nexport interface DialogContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof dialogContent> {\n ariaLabel?: string;\n ariaDescription?: string;\n overlayBlur?: boolean;\n overlayClassName?: string;\n overlayStyle?: React.CSSProperties;\n width?: string | number;\n
|
|
1
|
+
{"version":3,"file":"dialog.cjs","sources":["../../../../v1/components/dialog/dialog.tsx"],"sourcesContent":["import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { Cross1Icon } from \"@radix-ui/react-icons\";\nimport { cva, VariantProps } from \"class-variance-authority\";\nimport { clsx } from \"clsx\";\nimport {\n ComponentProps,\n ComponentPropsWithoutRef,\n ElementRef,\n forwardRef,\n} from \"react\";\nimport { Flex } from \"../flex\";\n\nimport styles from \"./dialog.module.css\";\n\nconst dialogContent = cva(styles.dialogContent);\n\nexport interface DialogContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof dialogContent> {\n ariaLabel?: string;\n ariaDescription?: string;\n overlayBlur?: boolean;\n overlayClassName?: string;\n overlayStyle?: React.CSSProperties;\n width?: string | number;\n}\n\nconst DialogContent = forwardRef<\n ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(\n (\n {\n className,\n children,\n ariaLabel,\n ariaDescription,\n overlayBlur = false,\n overlayClassName,\n overlayStyle,\n width,\n ...props\n },\n ref\n ) => (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay\n className={clsx(\n styles.dialogOverlay,\n overlayClassName,\n overlayBlur && styles.overlayBlur\n )}\n style={overlayStyle}\n aria-hidden=\"true\"\n role=\"presentation\"\n />\n <DialogPrimitive.Content\n ref={ref}\n className={dialogContent({ className })}\n style={{ width, ...props.style }}\n aria-label={ariaLabel}\n aria-describedby={ariaDescription ? \"dialog-description\" : undefined}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n )\n);\n\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex\n justify={\"between\"}\n align={\"center\"}\n className={clsx(styles.header, className)}\n >\n {children}\n </Flex>\n);\n\nconst DialogFooter = ({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex gap={5} justify=\"end\" className={clsx(styles.footer, className)}>\n {children}\n </Flex>\n);\n\nconst DialogBody = ({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex direction=\"column\" gap={3} className={clsx(styles.body, className)}>\n {children}\n </Flex>\n);\n\ntype CloseButtonProps = ComponentProps<typeof DialogPrimitive.Close>;\nexport function CloseButton({\n children = <Cross1Icon />,\n className,\n ...props\n}: CloseButtonProps) {\n return (\n <DialogPrimitive.Close\n className={clsx(styles.close, className)}\n aria-label=\"Close dialog\"\n {...props}\n >\n {children}\n </DialogPrimitive.Close>\n );\n}\n\ninterface DialogTitleProps\n extends ComponentProps<typeof DialogPrimitive.Title> {\n children: React.ReactNode;\n}\n\nfunction DialogTitle({ children, className, ...props }: DialogTitleProps) {\n return (\n <DialogPrimitive.Title\n {...props}\n role=\"heading\"\n aria-level={1}\n className={clsx(styles.title, className)}\n >\n {children}\n </DialogPrimitive.Title>\n );\n}\n\ninterface DialogDescriptionProps\n extends ComponentProps<typeof DialogPrimitive.Description> {\n children: React.ReactNode;\n className?: string;\n}\n\nfunction DialogDescription({\n children,\n className,\n ...props\n}: DialogDescriptionProps) {\n return (\n <DialogPrimitive.Description\n {...props}\n className={clsx(styles.description, className)}\n id=\"dialog-description\"\n role=\"document\"\n >\n {children}\n </DialogPrimitive.Description>\n );\n}\n\nexport const Dialog = Object.assign(DialogPrimitive.Root, {\n Trigger: DialogPrimitive.Trigger,\n Content: DialogContent,\n Header: DialogHeader,\n Footer: DialogFooter,\n Body: DialogBody,\n Close: CloseButton,\n Title: DialogTitle,\n Description: DialogDescription,\n});\n"],"names":["cva","styles","forwardRef","_jsxs","DialogPrimitive.Portal","_jsx","DialogPrimitive.Overlay","clsx","DialogPrimitive.Content","Flex","Cross1Icon","DialogPrimitive.Close","DialogPrimitive.Title","DialogPrimitive.Description","DialogPrimitive.Root","DialogPrimitive.Trigger"],"mappings":";;;;;;;;;;;AAcA,MAAM,aAAa,GAAGA,WAAG,CAACC,qBAAM,CAAC,aAAa,CAAC,CAAC;AAahD,MAAM,aAAa,GAAGC,gBAAU,CAI9B,CACE,EACE,SAAS,EACT,QAAQ,EACR,SAAS,EACT,eAAe,EACf,WAAW,GAAG,KAAK,EACnB,gBAAgB,EAChB,YAAY,EACZ,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,MAEHC,iCAAC,CAAAC,YAAsB,EACrB,EAAA,QAAA,EAAA,CAAAC,gCAAA,CAACC,aAAuB,EAAA,EACtB,SAAS,EAAEC,SAAI,CACbN,qBAAM,CAAC,aAAa,EACpB,gBAAgB,EAChB,WAAW,IAAIA,qBAAM,CAAC,WAAW,CAClC,EACD,KAAK,EAAE,YAAY,EAAA,aAAA,EACP,MAAM,EAClB,IAAI,EAAC,cAAc,EAAA,CACnB,EACFI,gCAAA,CAACG,aAAuB,EAAA,EACtB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,aAAa,CAAC,EAAE,SAAS,EAAE,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K,EAAE,SAAS,CAAC,EAAA,YAAA,EAC7B,cAAc,EAAA,GACrB,KAAK,EAER,QAAA,EAAA,QAAQ,EACa,CAAA,EACxB;AACJ,CAAC;AAOD,SAAS,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoB,EAAA;AACtE,IAAA,QACEI,gCAAA,CAACO,WAAqB,EAAA,EAAA,GAChB,KAAK,EACT,IAAI,EAAC,SAAS,EAAA,YAAA,EACF,CAAC,EACb,SAAS,EAAEL,SAAI,CAACN,qBAAM,CAAC,KAAK,EAAE,SAAS,CAAC,EAEvC,QAAA,EAAA,QAAQ,EACa,CAAA,EACxB;AACJ,CAAC;AAQD,SAAS,iBAAiB,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACe,EAAA;AACvB,IAAA,QACEI,gCAAA,CAACQ,iBAA2B,EAAA,EAAA,GACtB,KAAK,EACT,SAAS,EAAEN,SAAI,CAACN,qBAAM,CAAC,WAAW,EAAE,SAAS,CAAC,EAC9C,EAAE,EAAC,oBAAoB,EACvB,IAAI,EAAC,UAAU,EAAA,QAAA,EAEd,QAAQ,EAAA,CACmB,EAC9B;AACJ,CAAC;AAEY,MAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAACa,UAAoB,EAAE;IACxD,OAAO,EAAEC,aAAuB;AAChC,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,IAAI,EAAE,UAAU;AAChB,IAAA,KAAK,EAAE,WAAW;AAClB,IAAA,KAAK,EAAE,WAAW;AAClB,IAAA,WAAW,EAAE,iBAAiB;AAC/B,CAAA;;;;;"}
|
|
@@ -9,14 +9,13 @@ export interface DialogContentProps extends ComponentPropsWithoutRef<typeof Dial
|
|
|
9
9
|
overlayClassName?: string;
|
|
10
10
|
overlayStyle?: React.CSSProperties;
|
|
11
11
|
width?: string | number;
|
|
12
|
-
close?: boolean;
|
|
13
12
|
}
|
|
14
13
|
type CloseButtonProps = ComponentProps<typeof DialogPrimitive.Close>;
|
|
15
14
|
export declare function CloseButton({ children, className, ...props }: CloseButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
16
15
|
interface DialogTitleProps extends ComponentProps<typeof DialogPrimitive.Title> {
|
|
17
16
|
children: React.ReactNode;
|
|
18
17
|
}
|
|
19
|
-
declare function DialogTitle({ children, ...props }: DialogTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare function DialogTitle({ children, className, ...props }: DialogTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
20
19
|
interface DialogDescriptionProps extends ComponentProps<typeof DialogPrimitive.Description> {
|
|
21
20
|
children: React.ReactNode;
|
|
22
21
|
className?: string;
|
|
@@ -25,6 +24,18 @@ declare function DialogDescription({ children, className, ...props }: DialogDesc
|
|
|
25
24
|
export declare const Dialog: import("react").FC<DialogPrimitive.DialogProps> & {
|
|
26
25
|
Trigger: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
27
26
|
Content: import("react").ForwardRefExoticComponent<DialogContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
27
|
+
Header: ({ children, className, }: {
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
className?: string | undefined;
|
|
30
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
Footer: ({ children, className, }: {
|
|
32
|
+
children: React.ReactNode;
|
|
33
|
+
className?: string | undefined;
|
|
34
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
Body: ({ children, className, }: {
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
className?: string | undefined;
|
|
38
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
28
39
|
Close: typeof CloseButton;
|
|
29
40
|
Title: typeof DialogTitle;
|
|
30
41
|
Description: typeof DialogDescription;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../../v1/components/dialog/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EACL,cAAc,EACd,wBAAwB,EAGzB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../../v1/components/dialog/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EACL,cAAc,EACd,wBAAwB,EAGzB,MAAM,OAAO,CAAC;AAKf,QAAA,MAAM,aAAa,yFAA4B,CAAC;AAEhD,MAAM,WAAW,kBACf,SAAQ,wBAAwB,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,EAC9D,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAuFD,KAAK,gBAAgB,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AACrE,wBAAgB,WAAW,CAAC,EAC1B,QAAyB,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,gBAAgB,2CAUlB;AAED,UAAU,gBACR,SAAQ,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC;IACpD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,iBAAS,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CAWvE;AAED,UAAU,sBACR,SAAQ,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC;IAC1D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,iBAAiB,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,sBAAsB,2CAWxB;AAED,eAAO,MAAM,MAAM;;;;kBA9FP,MAAM,SAAS;;;;kBAgBf,MAAM,SAAS;;;;kBAYf,MAAM,SAAS;;;;;;CA2EzB,CAAC"}
|
|
@@ -1,26 +1,33 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
|
|
2
|
-
import { Portal as $5d3850c4d0b4e6c7$export$602eac185826482c, Overlay as $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff, Content as $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,
|
|
2
|
+
import { Portal as $5d3850c4d0b4e6c7$export$602eac185826482c, Overlay as $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff, Content as $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2, Root as $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9, Trigger as $5d3850c4d0b4e6c7$export$41fb9f06171c75f4, Close as $5d3850c4d0b4e6c7$export$f39c2d165cd861fe, Title as $5d3850c4d0b4e6c7$export$f99233281efd08a0, Description as $5d3850c4d0b4e6c7$export$393edc798c47379d } from '../../node_modules/.pnpm/@radix-ui_react-dialog@1.0.4_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-dialog/dist/index.js';
|
|
3
3
|
import { Cross1Icon } from '../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js';
|
|
4
4
|
import { cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
|
|
5
5
|
import { clsx } from '../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js';
|
|
6
6
|
import { forwardRef } from 'react';
|
|
7
|
+
import { Flex } from '../flex/flex.js';
|
|
7
8
|
import styles from './dialog.module.css.js';
|
|
8
9
|
|
|
9
10
|
const dialogContent = cva(styles.dialogContent);
|
|
10
|
-
const DialogContent = forwardRef(({ className, children, ariaLabel, ariaDescription, overlayBlur = false, overlayClassName, overlayStyle, width,
|
|
11
|
+
const DialogContent = forwardRef(({ className, children, ariaLabel, ariaDescription, overlayBlur = false, overlayClassName, overlayStyle, width, ...props }, ref) => (jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$602eac185826482c, { children: [jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff, { className: clsx(styles.dialogOverlay, overlayClassName, overlayBlur && styles.overlayBlur), style: overlayStyle, "aria-hidden": "true", role: "presentation" }), jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2, { ref: ref, className: dialogContent({ className }), style: { width, ...props.style }, "aria-label": ariaLabel, "aria-describedby": ariaDescription ? "dialog-description" : undefined, ...props, children: children })] })));
|
|
11
12
|
DialogContent.displayName = $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2.displayName;
|
|
13
|
+
const DialogHeader = ({ children, className, }) => (jsxRuntimeExports.jsx(Flex, { justify: "between", align: "center", className: clsx(styles.header, className), children: children }));
|
|
14
|
+
const DialogFooter = ({ children, className, }) => (jsxRuntimeExports.jsx(Flex, { gap: 5, justify: "end", className: clsx(styles.footer, className), children: children }));
|
|
15
|
+
const DialogBody = ({ children, className, }) => (jsxRuntimeExports.jsx(Flex, { direction: "column", gap: 3, className: clsx(styles.body, className), children: children }));
|
|
12
16
|
function CloseButton({ children = jsxRuntimeExports.jsx(Cross1Icon, {}), className, ...props }) {
|
|
13
|
-
return (jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$f39c2d165cd861fe, { className: styles.close, "aria-label": "Close dialog", ...props, children: children }));
|
|
17
|
+
return (jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$f39c2d165cd861fe, { className: clsx(styles.close, className), "aria-label": "Close dialog", ...props, children: children }));
|
|
14
18
|
}
|
|
15
|
-
function DialogTitle({ children, ...props }) {
|
|
16
|
-
return (jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$f99233281efd08a0, { ...props, role: "heading", "aria-level": 1, children: children }));
|
|
19
|
+
function DialogTitle({ children, className, ...props }) {
|
|
20
|
+
return (jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$f99233281efd08a0, { ...props, role: "heading", "aria-level": 1, className: clsx(styles.title, className), children: children }));
|
|
17
21
|
}
|
|
18
22
|
function DialogDescription({ children, className, ...props }) {
|
|
19
|
-
return (jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$393edc798c47379d, { ...props, className: className, id: "dialog-description", role: "document", children: children }));
|
|
23
|
+
return (jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$393edc798c47379d, { ...props, className: clsx(styles.description, className), id: "dialog-description", role: "document", children: children }));
|
|
20
24
|
}
|
|
21
25
|
const Dialog = Object.assign($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9, {
|
|
22
26
|
Trigger: $5d3850c4d0b4e6c7$export$41fb9f06171c75f4,
|
|
23
27
|
Content: DialogContent,
|
|
28
|
+
Header: DialogHeader,
|
|
29
|
+
Footer: DialogFooter,
|
|
30
|
+
Body: DialogBody,
|
|
24
31
|
Close: CloseButton,
|
|
25
32
|
Title: DialogTitle,
|
|
26
33
|
Description: DialogDescription,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sources":["../../../../v1/components/dialog/dialog.tsx"],"sourcesContent":["import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { Cross1Icon } from \"@radix-ui/react-icons\";\nimport { cva, VariantProps } from \"class-variance-authority\";\nimport { clsx } from \"clsx\";\nimport {\n ComponentProps,\n ComponentPropsWithoutRef,\n ElementRef,\n forwardRef,\n} from \"react\";\n\nimport styles from \"./dialog.module.css\";\n\nconst dialogContent = cva(styles.dialogContent);\n\nexport interface DialogContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof dialogContent> {\n ariaLabel?: string;\n ariaDescription?: string;\n overlayBlur?: boolean;\n overlayClassName?: string;\n overlayStyle?: React.CSSProperties;\n width?: string | number;\n
|
|
1
|
+
{"version":3,"file":"dialog.js","sources":["../../../../v1/components/dialog/dialog.tsx"],"sourcesContent":["import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { Cross1Icon } from \"@radix-ui/react-icons\";\nimport { cva, VariantProps } from \"class-variance-authority\";\nimport { clsx } from \"clsx\";\nimport {\n ComponentProps,\n ComponentPropsWithoutRef,\n ElementRef,\n forwardRef,\n} from \"react\";\nimport { Flex } from \"../flex\";\n\nimport styles from \"./dialog.module.css\";\n\nconst dialogContent = cva(styles.dialogContent);\n\nexport interface DialogContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,\n VariantProps<typeof dialogContent> {\n ariaLabel?: string;\n ariaDescription?: string;\n overlayBlur?: boolean;\n overlayClassName?: string;\n overlayStyle?: React.CSSProperties;\n width?: string | number;\n}\n\nconst DialogContent = forwardRef<\n ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(\n (\n {\n className,\n children,\n ariaLabel,\n ariaDescription,\n overlayBlur = false,\n overlayClassName,\n overlayStyle,\n width,\n ...props\n },\n ref\n ) => (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay\n className={clsx(\n styles.dialogOverlay,\n overlayClassName,\n overlayBlur && styles.overlayBlur\n )}\n style={overlayStyle}\n aria-hidden=\"true\"\n role=\"presentation\"\n />\n <DialogPrimitive.Content\n ref={ref}\n className={dialogContent({ className })}\n style={{ width, ...props.style }}\n aria-label={ariaLabel}\n aria-describedby={ariaDescription ? \"dialog-description\" : undefined}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n )\n);\n\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex\n justify={\"between\"}\n align={\"center\"}\n className={clsx(styles.header, className)}\n >\n {children}\n </Flex>\n);\n\nconst DialogFooter = ({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex gap={5} justify=\"end\" className={clsx(styles.footer, className)}>\n {children}\n </Flex>\n);\n\nconst DialogBody = ({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}) => (\n <Flex direction=\"column\" gap={3} className={clsx(styles.body, className)}>\n {children}\n </Flex>\n);\n\ntype CloseButtonProps = ComponentProps<typeof DialogPrimitive.Close>;\nexport function CloseButton({\n children = <Cross1Icon />,\n className,\n ...props\n}: CloseButtonProps) {\n return (\n <DialogPrimitive.Close\n className={clsx(styles.close, className)}\n aria-label=\"Close dialog\"\n {...props}\n >\n {children}\n </DialogPrimitive.Close>\n );\n}\n\ninterface DialogTitleProps\n extends ComponentProps<typeof DialogPrimitive.Title> {\n children: React.ReactNode;\n}\n\nfunction DialogTitle({ children, className, ...props }: DialogTitleProps) {\n return (\n <DialogPrimitive.Title\n {...props}\n role=\"heading\"\n aria-level={1}\n className={clsx(styles.title, className)}\n >\n {children}\n </DialogPrimitive.Title>\n );\n}\n\ninterface DialogDescriptionProps\n extends ComponentProps<typeof DialogPrimitive.Description> {\n children: React.ReactNode;\n className?: string;\n}\n\nfunction DialogDescription({\n children,\n className,\n ...props\n}: DialogDescriptionProps) {\n return (\n <DialogPrimitive.Description\n {...props}\n className={clsx(styles.description, className)}\n id=\"dialog-description\"\n role=\"document\"\n >\n {children}\n </DialogPrimitive.Description>\n );\n}\n\nexport const Dialog = Object.assign(DialogPrimitive.Root, {\n Trigger: DialogPrimitive.Trigger,\n Content: DialogContent,\n Header: DialogHeader,\n Footer: DialogFooter,\n Body: DialogBody,\n Close: CloseButton,\n Title: DialogTitle,\n Description: DialogDescription,\n});\n"],"names":["_jsxs","DialogPrimitive.Portal","_jsx","DialogPrimitive.Overlay","DialogPrimitive.Content","DialogPrimitive.Close","DialogPrimitive.Title","DialogPrimitive.Description","DialogPrimitive.Root","DialogPrimitive.Trigger"],"mappings":";;;;;;;;;AAcA,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;AAahD,MAAM,aAAa,GAAG,UAAU,CAI9B,CACE,EACE,SAAS,EACT,QAAQ,EACR,SAAS,EACT,eAAe,EACf,WAAW,GAAG,KAAK,EACnB,gBAAgB,EAChB,YAAY,EACZ,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,MAEHA,sBAAC,CAAAC,yCAAsB,EACrB,EAAA,QAAA,EAAA,CAAAC,qBAAA,CAACC,yCAAuB,EAAA,EACtB,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,aAAa,EACpB,gBAAgB,EAChB,WAAW,IAAI,MAAM,CAAC,WAAW,CAClC,EACD,KAAK,EAAE,YAAY,EAAA,aAAA,EACP,MAAM,EAClB,IAAI,EAAC,cAAc,EAAA,CACnB,EACFD,qBAAA,CAACE,yCAAuB,EAAA,EACtB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,aAAa,CAAC,EAAE,SAAS,EAAE,CAAC,EACvC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,EACpB,YAAA,EAAA,SAAS,EACH,kBAAA,EAAA,eAAe,GAAG,oBAAoB,GAAG,SAAS,EAChE,GAAA,KAAK,EAER,QAAA,EAAA,QAAQ,EACe,CAAA,CAAA,EAAA,CACH,CAC1B,CACF,CAAC;AAEF,aAAa,CAAC,WAAW,GAAGA,yCAAuB,CAAC,WAAW,CAAC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CAAC,EACb,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,EAEvC,QAAA,EAAA,QAAQ,EACa,CAAA,EACxB;AACJ,CAAC;AAQD,SAAS,iBAAiB,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACe,EAAA;AACvB,IAAA,QACEJ,qBAAA,CAACK,yCAA2B,EAAA,EAAA,GACtB,KAAK,EACT,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,EAC9C,EAAE,EAAC,oBAAoB,EACvB,IAAI,EAAC,UAAU,EAAA,QAAA,EAEd,QAAQ,EAAA,CACmB,EAC9B;AACJ,CAAC;AAEY,MAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAACC,yCAAoB,EAAE;IACxD,OAAO,EAAEC,yCAAuB;AAChC,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,IAAI,EAAE,UAAU;AAChB,IAAA,KAAK,EAAE,WAAW;AAClB,IAAA,KAAK,EAAE,WAAW;AAClB,IAAA,WAAW,EAAE,iBAAiB;AAC/B,CAAA;;;;"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var styles = {"dialogOverlay":"dialog-module_dialogOverlay__gtTvA","dialogContent":"dialog-module_dialogContent__DvkhU","close":"dialog-module_close__g-6GW","overlayBlur":"dialog-module_overlayBlur__5363s","fadeIn":"dialog-module_fadeIn__Yyp5s","fadeOut":"dialog-module_fadeOut__H7gVW","overlay":"dialog-module_overlay__sppBT"};
|
|
5
|
+
var styles = {"dialogOverlay":"dialog-module_dialogOverlay__gtTvA","dialogContent":"dialog-module_dialogContent__DvkhU","close":"dialog-module_close__g-6GW","overlayBlur":"dialog-module_overlayBlur__5363s","fadeIn":"dialog-module_fadeIn__Yyp5s","fadeOut":"dialog-module_fadeOut__H7gVW","overlay":"dialog-module_overlay__sppBT","header":"dialog-module_header__XyU4U","title":"dialog-module_title__vzaHe","body":"dialog-module_body__co0Jz","footer":"dialog-module_footer__qqC4q","description":"dialog-module_description__G1nfZ"};
|
|
6
6
|
|
|
7
7
|
exports.default = styles;
|
|
8
8
|
//# sourceMappingURL=dialog.module.css.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var styles = {"dialogOverlay":"dialog-module_dialogOverlay__gtTvA","dialogContent":"dialog-module_dialogContent__DvkhU","close":"dialog-module_close__g-6GW","overlayBlur":"dialog-module_overlayBlur__5363s","fadeIn":"dialog-module_fadeIn__Yyp5s","fadeOut":"dialog-module_fadeOut__H7gVW","overlay":"dialog-module_overlay__sppBT"};
|
|
1
|
+
var styles = {"dialogOverlay":"dialog-module_dialogOverlay__gtTvA","dialogContent":"dialog-module_dialogContent__DvkhU","close":"dialog-module_close__g-6GW","overlayBlur":"dialog-module_overlayBlur__5363s","fadeIn":"dialog-module_fadeIn__Yyp5s","fadeOut":"dialog-module_fadeOut__H7gVW","overlay":"dialog-module_overlay__sppBT","header":"dialog-module_header__XyU4U","title":"dialog-module_title__vzaHe","body":"dialog-module_body__co0Jz","footer":"dialog-module_footer__qqC4q","description":"dialog-module_description__G1nfZ"};
|
|
2
2
|
|
|
3
3
|
export { styles as default };
|
|
4
4
|
//# sourceMappingURL=dialog.module.css.js.map
|
|
@@ -14,14 +14,19 @@ const inputWrapper = index.cva(inputField_module.default.inputWrapper, {
|
|
|
14
14
|
size: {
|
|
15
15
|
small: inputField_module.default["size-small"],
|
|
16
16
|
large: inputField_module.default["size-large"],
|
|
17
|
+
},
|
|
18
|
+
variant: {
|
|
19
|
+
default: inputField_module.default["variant-default"],
|
|
20
|
+
borderless: inputField_module.default["variant-borderless"],
|
|
17
21
|
}
|
|
18
22
|
},
|
|
19
23
|
defaultVariants: {
|
|
20
24
|
size: "large",
|
|
25
|
+
variant: "default",
|
|
21
26
|
}
|
|
22
27
|
});
|
|
23
|
-
const InputField = ({ className, disabled, label, helperText, placeholder, error, leadingIcon, trailingIcon, optional, prefix, suffix, width, chips, maxChipsVisible = 2, ref, size, infoTooltip, ...props }) => {
|
|
24
|
-
return (jsxRuntime.jsxRuntimeExports.jsxs("div", { className: inputField_module.default.container, style: { width: width || '100%' }, children: [label && (jsxRuntime.jsxRuntimeExports.jsxs("div", { className: inputField_module.default.labelContainer, children: [jsxRuntime.jsxRuntimeExports.jsxs("label", { className: clsx.clsx(inputField_module.default.label, disabled && inputField_module.default["label-disabled"]), children: [label, optional && jsxRuntime.jsxRuntimeExports.jsx("span", { className: inputField_module.default.optional, children: "(optional)" })] }), infoTooltip && (jsxRuntime.jsxRuntimeExports.jsx(tooltip.Tooltip, { message: infoTooltip, side: "right", children: jsxRuntime.jsxRuntimeExports.jsx("span", { className: inputField_module.default.helpIcon, children: jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.InfoCircledIcon, {}) }) }))] })), jsxRuntime.jsxRuntimeExports.jsxs("div", { className: clsx.clsx(inputWrapper({ size, className }), error && inputField_module.default['input-error-wrapper'], disabled && inputField_module.default['input-disabled-wrapper'], chips?.length && inputField_module.default['has-chips']), children: [leadingIcon && jsxRuntime.jsxRuntimeExports.jsx("div", { className: inputField_module.default['leading-icon'], children: leadingIcon }), prefix && jsxRuntime.jsxRuntimeExports.jsx("div", { className: inputField_module.default.prefix, children: prefix }), jsxRuntime.jsxRuntimeExports.jsxs("div", { className: inputField_module.default['chip-input-container'], children: [chips?.slice(0, maxChipsVisible).map((chip$1, index) => (jsxRuntime.jsxRuntimeExports.jsx(chip.Chip, { variant: "outline", isDismissible: !!chip$1.onRemove, onDismiss: chip$1.onRemove, className: inputField_module.default.chip, children: chip$1.label }, index))), chips && chips.length > maxChipsVisible && (jsxRuntime.jsxRuntimeExports.jsxs("span", { className: inputField_module.default['chip-overflow'], children: ["+", chips.length - maxChipsVisible] })), jsxRuntime.jsxRuntimeExports.jsx("input", { ref: ref, className: clsx.clsx(inputField_module.default['input-field'], leadingIcon && inputField_module.default['has-leading-icon'], trailingIcon && inputField_module.default['has-trailing-icon'], prefix && inputField_module.default['has-prefix'], suffix && inputField_module.default['has-suffix'], error && inputField_module.default['input-error'], disabled && inputField_module.default['input-disabled'], className), "aria-invalid": !!error, placeholder: placeholder, disabled: disabled, ...props })] }), suffix && jsxRuntime.jsxRuntimeExports.jsx("div", { className: inputField_module.default.suffix, children: suffix }), trailingIcon && jsxRuntime.jsxRuntimeExports.jsx("div", { className: inputField_module.default['trailing-icon'], children: trailingIcon })] }), (error || helperText) && (jsxRuntime.jsxRuntimeExports.jsx("span", { className: clsx.clsx(inputField_module.default['helper-text'], error && inputField_module.default['helper-text-error'], disabled && inputField_module.default['helper-text-disabled']), children: error || helperText }))] }));
|
|
28
|
+
const InputField = ({ className, disabled, label, helperText, placeholder, error, leadingIcon, trailingIcon, optional, prefix, suffix, width, chips, maxChipsVisible = 2, ref, size, infoTooltip, variant = "default", ...props }) => {
|
|
29
|
+
return (jsxRuntime.jsxRuntimeExports.jsxs("div", { className: inputField_module.default.container, style: { width: width || '100%' }, children: [label && (jsxRuntime.jsxRuntimeExports.jsxs("div", { className: inputField_module.default.labelContainer, children: [jsxRuntime.jsxRuntimeExports.jsxs("label", { className: clsx.clsx(inputField_module.default.label, disabled && inputField_module.default["label-disabled"]), children: [label, optional && jsxRuntime.jsxRuntimeExports.jsx("span", { className: inputField_module.default.optional, children: "(optional)" })] }), infoTooltip && (jsxRuntime.jsxRuntimeExports.jsx(tooltip.Tooltip, { message: infoTooltip, side: "right", children: jsxRuntime.jsxRuntimeExports.jsx("span", { className: inputField_module.default.helpIcon, children: jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.InfoCircledIcon, {}) }) }))] })), jsxRuntime.jsxRuntimeExports.jsxs("div", { className: clsx.clsx(inputWrapper({ size, variant, className }), error && inputField_module.default['input-error-wrapper'], disabled && inputField_module.default['input-disabled-wrapper'], chips?.length && inputField_module.default['has-chips']), children: [leadingIcon && jsxRuntime.jsxRuntimeExports.jsx("div", { className: inputField_module.default['leading-icon'], children: leadingIcon }), prefix && jsxRuntime.jsxRuntimeExports.jsx("div", { className: inputField_module.default.prefix, children: prefix }), jsxRuntime.jsxRuntimeExports.jsxs("div", { className: inputField_module.default['chip-input-container'], children: [chips?.slice(0, maxChipsVisible).map((chip$1, index) => (jsxRuntime.jsxRuntimeExports.jsx(chip.Chip, { variant: "outline", isDismissible: !!chip$1.onRemove, onDismiss: chip$1.onRemove, className: inputField_module.default.chip, children: chip$1.label }, index))), chips && chips.length > maxChipsVisible && (jsxRuntime.jsxRuntimeExports.jsxs("span", { className: inputField_module.default['chip-overflow'], children: ["+", chips.length - maxChipsVisible] })), jsxRuntime.jsxRuntimeExports.jsx("input", { ref: ref, className: clsx.clsx(inputField_module.default['input-field'], leadingIcon && inputField_module.default['has-leading-icon'], trailingIcon && inputField_module.default['has-trailing-icon'], prefix && inputField_module.default['has-prefix'], suffix && inputField_module.default['has-suffix'], error && inputField_module.default['input-error'], disabled && inputField_module.default['input-disabled'], className), "aria-invalid": !!error, placeholder: placeholder, disabled: disabled, ...props })] }), suffix && jsxRuntime.jsxRuntimeExports.jsx("div", { className: inputField_module.default.suffix, children: suffix }), trailingIcon && jsxRuntime.jsxRuntimeExports.jsx("div", { className: inputField_module.default['trailing-icon'], children: trailingIcon })] }), (error || helperText) && (jsxRuntime.jsxRuntimeExports.jsx("span", { className: clsx.clsx(inputField_module.default['helper-text'], error && inputField_module.default['helper-text-error'], disabled && inputField_module.default['helper-text-disabled']), children: error || helperText }))] }));
|
|
25
30
|
};
|
|
26
31
|
InputField.displayName = "InputField";
|
|
27
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-field.cjs","sources":["../../../../v1/components/input-field/input-field.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport clsx from \"clsx\";\nimport { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { InfoCircledIcon } from \"@radix-ui/react-icons\";\nimport { Tooltip } from \"../tooltip\";\n\nimport { Chip } from \"../chip\";\nimport styles from \"./input-field.module.css\";\n\n// Todo: Add a dropdown support\n\nconst inputWrapper = cva(styles.inputWrapper, {\n variants: {\n size: {\n small: styles[\"size-small\"],\n large: styles[\"size-large\"],\n }\n },\n defaultVariants: {\n size: \"large\",\n }\n});\n\nexport interface InputFieldProps\n extends Omit<ComponentPropsWithoutRef<\"input\">, \"error\" | \"size\">,\n VariantProps<typeof inputWrapper> {\n label?: string;\n helperText?: string;\n error?: string;\n disabled?: boolean;\n leadingIcon?: ReactNode;\n trailingIcon?: ReactNode;\n optional?: boolean;\n prefix?: string;\n suffix?: string;\n width?: string | number;\n chips?: Array<{ label: string; onRemove?: () => void }>;\n maxChipsVisible?: number;\n ref?: React.RefObject<HTMLInputElement>;\n infoTooltip?: string;\n}\n\nexport const InputField = ({ \n className,\n disabled,\n label,\n helperText,\n placeholder,\n error,\n leadingIcon,\n trailingIcon,\n optional,\n prefix,\n suffix,\n width,\n chips,\n maxChipsVisible = 2,\n ref,\n size,\n infoTooltip,\n ...props \n}: InputFieldProps) => {\n return (\n <div className={styles.container} style={{ width: width || '100%' }}>\n {label && (\n <div className={styles.labelContainer}>\n <label className={clsx(styles.label, disabled && styles[\"label-disabled\"])}>\n {label}\n {optional && <span className={styles.optional}>(optional)</span>}\n </label>\n {infoTooltip && (\n <Tooltip message={infoTooltip} side=\"right\">\n <span className={styles.helpIcon}>\n <InfoCircledIcon />\n </span>\n </Tooltip>\n )}\n </div>\n )}\n <div \n className={clsx(\n inputWrapper({ size, className }),\n error && styles['input-error-wrapper'],\n disabled && styles['input-disabled-wrapper'],\n chips?.length && styles['has-chips']\n )}\n >\n {leadingIcon && <div className={styles['leading-icon']}>{leadingIcon}</div>}\n {prefix && <div className={styles.prefix}>{prefix}</div>}\n \n <div className={styles['chip-input-container']}>\n {chips?.slice(0, maxChipsVisible).map((chip, index) => (\n <Chip\n key={index}\n variant=\"outline\"\n isDismissible={!!chip.onRemove}\n onDismiss={chip.onRemove}\n className={styles.chip}\n >\n {chip.label}\n </Chip>\n ))}\n {chips && chips.length > maxChipsVisible && (\n <span className={styles['chip-overflow']}>\n +{chips.length - maxChipsVisible}\n </span>\n )}\n <input\n ref={ref}\n className={clsx(\n styles['input-field'],\n leadingIcon && styles['has-leading-icon'],\n trailingIcon && styles['has-trailing-icon'],\n prefix && styles['has-prefix'],\n suffix && styles['has-suffix'],\n error && styles['input-error'],\n disabled && styles['input-disabled'],\n className\n )}\n aria-invalid={!!error}\n placeholder={placeholder}\n disabled={disabled}\n {...props}\n />\n </div>\n \n {suffix && <div className={styles.suffix}>{suffix}</div>}\n {trailingIcon && <div className={styles['trailing-icon']}>{trailingIcon}</div>}\n </div>\n {(error || helperText) && (\n <span \n className={clsx(\n styles['helper-text'], \n error && styles['helper-text-error'],\n disabled && styles['helper-text-disabled']\n )}\n >\n {error || helperText}\n </span>\n )}\n </div>\n );\n};\n\nInputField.displayName = \"InputField\";"],"names":["cva","styles","_jsxs","clsx","_jsx","Tooltip","InfoCircledIcon","chip","Chip"],"mappings":";;;;;;;;;;AASA;AAEA,MAAM,YAAY,GAAGA,SAAG,CAACC,yBAAM,CAAC,YAAY,EAAE;AAC5C,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,KAAK,EAAEA,yBAAM,CAAC,YAAY,CAAC;AAC3B,YAAA,KAAK,EAAEA,yBAAM,CAAC,YAAY,CAAC;AAC5B,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,OAAO;
|
|
1
|
+
{"version":3,"file":"input-field.cjs","sources":["../../../../v1/components/input-field/input-field.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport clsx from \"clsx\";\nimport { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { InfoCircledIcon } from \"@radix-ui/react-icons\";\nimport { Tooltip } from \"../tooltip\";\n\nimport { Chip } from \"../chip\";\nimport styles from \"./input-field.module.css\";\n\n// Todo: Add a dropdown support\n\nconst inputWrapper = cva(styles.inputWrapper, {\n variants: {\n size: {\n small: styles[\"size-small\"],\n large: styles[\"size-large\"],\n },\n variant: {\n default: styles[\"variant-default\"],\n borderless: styles[\"variant-borderless\"],\n }\n },\n defaultVariants: {\n size: \"large\",\n variant: \"default\",\n }\n});\n\nexport interface InputFieldProps\n extends Omit<ComponentPropsWithoutRef<\"input\">, \"error\" | \"size\">,\n VariantProps<typeof inputWrapper> {\n label?: string;\n helperText?: string;\n error?: string;\n disabled?: boolean;\n leadingIcon?: ReactNode;\n trailingIcon?: ReactNode;\n optional?: boolean;\n prefix?: string;\n suffix?: string;\n width?: string | number;\n chips?: Array<{ label: string; onRemove?: () => void }>;\n maxChipsVisible?: number;\n ref?: React.RefObject<HTMLInputElement>;\n infoTooltip?: string;\n variant?: \"default\" | \"borderless\";\n}\n\nexport const InputField = ({ \n className,\n disabled,\n label,\n helperText,\n placeholder,\n error,\n leadingIcon,\n trailingIcon,\n optional,\n prefix,\n suffix,\n width,\n chips,\n maxChipsVisible = 2,\n ref,\n size,\n infoTooltip,\n variant = \"default\",\n ...props \n}: InputFieldProps) => {\n return (\n <div className={styles.container} style={{ width: width || '100%' }}>\n {label && (\n <div className={styles.labelContainer}>\n <label className={clsx(styles.label, disabled && styles[\"label-disabled\"])}>\n {label}\n {optional && <span className={styles.optional}>(optional)</span>}\n </label>\n {infoTooltip && (\n <Tooltip message={infoTooltip} side=\"right\">\n <span className={styles.helpIcon}>\n <InfoCircledIcon />\n </span>\n </Tooltip>\n )}\n </div>\n )}\n <div \n className={clsx(\n inputWrapper({ size, variant, className }),\n error && styles['input-error-wrapper'],\n disabled && styles['input-disabled-wrapper'],\n chips?.length && styles['has-chips']\n )}\n >\n {leadingIcon && <div className={styles['leading-icon']}>{leadingIcon}</div>}\n {prefix && <div className={styles.prefix}>{prefix}</div>}\n \n <div className={styles['chip-input-container']}>\n {chips?.slice(0, maxChipsVisible).map((chip, index) => (\n <Chip\n key={index}\n variant=\"outline\"\n isDismissible={!!chip.onRemove}\n onDismiss={chip.onRemove}\n className={styles.chip}\n >\n {chip.label}\n </Chip>\n ))}\n {chips && chips.length > maxChipsVisible && (\n <span className={styles['chip-overflow']}>\n +{chips.length - maxChipsVisible}\n </span>\n )}\n <input\n ref={ref}\n className={clsx(\n styles['input-field'],\n leadingIcon && styles['has-leading-icon'],\n trailingIcon && styles['has-trailing-icon'],\n prefix && styles['has-prefix'],\n suffix && styles['has-suffix'],\n error && styles['input-error'],\n disabled && styles['input-disabled'],\n className\n )}\n aria-invalid={!!error}\n placeholder={placeholder}\n disabled={disabled}\n {...props}\n />\n </div>\n \n {suffix && <div className={styles.suffix}>{suffix}</div>}\n {trailingIcon && <div className={styles['trailing-icon']}>{trailingIcon}</div>}\n </div>\n {(error || helperText) && (\n <span \n className={clsx(\n styles['helper-text'], \n error && styles['helper-text-error'],\n disabled && styles['helper-text-disabled']\n )}\n >\n {error || helperText}\n </span>\n )}\n </div>\n );\n};\n\nInputField.displayName = \"InputField\";"],"names":["cva","styles","_jsxs","clsx","_jsx","Tooltip","InfoCircledIcon","chip","Chip"],"mappings":";;;;;;;;;;AASA;AAEA,MAAM,YAAY,GAAGA,SAAG,CAACC,yBAAM,CAAC,YAAY,EAAE;AAC5C,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,KAAK,EAAEA,yBAAM,CAAC,YAAY,CAAC;AAC3B,YAAA,KAAK,EAAEA,yBAAM,CAAC,YAAY,CAAC;AAC5B,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAEA,yBAAM,CAAC,iBAAiB,CAAC;AAClC,YAAA,UAAU,EAAEA,yBAAM,CAAC,oBAAoB,CAAC;AACzC,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,OAAO;AACb,QA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AC,gBAAgB,CAAC,EACpC,SAAS,CACV,EACa,cAAA,EAAA,CAAC,CAAC,KAAK,EACrB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EACd,GAAA,KAAK,GACT,CACE,EAAA,CAAA,EAEL,MAAM,IAAIG,gCAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEH,yBAAM,CAAC,MAAM,EAAA,QAAA,EAAG,MAAM,EAAO,CAAA,EACvD,YAAY,IAAIG,gCAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEH,yBAAM,CAAC,eAAe,CAAC,YAAG,YAAY,EAAA,CAAO,IAC1E,EACL,CAAC,KAAK,IAAI,UAAU,MACnBG,2CACE,SAAS,EAAED,SAAI,CACbF,yBAAM,CAAC,aAAa,CAAC,EACrB,KAAK,IAAIA,yBAAM,CAAC,mBAAmB,CAAC,EACpC,QAAQ,IAAIA,yBAAM,CAAC,sBAAsB,CAAC,CAC3C,YAEA,KAAK,IAAI,UAAU,EACf,CAAA,CACR,CACG,EAAA,CAAA,EACN;AACJ,EAAE;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
|
|
@@ -2,6 +2,7 @@ import { type VariantProps } from "class-variance-authority";
|
|
|
2
2
|
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
3
3
|
declare const inputWrapper: (props?: ({
|
|
4
4
|
size?: "small" | "large" | null | undefined;
|
|
5
|
+
variant?: "default" | "borderless" | null | undefined;
|
|
5
6
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
7
|
export interface InputFieldProps extends Omit<ComponentPropsWithoutRef<"input">, "error" | "size">, VariantProps<typeof inputWrapper> {
|
|
7
8
|
label?: string;
|
|
@@ -21,9 +22,10 @@ export interface InputFieldProps extends Omit<ComponentPropsWithoutRef<"input">,
|
|
|
21
22
|
maxChipsVisible?: number;
|
|
22
23
|
ref?: React.RefObject<HTMLInputElement>;
|
|
23
24
|
infoTooltip?: string;
|
|
25
|
+
variant?: "default" | "borderless";
|
|
24
26
|
}
|
|
25
27
|
export declare const InputField: {
|
|
26
|
-
({ className, disabled, label, helperText, placeholder, error, leadingIcon, trailingIcon, optional, prefix, suffix, width, chips, maxChipsVisible, ref, size, infoTooltip, ...props }: InputFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
({ className, disabled, label, helperText, placeholder, error, leadingIcon, trailingIcon, optional, prefix, suffix, width, chips, maxChipsVisible, ref, size, infoTooltip, variant, ...props }: InputFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
27
29
|
displayName: string;
|
|
28
30
|
};
|
|
29
31
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-field.d.ts","sourceRoot":"","sources":["../../../../v1/components/input-field/input-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAS5D,QAAA,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"input-field.d.ts","sourceRoot":"","sources":["../../../../v1/components/input-field/input-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAS5D,QAAA,MAAM,YAAY;;;mFAehB,CAAC;AAEH,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,EAC/D,YAAY,CAAC,OAAO,YAAY,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAC;IACxD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,GAAG,YAAY,CAAC;CACpC;AAED,eAAO,MAAM,UAAU;oMAoBpB,eAAe;;CAiFjB,CAAC"}
|
|
@@ -12,14 +12,19 @@ const inputWrapper = cva(styles.inputWrapper, {
|
|
|
12
12
|
size: {
|
|
13
13
|
small: styles["size-small"],
|
|
14
14
|
large: styles["size-large"],
|
|
15
|
+
},
|
|
16
|
+
variant: {
|
|
17
|
+
default: styles["variant-default"],
|
|
18
|
+
borderless: styles["variant-borderless"],
|
|
15
19
|
}
|
|
16
20
|
},
|
|
17
21
|
defaultVariants: {
|
|
18
22
|
size: "large",
|
|
23
|
+
variant: "default",
|
|
19
24
|
}
|
|
20
25
|
});
|
|
21
|
-
const InputField = ({ className, disabled, label, helperText, placeholder, error, leadingIcon, trailingIcon, optional, prefix, suffix, width, chips, maxChipsVisible = 2, ref, size, infoTooltip, ...props }) => {
|
|
22
|
-
return (jsxRuntimeExports.jsxs("div", { className: styles.container, style: { width: width || '100%' }, children: [label && (jsxRuntimeExports.jsxs("div", { className: styles.labelContainer, children: [jsxRuntimeExports.jsxs("label", { className: clsx(styles.label, disabled && styles["label-disabled"]), children: [label, optional && jsxRuntimeExports.jsx("span", { className: styles.optional, children: "(optional)" })] }), infoTooltip && (jsxRuntimeExports.jsx(Tooltip, { message: infoTooltip, side: "right", children: jsxRuntimeExports.jsx("span", { className: styles.helpIcon, children: jsxRuntimeExports.jsx(InfoCircledIcon, {}) }) }))] })), jsxRuntimeExports.jsxs("div", { className: clsx(inputWrapper({ size, className }), error && styles['input-error-wrapper'], disabled && styles['input-disabled-wrapper'], chips?.length && styles['has-chips']), children: [leadingIcon && jsxRuntimeExports.jsx("div", { className: styles['leading-icon'], children: leadingIcon }), prefix && jsxRuntimeExports.jsx("div", { className: styles.prefix, children: prefix }), jsxRuntimeExports.jsxs("div", { className: styles['chip-input-container'], children: [chips?.slice(0, maxChipsVisible).map((chip, index) => (jsxRuntimeExports.jsx(Chip, { variant: "outline", isDismissible: !!chip.onRemove, onDismiss: chip.onRemove, className: styles.chip, children: chip.label }, index))), chips && chips.length > maxChipsVisible && (jsxRuntimeExports.jsxs("span", { className: styles['chip-overflow'], children: ["+", chips.length - maxChipsVisible] })), jsxRuntimeExports.jsx("input", { ref: ref, className: clsx(styles['input-field'], leadingIcon && styles['has-leading-icon'], trailingIcon && styles['has-trailing-icon'], prefix && styles['has-prefix'], suffix && styles['has-suffix'], error && styles['input-error'], disabled && styles['input-disabled'], className), "aria-invalid": !!error, placeholder: placeholder, disabled: disabled, ...props })] }), suffix && jsxRuntimeExports.jsx("div", { className: styles.suffix, children: suffix }), trailingIcon && jsxRuntimeExports.jsx("div", { className: styles['trailing-icon'], children: trailingIcon })] }), (error || helperText) && (jsxRuntimeExports.jsx("span", { className: clsx(styles['helper-text'], error && styles['helper-text-error'], disabled && styles['helper-text-disabled']), children: error || helperText }))] }));
|
|
26
|
+
const InputField = ({ className, disabled, label, helperText, placeholder, error, leadingIcon, trailingIcon, optional, prefix, suffix, width, chips, maxChipsVisible = 2, ref, size, infoTooltip, variant = "default", ...props }) => {
|
|
27
|
+
return (jsxRuntimeExports.jsxs("div", { className: styles.container, style: { width: width || '100%' }, children: [label && (jsxRuntimeExports.jsxs("div", { className: styles.labelContainer, children: [jsxRuntimeExports.jsxs("label", { className: clsx(styles.label, disabled && styles["label-disabled"]), children: [label, optional && jsxRuntimeExports.jsx("span", { className: styles.optional, children: "(optional)" })] }), infoTooltip && (jsxRuntimeExports.jsx(Tooltip, { message: infoTooltip, side: "right", children: jsxRuntimeExports.jsx("span", { className: styles.helpIcon, children: jsxRuntimeExports.jsx(InfoCircledIcon, {}) }) }))] })), jsxRuntimeExports.jsxs("div", { className: clsx(inputWrapper({ size, variant, className }), error && styles['input-error-wrapper'], disabled && styles['input-disabled-wrapper'], chips?.length && styles['has-chips']), children: [leadingIcon && jsxRuntimeExports.jsx("div", { className: styles['leading-icon'], children: leadingIcon }), prefix && jsxRuntimeExports.jsx("div", { className: styles.prefix, children: prefix }), jsxRuntimeExports.jsxs("div", { className: styles['chip-input-container'], children: [chips?.slice(0, maxChipsVisible).map((chip, index) => (jsxRuntimeExports.jsx(Chip, { variant: "outline", isDismissible: !!chip.onRemove, onDismiss: chip.onRemove, className: styles.chip, children: chip.label }, index))), chips && chips.length > maxChipsVisible && (jsxRuntimeExports.jsxs("span", { className: styles['chip-overflow'], children: ["+", chips.length - maxChipsVisible] })), jsxRuntimeExports.jsx("input", { ref: ref, className: clsx(styles['input-field'], leadingIcon && styles['has-leading-icon'], trailingIcon && styles['has-trailing-icon'], prefix && styles['has-prefix'], suffix && styles['has-suffix'], error && styles['input-error'], disabled && styles['input-disabled'], className), "aria-invalid": !!error, placeholder: placeholder, disabled: disabled, ...props })] }), suffix && jsxRuntimeExports.jsx("div", { className: styles.suffix, children: suffix }), trailingIcon && jsxRuntimeExports.jsx("div", { className: styles['trailing-icon'], children: trailingIcon })] }), (error || helperText) && (jsxRuntimeExports.jsx("span", { className: clsx(styles['helper-text'], error && styles['helper-text-error'], disabled && styles['helper-text-disabled']), children: error || helperText }))] }));
|
|
23
28
|
};
|
|
24
29
|
InputField.displayName = "InputField";
|
|
25
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-field.js","sources":["../../../../v1/components/input-field/input-field.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport clsx from \"clsx\";\nimport { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { InfoCircledIcon } from \"@radix-ui/react-icons\";\nimport { Tooltip } from \"../tooltip\";\n\nimport { Chip } from \"../chip\";\nimport styles from \"./input-field.module.css\";\n\n// Todo: Add a dropdown support\n\nconst inputWrapper = cva(styles.inputWrapper, {\n variants: {\n size: {\n small: styles[\"size-small\"],\n large: styles[\"size-large\"],\n }\n },\n defaultVariants: {\n size: \"large\",\n }\n});\n\nexport interface InputFieldProps\n extends Omit<ComponentPropsWithoutRef<\"input\">, \"error\" | \"size\">,\n VariantProps<typeof inputWrapper> {\n label?: string;\n helperText?: string;\n error?: string;\n disabled?: boolean;\n leadingIcon?: ReactNode;\n trailingIcon?: ReactNode;\n optional?: boolean;\n prefix?: string;\n suffix?: string;\n width?: string | number;\n chips?: Array<{ label: string; onRemove?: () => void }>;\n maxChipsVisible?: number;\n ref?: React.RefObject<HTMLInputElement>;\n infoTooltip?: string;\n}\n\nexport const InputField = ({ \n className,\n disabled,\n label,\n helperText,\n placeholder,\n error,\n leadingIcon,\n trailingIcon,\n optional,\n prefix,\n suffix,\n width,\n chips,\n maxChipsVisible = 2,\n ref,\n size,\n infoTooltip,\n ...props \n}: InputFieldProps) => {\n return (\n <div className={styles.container} style={{ width: width || '100%' }}>\n {label && (\n <div className={styles.labelContainer}>\n <label className={clsx(styles.label, disabled && styles[\"label-disabled\"])}>\n {label}\n {optional && <span className={styles.optional}>(optional)</span>}\n </label>\n {infoTooltip && (\n <Tooltip message={infoTooltip} side=\"right\">\n <span className={styles.helpIcon}>\n <InfoCircledIcon />\n </span>\n </Tooltip>\n )}\n </div>\n )}\n <div \n className={clsx(\n inputWrapper({ size, className }),\n error && styles['input-error-wrapper'],\n disabled && styles['input-disabled-wrapper'],\n chips?.length && styles['has-chips']\n )}\n >\n {leadingIcon && <div className={styles['leading-icon']}>{leadingIcon}</div>}\n {prefix && <div className={styles.prefix}>{prefix}</div>}\n \n <div className={styles['chip-input-container']}>\n {chips?.slice(0, maxChipsVisible).map((chip, index) => (\n <Chip\n key={index}\n variant=\"outline\"\n isDismissible={!!chip.onRemove}\n onDismiss={chip.onRemove}\n className={styles.chip}\n >\n {chip.label}\n </Chip>\n ))}\n {chips && chips.length > maxChipsVisible && (\n <span className={styles['chip-overflow']}>\n +{chips.length - maxChipsVisible}\n </span>\n )}\n <input\n ref={ref}\n className={clsx(\n styles['input-field'],\n leadingIcon && styles['has-leading-icon'],\n trailingIcon && styles['has-trailing-icon'],\n prefix && styles['has-prefix'],\n suffix && styles['has-suffix'],\n error && styles['input-error'],\n disabled && styles['input-disabled'],\n className\n )}\n aria-invalid={!!error}\n placeholder={placeholder}\n disabled={disabled}\n {...props}\n />\n </div>\n \n {suffix && <div className={styles.suffix}>{suffix}</div>}\n {trailingIcon && <div className={styles['trailing-icon']}>{trailingIcon}</div>}\n </div>\n {(error || helperText) && (\n <span \n className={clsx(\n styles['helper-text'], \n error && styles['helper-text-error'],\n disabled && styles['helper-text-disabled']\n )}\n >\n {error || helperText}\n </span>\n )}\n </div>\n );\n};\n\nInputField.displayName = \"InputField\";"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;AASA;AAEA,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,EAAE;AAC5C,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC;AAC3B,YAAA,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC;AAC5B,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,OAAO;
|
|
1
|
+
{"version":3,"file":"input-field.js","sources":["../../../../v1/components/input-field/input-field.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport clsx from \"clsx\";\nimport { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { InfoCircledIcon } from \"@radix-ui/react-icons\";\nimport { Tooltip } from \"../tooltip\";\n\nimport { Chip } from \"../chip\";\nimport styles from \"./input-field.module.css\";\n\n// Todo: Add a dropdown support\n\nconst inputWrapper = cva(styles.inputWrapper, {\n variants: {\n size: {\n small: styles[\"size-small\"],\n large: styles[\"size-large\"],\n },\n variant: {\n default: styles[\"variant-default\"],\n borderless: styles[\"variant-borderless\"],\n }\n },\n defaultVariants: {\n size: \"large\",\n variant: \"default\",\n }\n});\n\nexport interface InputFieldProps\n extends Omit<ComponentPropsWithoutRef<\"input\">, \"error\" | \"size\">,\n VariantProps<typeof inputWrapper> {\n label?: string;\n helperText?: string;\n error?: string;\n disabled?: boolean;\n leadingIcon?: ReactNode;\n trailingIcon?: ReactNode;\n optional?: boolean;\n prefix?: string;\n suffix?: string;\n width?: string | number;\n chips?: Array<{ label: string; onRemove?: () => void }>;\n maxChipsVisible?: number;\n ref?: React.RefObject<HTMLInputElement>;\n infoTooltip?: string;\n variant?: \"default\" | \"borderless\";\n}\n\nexport const InputField = ({ \n className,\n disabled,\n label,\n helperText,\n placeholder,\n error,\n leadingIcon,\n trailingIcon,\n optional,\n prefix,\n suffix,\n width,\n chips,\n maxChipsVisible = 2,\n ref,\n size,\n infoTooltip,\n variant = \"default\",\n ...props \n}: InputFieldProps) => {\n return (\n <div className={styles.container} style={{ width: width || '100%' }}>\n {label && (\n <div className={styles.labelContainer}>\n <label className={clsx(styles.label, disabled && styles[\"label-disabled\"])}>\n {label}\n {optional && <span className={styles.optional}>(optional)</span>}\n </label>\n {infoTooltip && (\n <Tooltip message={infoTooltip} side=\"right\">\n <span className={styles.helpIcon}>\n <InfoCircledIcon />\n </span>\n </Tooltip>\n )}\n </div>\n )}\n <div \n className={clsx(\n inputWrapper({ size, variant, className }),\n error && styles['input-error-wrapper'],\n disabled && styles['input-disabled-wrapper'],\n chips?.length && styles['has-chips']\n )}\n >\n {leadingIcon && <div className={styles['leading-icon']}>{leadingIcon}</div>}\n {prefix && <div className={styles.prefix}>{prefix}</div>}\n \n <div className={styles['chip-input-container']}>\n {chips?.slice(0, maxChipsVisible).map((chip, index) => (\n <Chip\n key={index}\n variant=\"outline\"\n isDismissible={!!chip.onRemove}\n onDismiss={chip.onRemove}\n className={styles.chip}\n >\n {chip.label}\n </Chip>\n ))}\n {chips && chips.length > maxChipsVisible && (\n <span className={styles['chip-overflow']}>\n +{chips.length - maxChipsVisible}\n </span>\n )}\n <input\n ref={ref}\n className={clsx(\n styles['input-field'],\n leadingIcon && styles['has-leading-icon'],\n trailingIcon && styles['has-trailing-icon'],\n prefix && styles['has-prefix'],\n suffix && styles['has-suffix'],\n error && styles['input-error'],\n disabled && styles['input-disabled'],\n className\n )}\n aria-invalid={!!error}\n placeholder={placeholder}\n disabled={disabled}\n {...props}\n />\n </div>\n \n {suffix && <div className={styles.suffix}>{suffix}</div>}\n {trailingIcon && <div className={styles['trailing-icon']}>{trailingIcon}</div>}\n </div>\n {(error || helperText) && (\n <span \n className={clsx(\n styles['helper-text'], \n error && styles['helper-text-error'],\n disabled && styles['helper-text-disabled']\n )}\n >\n {error || helperText}\n </span>\n )}\n </div>\n );\n};\n\nInputField.displayName = \"InputField\";"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;AASA;AAEA,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,EAAE;AAC5C,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC;AAC3B,YAAA,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC;AAC5B,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,MAAM,CAAC,iBAAiB,CAAC;AAClC,YAAA,UAAU,EAAE,MAAM,CAAC,oBAAoB,CAAC;AACzC,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,OAAO;AACb,QAA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AAC,CAAC,KAAK,EACrB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EACd,GAAA,KAAK,GACT,CACE,EAAA,CAAA,EAEL,MAAM,IAAIA,qBAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,MAAM,EAAA,QAAA,EAAG,MAAM,EAAO,CAAA,EACvD,YAAY,IAAIA,qBAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,YAAG,YAAY,EAAA,CAAO,IAC1E,EACL,CAAC,KAAK,IAAI,UAAU,MACnBA,gCACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,aAAa,CAAC,EACrB,KAAK,IAAI,MAAM,CAAC,mBAAmB,CAAC,EACpC,QAAQ,IAAI,MAAM,CAAC,sBAAsB,CAAC,CAC3C,YAEA,KAAK,IAAI,UAAU,EACf,CAAA,CACR,CACG,EAAA,CAAA,EACN;AACJ,EAAE;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var styles = {"container":"input-field-module_container__EO1UE","label":"input-field-module_label__FIn-3","label-disabled":"input-field-module_label-disabled__YTPfz","inputWrapper":"input-field-module_inputWrapper__rZaqO","input-error-wrapper":"input-field-module_input-error-wrapper__xaNft","input-disabled-wrapper":"input-field-module_input-disabled-wrapper__szNYx","leading-icon":"input-field-module_leading-icon__J2Bif","trailing-icon":"input-field-module_trailing-icon__dNS8s","input-field":"input-field-module_input-field__M-gOb","input-default":"input-field-module_input-default__mI0I1","input-disabled":"input-field-module_input-disabled__Wpj4W","helper-text":"input-field-module_helper-text__PclGf","helper-text-error":"input-field-module_helper-text-error__1NSM-","helper-text-disabled":"input-field-module_helper-text-disabled__QcIBu","has-leading-icon":"input-field-module_has-leading-icon__Yxj6I","has-trailing-icon":"input-field-module_has-trailing-icon__uA7mP","optional":"input-field-module_optional__awrgj","has-chips":"input-field-module_has-chips__OvxNF","chip":"input-field-module_chip__Z2zua","chip-input-container":"input-field-module_chip-input-container__FJsHY","size-large":"input-field-module_size-large__nA2yK","size-small":"input-field-module_size-small__FFwSX","chip-overflow":"input-field-module_chip-overflow__n9kta","prefix":"input-field-module_prefix__WBsMj","suffix":"input-field-module_suffix__LiSQ0","has-prefix":"input-field-module_has-prefix__wV726","has-suffix":"input-field-module_has-suffix__UgqC6","labelContainer":"input-field-module_labelContainer__80FMe","helpIcon":"input-field-module_helpIcon__s8XKN","label___disabled":"input-field-module_label-disabled__YTPfz","input___error___wrapper":"input-field-module_input-error-wrapper__xaNft","input___disabled___wrapper":"input-field-module_input-disabled-wrapper__szNYx","leading___icon":"input-field-module_leading-icon__J2Bif","trailing___icon":"input-field-module_trailing-icon__dNS8s","input___field":"input-field-module_input-field__M-gOb","input___default":"input-field-module_input-default__mI0I1","input___disabled":"input-field-module_input-disabled__Wpj4W","helper___text":"input-field-module_helper-text__PclGf","helper___text___error":"input-field-module_helper-text-error__1NSM-","helper___text___disabled":"input-field-module_helper-text-disabled__QcIBu","has___leading___icon":"input-field-module_has-leading-icon__Yxj6I","has___trailing___icon":"input-field-module_has-trailing-icon__uA7mP","has___chips":"input-field-module_has-chips__OvxNF","chip___input___container":"input-field-module_chip-input-container__FJsHY","size___large":"input-field-module_size-large__nA2yK","size___small":"input-field-module_size-small__FFwSX","chip___overflow":"input-field-module_chip-overflow__n9kta","has___prefix":"input-field-module_has-prefix__wV726","has___suffix":"input-field-module_has-suffix__UgqC6"};
|
|
5
|
+
var styles = {"container":"input-field-module_container__EO1UE","label":"input-field-module_label__FIn-3","label-disabled":"input-field-module_label-disabled__YTPfz","inputWrapper":"input-field-module_inputWrapper__rZaqO","input-error-wrapper":"input-field-module_input-error-wrapper__xaNft","input-disabled-wrapper":"input-field-module_input-disabled-wrapper__szNYx","leading-icon":"input-field-module_leading-icon__J2Bif","trailing-icon":"input-field-module_trailing-icon__dNS8s","input-field":"input-field-module_input-field__M-gOb","input-default":"input-field-module_input-default__mI0I1","input-disabled":"input-field-module_input-disabled__Wpj4W","helper-text":"input-field-module_helper-text__PclGf","helper-text-error":"input-field-module_helper-text-error__1NSM-","helper-text-disabled":"input-field-module_helper-text-disabled__QcIBu","has-leading-icon":"input-field-module_has-leading-icon__Yxj6I","has-trailing-icon":"input-field-module_has-trailing-icon__uA7mP","optional":"input-field-module_optional__awrgj","has-chips":"input-field-module_has-chips__OvxNF","chip":"input-field-module_chip__Z2zua","chip-input-container":"input-field-module_chip-input-container__FJsHY","size-large":"input-field-module_size-large__nA2yK","size-small":"input-field-module_size-small__FFwSX","chip-overflow":"input-field-module_chip-overflow__n9kta","prefix":"input-field-module_prefix__WBsMj","suffix":"input-field-module_suffix__LiSQ0","has-prefix":"input-field-module_has-prefix__wV726","has-suffix":"input-field-module_has-suffix__UgqC6","labelContainer":"input-field-module_labelContainer__80FMe","helpIcon":"input-field-module_helpIcon__s8XKN","variant-borderless":"input-field-module_variant-borderless__D9VpD","label___disabled":"input-field-module_label-disabled__YTPfz","input___error___wrapper":"input-field-module_input-error-wrapper__xaNft","input___disabled___wrapper":"input-field-module_input-disabled-wrapper__szNYx","leading___icon":"input-field-module_leading-icon__J2Bif","trailing___icon":"input-field-module_trailing-icon__dNS8s","input___field":"input-field-module_input-field__M-gOb","input___default":"input-field-module_input-default__mI0I1","input___disabled":"input-field-module_input-disabled__Wpj4W","helper___text":"input-field-module_helper-text__PclGf","helper___text___error":"input-field-module_helper-text-error__1NSM-","helper___text___disabled":"input-field-module_helper-text-disabled__QcIBu","has___leading___icon":"input-field-module_has-leading-icon__Yxj6I","has___trailing___icon":"input-field-module_has-trailing-icon__uA7mP","has___chips":"input-field-module_has-chips__OvxNF","chip___input___container":"input-field-module_chip-input-container__FJsHY","size___large":"input-field-module_size-large__nA2yK","size___small":"input-field-module_size-small__FFwSX","chip___overflow":"input-field-module_chip-overflow__n9kta","has___prefix":"input-field-module_has-prefix__wV726","has___suffix":"input-field-module_has-suffix__UgqC6","variant___borderless":"input-field-module_variant-borderless__D9VpD"};
|
|
6
6
|
|
|
7
7
|
exports.default = styles;
|
|
8
8
|
//# sourceMappingURL=input-field.module.css.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var styles = {"container":"input-field-module_container__EO1UE","label":"input-field-module_label__FIn-3","label-disabled":"input-field-module_label-disabled__YTPfz","inputWrapper":"input-field-module_inputWrapper__rZaqO","input-error-wrapper":"input-field-module_input-error-wrapper__xaNft","input-disabled-wrapper":"input-field-module_input-disabled-wrapper__szNYx","leading-icon":"input-field-module_leading-icon__J2Bif","trailing-icon":"input-field-module_trailing-icon__dNS8s","input-field":"input-field-module_input-field__M-gOb","input-default":"input-field-module_input-default__mI0I1","input-disabled":"input-field-module_input-disabled__Wpj4W","helper-text":"input-field-module_helper-text__PclGf","helper-text-error":"input-field-module_helper-text-error__1NSM-","helper-text-disabled":"input-field-module_helper-text-disabled__QcIBu","has-leading-icon":"input-field-module_has-leading-icon__Yxj6I","has-trailing-icon":"input-field-module_has-trailing-icon__uA7mP","optional":"input-field-module_optional__awrgj","has-chips":"input-field-module_has-chips__OvxNF","chip":"input-field-module_chip__Z2zua","chip-input-container":"input-field-module_chip-input-container__FJsHY","size-large":"input-field-module_size-large__nA2yK","size-small":"input-field-module_size-small__FFwSX","chip-overflow":"input-field-module_chip-overflow__n9kta","prefix":"input-field-module_prefix__WBsMj","suffix":"input-field-module_suffix__LiSQ0","has-prefix":"input-field-module_has-prefix__wV726","has-suffix":"input-field-module_has-suffix__UgqC6","labelContainer":"input-field-module_labelContainer__80FMe","helpIcon":"input-field-module_helpIcon__s8XKN","label___disabled":"input-field-module_label-disabled__YTPfz","input___error___wrapper":"input-field-module_input-error-wrapper__xaNft","input___disabled___wrapper":"input-field-module_input-disabled-wrapper__szNYx","leading___icon":"input-field-module_leading-icon__J2Bif","trailing___icon":"input-field-module_trailing-icon__dNS8s","input___field":"input-field-module_input-field__M-gOb","input___default":"input-field-module_input-default__mI0I1","input___disabled":"input-field-module_input-disabled__Wpj4W","helper___text":"input-field-module_helper-text__PclGf","helper___text___error":"input-field-module_helper-text-error__1NSM-","helper___text___disabled":"input-field-module_helper-text-disabled__QcIBu","has___leading___icon":"input-field-module_has-leading-icon__Yxj6I","has___trailing___icon":"input-field-module_has-trailing-icon__uA7mP","has___chips":"input-field-module_has-chips__OvxNF","chip___input___container":"input-field-module_chip-input-container__FJsHY","size___large":"input-field-module_size-large__nA2yK","size___small":"input-field-module_size-small__FFwSX","chip___overflow":"input-field-module_chip-overflow__n9kta","has___prefix":"input-field-module_has-prefix__wV726","has___suffix":"input-field-module_has-suffix__UgqC6"};
|
|
1
|
+
var styles = {"container":"input-field-module_container__EO1UE","label":"input-field-module_label__FIn-3","label-disabled":"input-field-module_label-disabled__YTPfz","inputWrapper":"input-field-module_inputWrapper__rZaqO","input-error-wrapper":"input-field-module_input-error-wrapper__xaNft","input-disabled-wrapper":"input-field-module_input-disabled-wrapper__szNYx","leading-icon":"input-field-module_leading-icon__J2Bif","trailing-icon":"input-field-module_trailing-icon__dNS8s","input-field":"input-field-module_input-field__M-gOb","input-default":"input-field-module_input-default__mI0I1","input-disabled":"input-field-module_input-disabled__Wpj4W","helper-text":"input-field-module_helper-text__PclGf","helper-text-error":"input-field-module_helper-text-error__1NSM-","helper-text-disabled":"input-field-module_helper-text-disabled__QcIBu","has-leading-icon":"input-field-module_has-leading-icon__Yxj6I","has-trailing-icon":"input-field-module_has-trailing-icon__uA7mP","optional":"input-field-module_optional__awrgj","has-chips":"input-field-module_has-chips__OvxNF","chip":"input-field-module_chip__Z2zua","chip-input-container":"input-field-module_chip-input-container__FJsHY","size-large":"input-field-module_size-large__nA2yK","size-small":"input-field-module_size-small__FFwSX","chip-overflow":"input-field-module_chip-overflow__n9kta","prefix":"input-field-module_prefix__WBsMj","suffix":"input-field-module_suffix__LiSQ0","has-prefix":"input-field-module_has-prefix__wV726","has-suffix":"input-field-module_has-suffix__UgqC6","labelContainer":"input-field-module_labelContainer__80FMe","helpIcon":"input-field-module_helpIcon__s8XKN","variant-borderless":"input-field-module_variant-borderless__D9VpD","label___disabled":"input-field-module_label-disabled__YTPfz","input___error___wrapper":"input-field-module_input-error-wrapper__xaNft","input___disabled___wrapper":"input-field-module_input-disabled-wrapper__szNYx","leading___icon":"input-field-module_leading-icon__J2Bif","trailing___icon":"input-field-module_trailing-icon__dNS8s","input___field":"input-field-module_input-field__M-gOb","input___default":"input-field-module_input-default__mI0I1","input___disabled":"input-field-module_input-disabled__Wpj4W","helper___text":"input-field-module_helper-text__PclGf","helper___text___error":"input-field-module_helper-text-error__1NSM-","helper___text___disabled":"input-field-module_helper-text-disabled__QcIBu","has___leading___icon":"input-field-module_has-leading-icon__Yxj6I","has___trailing___icon":"input-field-module_has-trailing-icon__uA7mP","has___chips":"input-field-module_has-chips__OvxNF","chip___input___container":"input-field-module_chip-input-container__FJsHY","size___large":"input-field-module_size-large__nA2yK","size___small":"input-field-module_size-small__FFwSX","chip___overflow":"input-field-module_chip-overflow__n9kta","has___prefix":"input-field-module_has-prefix__wV726","has___suffix":"input-field-module_has-suffix__UgqC6","variant___borderless":"input-field-module_variant-borderless__D9VpD"};
|
|
2
2
|
|
|
3
3
|
export { styles as default };
|
|
4
4
|
//# sourceMappingURL=input-field.module.css.js.map
|
|
@@ -2,23 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
|
|
4
4
|
var reactIcons_esm = require('../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var inputField = require('../input-field/input-field.cjs');
|
|
6
|
+
var iconButton = require('../icon-button/icon-button.cjs');
|
|
7
7
|
var search_module = require('./search.module.css.cjs');
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
size: "large",
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
const Search = ({ className, disabled, placeholder = "Search", size, showClearButton, onClear, value, ref, ...props }) => {
|
|
21
|
-
return (jsxRuntime.jsxRuntimeExports.jsxs("div", { className: clsx.clsx(search_module.default.container, disabled && search_module.default.disabled), role: "search", children: [jsxRuntime.jsxRuntimeExports.jsx("span", { className: search_module.default.leadingIcon, "aria-hidden": "true", children: jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.MagnifyingGlassIcon, {}) }), jsxRuntime.jsxRuntimeExports.jsx("input", { ref: ref, type: "text", className: clsx.clsx(searchField({ size, className }), disabled && search_module.default["search-disabled"]), placeholder: placeholder, disabled: disabled, value: value, "aria-label": placeholder, ...props }), showClearButton && value && !disabled && (jsxRuntime.jsxRuntimeExports.jsx("button", { className: search_module.default.clearButton, onClick: onClear, disabled: disabled, type: "button", "aria-label": "Clear search", tabIndex: 0, children: jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.CrossCircledIcon, { height: 16, width: 16 }) }))] }));
|
|
9
|
+
const Search = ({ className, disabled, placeholder = "Search", size, showClearButton, onClear, value, onChange, width = "100%", variant = "default", ...props }) => {
|
|
10
|
+
const trailingIconWithClear = showClearButton && value ? (jsxRuntime.jsxRuntimeExports.jsx("div", { className: search_module.default.clearButtonWrapper, children: jsxRuntime.jsxRuntimeExports.jsx(iconButton.IconButton, { size: size === 'small' ? 2 : 3, onClick: (e) => {
|
|
11
|
+
e.stopPropagation();
|
|
12
|
+
if (!disabled && onClear) {
|
|
13
|
+
onClear();
|
|
14
|
+
}
|
|
15
|
+
}, disabled: disabled, "aria-label": "Clear search", className: search_module.default.clearButton, children: jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.CrossCircledIcon, {}) }) })) : undefined;
|
|
16
|
+
return (jsxRuntime.jsxRuntimeExports.jsx("div", { className: search_module.default.container, role: "search", style: { width }, children: jsxRuntime.jsxRuntimeExports.jsx(inputField.InputField, { leadingIcon: jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.MagnifyingGlassIcon, {}), trailingIcon: trailingIconWithClear, placeholder: placeholder, disabled: disabled, value: value, onChange: onChange, size: size, className: className, "aria-label": placeholder, variant: variant, ...props }) }));
|
|
22
17
|
};
|
|
23
18
|
Search.displayName = "Search";
|
|
24
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.cjs","sources":["../../../../v1/components/search/search.tsx"],"sourcesContent":["import { CrossCircledIcon,MagnifyingGlassIcon } from \"@radix-ui/react-icons\";\nimport {
|
|
1
|
+
{"version":3,"file":"search.cjs","sources":["../../../../v1/components/search/search.tsx"],"sourcesContent":["import { CrossCircledIcon, MagnifyingGlassIcon } from \"@radix-ui/react-icons\";\nimport { InputField } from \"../input-field\";\nimport { InputFieldProps } from \"../input-field/input-field\";\nimport { IconButton } from \"../icon-button\";\n\nimport styles from \"./search.module.css\";\n\nexport interface SearchProps extends Omit<InputFieldProps, 'leadingIcon'> {\n showClearButton?: boolean;\n onClear?: () => void;\n variant?: 'default' | 'borderless';\n}\n\nexport const Search = ({ \n className, \n disabled, \n placeholder = \"Search\", \n size, \n showClearButton, \n onClear, \n value,\n onChange,\n width = \"100%\",\n variant = \"default\",\n ...props \n}: SearchProps) => {\n const trailingIconWithClear = showClearButton && value ? (\n <div className={styles.clearButtonWrapper}>\n <IconButton\n size={size === 'small' ? 2 : 3}\n onClick={(e) => {\n e.stopPropagation();\n if (!disabled && onClear) {\n onClear();\n }\n }}\n disabled={disabled}\n aria-label=\"Clear search\"\n className={styles.clearButton}\n >\n <CrossCircledIcon />\n </IconButton>\n </div>\n ) : undefined;\n\n return (\n <div className={styles.container} role=\"search\" style={{ width }}>\n <InputField\n leadingIcon={<MagnifyingGlassIcon />}\n trailingIcon={trailingIconWithClear}\n placeholder={placeholder}\n disabled={disabled}\n value={value}\n onChange={onChange}\n size={size}\n className={className}\n aria-label={placeholder}\n variant={variant}\n {...props}\n />\n </div>\n );\n};\n\nSearch.displayName = \"Search\";"],"names":["_jsx","styles","IconButton","CrossCircledIcon","InputField","MagnifyingGlassIcon"],"mappings":";;;;;;;;AAaa,MAAA,MAAM,GAAG,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,WAAW,GAAG,QAAQ,EACtB,IAAI,EACJ,eAAe,EACf,OAAO,EACP,KAAK,EACL,QAAQ,EACR,KAAK,GAAG,MAAM,EACd,OAAO,GAAG,SAAS,EACnB,GAAG,KAAK,EACI,KAAI;AAChB,IAAA,MAAM,qBAAqB,GAAG,eAAe,IAAI,KAAK,IACpDA,gCAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEC,qBAAM,CAAC,kBAAkB,EAAA,QAAA,EACvCD,iCAACE,qBAAU,EAAA,EACT,IAAI,EAAE,IAAI,KAAK,OAAO,GAAG,CAAC,GAAG,CAAC,EAC9B,OAAO,EAAE,CAAC,CAAC,KAAI;gBACb,CAAC,CAAC,eAAe,EAAE,CAAC;AACpB,gBAAA,IAAI,CAAC,QAAQ,IAAI,OAAO,EAAE;AACxB,oBAAA,OAAO,EAAE,CAAC;iBACX;aACF,EACD,QAAQ,EAAE,QAAQ,gBACP,cAAc,EACzB,SAAS,EAAED,qBAAM,CAAC,WAAW,EAE7B,QAAA,EAAAD,gCAAA,CAACG,+BAAgB,EAAA,EAAA,CAAG,EACT,CAAA,EAAA,CACT,IACJ,SAAS,CAAC;AAEd,IAAA,QACEH,gCAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEC,qBAAM,CAAC,SAAS,EAAE,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAC9D,QAAA,EAAAD,gCAAA,CAACI,qBAAU,EAAA,EACT,WAAW,EAAEJ,gCAAC,CAAAK,kCAAmB,EAAG,EAAA,CAAA,EACpC,YAAY,EAAE,qBAAqB,EACnC,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EAAA,YAAA,EACR,WAAW,EACvB,OAAO,EAAE,OAAO,EACZ,GAAA,KAAK,EACT,CAAA,EAAA,CACE,EACN;AACJ,EAAE;AAEF,MAAM,CAAC,WAAW,GAAG,QAAQ;;;;"}
|
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
size?: "small" | "large" | null | undefined;
|
|
4
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
5
|
-
export interface SearchProps extends VariantProps<typeof searchField> {
|
|
6
|
-
className?: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
placeholder?: string;
|
|
1
|
+
import { InputFieldProps } from "../input-field/input-field";
|
|
2
|
+
export interface SearchProps extends Omit<InputFieldProps, 'leadingIcon'> {
|
|
9
3
|
showClearButton?: boolean;
|
|
10
4
|
onClear?: () => void;
|
|
11
|
-
|
|
12
|
-
ref?: React.RefObject<HTMLInputElement>;
|
|
13
|
-
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
14
|
-
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
15
|
-
type?: string;
|
|
16
|
-
name?: string;
|
|
17
|
-
id?: string;
|
|
5
|
+
variant?: 'default' | 'borderless';
|
|
18
6
|
}
|
|
19
7
|
export declare const Search: {
|
|
20
|
-
({ className, disabled, placeholder, size, showClearButton, onClear, value,
|
|
8
|
+
({ className, disabled, placeholder, size, showClearButton, onClear, value, onChange, width, variant, ...props }: SearchProps): import("react/jsx-runtime").JSX.Element;
|
|
21
9
|
displayName: string;
|
|
22
10
|
};
|
|
23
|
-
export {};
|
|
24
11
|
//# sourceMappingURL=search.d.ts.map
|