@tecsinapse/cortex-react 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/LICENSE.md +21 -0
  2. package/dist/cjs/components/Badge.js +27 -0
  3. package/dist/cjs/components/Button.js +11 -0
  4. package/dist/cjs/components/Card.js +19 -0
  5. package/dist/cjs/components/Hint.js +21 -0
  6. package/dist/cjs/components/Input.js +79 -0
  7. package/dist/cjs/components/Modal.js +25 -0
  8. package/dist/cjs/components/SearchInput.js +70 -0
  9. package/dist/cjs/components/Select.js +101 -0
  10. package/dist/cjs/components/Snackbar.js +18 -0
  11. package/dist/cjs/components/Table.js +22 -0
  12. package/dist/cjs/components/Tag.js +18 -0
  13. package/dist/cjs/components/TextArea.js +81 -0
  14. package/dist/cjs/components/Toggle.js +18 -0
  15. package/dist/cjs/hooks/useDebouncedState.js +16 -0
  16. package/dist/cjs/index.js +42 -0
  17. package/dist/esm/components/Badge.js +24 -0
  18. package/dist/esm/components/Button.js +9 -0
  19. package/dist/esm/components/Card.js +17 -0
  20. package/dist/esm/components/Hint.js +19 -0
  21. package/dist/esm/components/Input.js +72 -0
  22. package/dist/esm/components/Modal.js +23 -0
  23. package/dist/esm/components/SearchInput.js +68 -0
  24. package/dist/esm/components/Select.js +96 -0
  25. package/dist/esm/components/Snackbar.js +16 -0
  26. package/dist/esm/components/Table.js +13 -0
  27. package/dist/esm/components/Tag.js +16 -0
  28. package/dist/esm/components/TextArea.js +79 -0
  29. package/dist/esm/components/Toggle.js +16 -0
  30. package/dist/esm/hooks/useDebouncedState.js +14 -0
  31. package/dist/esm/index.js +12 -0
  32. package/dist/types/components/Badge.d.ts +12 -0
  33. package/dist/types/components/Button.d.ts +8 -0
  34. package/dist/types/components/Card.d.ts +6 -0
  35. package/dist/types/components/Hint.d.ts +14 -0
  36. package/dist/types/components/Input.d.ts +34 -0
  37. package/dist/types/components/Modal.d.ts +8 -0
  38. package/dist/types/components/SearchInput.d.ts +11 -0
  39. package/dist/types/components/Select.d.ts +28 -0
  40. package/dist/types/components/Snackbar.d.ts +9 -0
  41. package/dist/types/components/Table.d.ts +13 -0
  42. package/dist/types/components/Tag.d.ts +8 -0
  43. package/dist/types/components/TextArea.d.ts +24 -0
  44. package/dist/types/components/Toggle.d.ts +2 -0
  45. package/{src/components/index.ts → dist/types/components/index.d.ts} +1 -0
  46. package/dist/types/docs/badge-anchor.stories.d.ts +29 -0
  47. package/dist/types/docs/badge.stories.d.ts +27 -0
  48. package/dist/types/docs/button.stories.d.ts +30 -0
  49. package/dist/types/docs/card.stories.d.ts +10 -0
  50. package/dist/types/docs/hint.stories.d.ts +27 -0
  51. package/dist/types/docs/input-custom.stories.d.ts +33 -0
  52. package/dist/types/docs/input.stories.d.ts +33 -0
  53. package/dist/types/docs/modal.stories.d.ts +10 -0
  54. package/dist/types/docs/select-grouped.stories.d.ts +32 -0
  55. package/dist/types/docs/select.stories.d.ts +32 -0
  56. package/dist/types/docs/snackbar.stories.d.ts +21 -0
  57. package/dist/types/docs/table.stories.d.ts +10 -0
  58. package/dist/types/docs/tag.stories.d.ts +21 -0
  59. package/dist/types/docs/text-area.stories.d.ts +39 -0
  60. package/dist/types/docs/toggle.stories.d.ts +10 -0
  61. package/dist/types/docs/utils.d.ts +1 -0
  62. package/dist/types/hooks/useDebouncedState.d.ts +2 -0
  63. package/package.json +19 -14
  64. package/src/components/Badge.tsx +0 -45
  65. package/src/components/Button.tsx +0 -19
  66. package/src/components/Card.tsx +0 -18
  67. package/src/components/Hint.tsx +0 -31
  68. package/src/components/Input.tsx +0 -110
  69. package/src/components/Modal.tsx +0 -24
  70. package/src/components/SearchInput.tsx +0 -86
  71. package/src/components/Select.tsx +0 -170
  72. package/src/components/Snackbar.tsx +0 -26
  73. package/src/components/Tag.tsx +0 -19
  74. package/src/components/TextArea.tsx +0 -121
  75. package/src/components/Toggle.tsx +0 -25
  76. package/src/docs/badge-anchor.stories.tsx +0 -42
  77. package/src/docs/badge.stories.tsx +0 -31
  78. package/src/docs/button.stories.tsx +0 -37
  79. package/src/docs/card.stories.tsx +0 -29
  80. package/src/docs/hint.stories.tsx +0 -32
  81. package/src/docs/input-custom.stories.tsx +0 -45
  82. package/src/docs/input.stories.tsx +0 -40
  83. package/src/docs/modal.stories.tsx +0 -48
  84. package/src/docs/select-grouped.stories.tsx +0 -79
  85. package/src/docs/select.stories.tsx +0 -70
  86. package/src/docs/snackbar.stories.tsx +0 -31
  87. package/src/docs/tag.stories.tsx +0 -37
  88. package/src/docs/text-area.stories.tsx +0 -50
  89. package/src/docs/toggle.stories.tsx +0 -18
  90. package/src/docs/utils.ts +0 -8
  91. package/src/hooks/useDebouncedState.ts +0 -24
  92. /package/{src/hooks/index.ts → dist/types/hooks/index.d.ts} +0 -0
  93. /package/{src/index.ts → dist/types/index.d.ts} +0 -0
@@ -0,0 +1,29 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ component: JSX.Element;
5
+ args: {
6
+ value: number;
7
+ intent: string;
8
+ };
9
+ argTypes: {
10
+ intent: {
11
+ options: string[];
12
+ control: {
13
+ type: string;
14
+ };
15
+ };
16
+ value: {
17
+ control: {
18
+ type: string;
19
+ };
20
+ min: number;
21
+ max: number;
22
+ };
23
+ };
24
+ };
25
+ export default _default;
26
+ export declare const Base: {
27
+ render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
28
+ args: {};
29
+ };
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ component: JSX.Element;
5
+ args: {
6
+ value: string;
7
+ intent: string;
8
+ };
9
+ argTypes: {
10
+ intent: {
11
+ options: string[];
12
+ control: {
13
+ type: string;
14
+ };
15
+ };
16
+ value: {
17
+ control: {
18
+ type: string;
19
+ };
20
+ };
21
+ };
22
+ };
23
+ export default _default;
24
+ export declare const Base: {
25
+ render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
26
+ args: {};
27
+ };
@@ -0,0 +1,30 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ component: JSX.Element;
5
+ argTypes: {
6
+ intent: {
7
+ options: string[];
8
+ control: {
9
+ type: string;
10
+ };
11
+ };
12
+ variant: {
13
+ options: string[];
14
+ control: {
15
+ type: string;
16
+ };
17
+ };
18
+ size: {
19
+ options: string[];
20
+ control: {
21
+ type: string;
22
+ };
23
+ };
24
+ };
25
+ };
26
+ export default _default;
27
+ export declare const Base: {
28
+ render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
29
+ args: {};
30
+ };
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ component: JSX.Element;
5
+ };
6
+ export default _default;
7
+ export declare const Base: {
8
+ render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
9
+ args: {};
10
+ };
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ component: JSX.Element;
5
+ args: {
6
+ intent: string;
7
+ description: string;
8
+ };
9
+ argTypes: {
10
+ intent: {
11
+ options: string[];
12
+ control: {
13
+ type: string;
14
+ };
15
+ };
16
+ description: {
17
+ control: {
18
+ type: string;
19
+ };
20
+ };
21
+ };
22
+ };
23
+ export default _default;
24
+ export declare const Base: {
25
+ render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
26
+ args: {};
27
+ };
@@ -0,0 +1,33 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ component: JSX.Element;
5
+ args: {
6
+ label: string;
7
+ placeholder: string;
8
+ intent: string;
9
+ };
10
+ argTypes: {
11
+ intent: {
12
+ options: string[];
13
+ control: {
14
+ type: string;
15
+ };
16
+ };
17
+ label: {
18
+ control: {
19
+ type: string;
20
+ };
21
+ };
22
+ placeholder: {
23
+ control: {
24
+ type: string;
25
+ };
26
+ };
27
+ };
28
+ };
29
+ export default _default;
30
+ export declare const Base: {
31
+ render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
32
+ args: {};
33
+ };
@@ -0,0 +1,33 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ component: JSX.Element;
5
+ args: {
6
+ label: string;
7
+ placeholder: string;
8
+ intent: string;
9
+ };
10
+ argTypes: {
11
+ intent: {
12
+ options: string[];
13
+ control: {
14
+ type: string;
15
+ };
16
+ };
17
+ label: {
18
+ control: {
19
+ type: string;
20
+ };
21
+ };
22
+ placeholder: {
23
+ control: {
24
+ type: string;
25
+ };
26
+ };
27
+ };
28
+ };
29
+ export default _default;
30
+ export declare const Base: {
31
+ render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
32
+ args: {};
33
+ };
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ component: JSX.Element;
5
+ };
6
+ export default _default;
7
+ export declare const Base: {
8
+ render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
9
+ args: {};
10
+ };
@@ -0,0 +1,32 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ component: JSX.Element;
5
+ argTypes: {
6
+ variant: {
7
+ options: string[];
8
+ control: {
9
+ type: string;
10
+ };
11
+ };
12
+ label: {
13
+ control: {
14
+ type: string;
15
+ };
16
+ };
17
+ placeholderSearchInput: {
18
+ control: {
19
+ type: string;
20
+ };
21
+ };
22
+ };
23
+ };
24
+ export default _default;
25
+ export declare const Base: {
26
+ render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
27
+ args: {
28
+ variant: string;
29
+ label: string;
30
+ placeholderSearchInput: string;
31
+ };
32
+ };
@@ -0,0 +1,32 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ component: JSX.Element;
5
+ argTypes: {
6
+ variant: {
7
+ options: string[];
8
+ control: {
9
+ type: string;
10
+ };
11
+ };
12
+ label: {
13
+ control: {
14
+ type: string;
15
+ };
16
+ };
17
+ placeholderSearchInput: {
18
+ control: {
19
+ type: string;
20
+ };
21
+ };
22
+ };
23
+ };
24
+ export default _default;
25
+ export declare const Base: {
26
+ render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
27
+ args: {
28
+ variant: string;
29
+ label: string;
30
+ placeholderSearchInput: string;
31
+ };
32
+ };
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ component: JSX.Element;
5
+ args: {
6
+ intent: string;
7
+ };
8
+ argTypes: {
9
+ intent: {
10
+ options: string[];
11
+ control: {
12
+ type: string;
13
+ };
14
+ };
15
+ };
16
+ };
17
+ export default _default;
18
+ export declare const Base: {
19
+ render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
20
+ args: {};
21
+ };
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ component: JSX.Element;
5
+ };
6
+ export default _default;
7
+ export declare const Base: {
8
+ render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
9
+ args: {};
10
+ };
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ component: JSX.Element;
5
+ args: {
6
+ intent: string;
7
+ };
8
+ argTypes: {
9
+ intent: {
10
+ options: string[];
11
+ control: {
12
+ type: string;
13
+ };
14
+ };
15
+ };
16
+ };
17
+ export default _default;
18
+ export declare const Base: {
19
+ render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
20
+ args: {};
21
+ };
@@ -0,0 +1,39 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ component: JSX.Element;
5
+ args: {
6
+ rows: number;
7
+ intent: string;
8
+ label: string;
9
+ placeholder: string;
10
+ };
11
+ argTypes: {
12
+ intent: {
13
+ options: string[];
14
+ control: {
15
+ type: string;
16
+ };
17
+ };
18
+ rows: {
19
+ control: {
20
+ type: string;
21
+ };
22
+ };
23
+ label: {
24
+ control: {
25
+ type: string;
26
+ };
27
+ };
28
+ placeholder: {
29
+ control: {
30
+ type: string;
31
+ };
32
+ };
33
+ };
34
+ };
35
+ export default _default;
36
+ export declare const Base: {
37
+ render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
38
+ args: {};
39
+ };
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ component: JSX.Element;
5
+ };
6
+ export default _default;
7
+ export declare const Base: {
8
+ render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
9
+ args: {};
10
+ };
@@ -0,0 +1 @@
1
+ export declare const defaultIntents: string[];
@@ -0,0 +1,2 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ export declare function useDebouncedState<S>(initialState: S | (() => S), timeoutCallback?: (state: S) => void, timeoutMs?: number): [S, Dispatch<SetStateAction<S>>];
package/package.json CHANGED
@@ -1,33 +1,38 @@
1
1
  {
2
2
  "name": "@tecsinapse/cortex-react",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "React components based in @tecsinapse/cortex-core",
5
- "author": "ryancarloscorrea <ryancarlos38@gmail.com>",
6
- "homepage": "https://github.com/tecsinapse/design-system#readme",
7
5
  "license": "MIT",
8
- "main": "src/index.ts",
6
+ "main": "dist/esm/index.js",
7
+ "module": "dist/esm/index.js",
8
+ "types": "dist/types/index.d.ts",
9
9
  "files": [
10
- "src"
10
+ "dist"
11
11
  ],
12
- "repository": {
13
- "type": "git",
14
- "url": "git+https://github.com/tecsinapse/design-system.git"
15
- },
16
12
  "scripts": {
17
13
  "dev": "rollup --config --watch",
18
14
  "dev:dts": "tsc --project tsconfig.build.json --watch",
19
15
  "build:es": "rollup --config",
20
16
  "build:dts": "tsc --project tsconfig.build.json"
21
17
  },
18
+ "dependencies": {
19
+ "@tecsinapse/cortex-core": "0.2.0",
20
+ "clsx": "*",
21
+ "react-icons": "^5.2.1"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "directory": "packages/cortex-react",
26
+ "url": "git+https://github.com/tecsinapse/design-system.git"
27
+ },
22
28
  "bugs": {
23
29
  "url": "https://github.com/tecsinapse/design-system/issues"
24
30
  },
31
+ "homepage": "https://tecsinapse.github.io/design-system/",
25
32
  "peerDependencies": {
33
+ "react": ">=18.0.0",
34
+ "react-dom": ">=18.0.0",
26
35
  "tailwind": ">=3.3.0"
27
36
  },
28
- "dependencies": {
29
- "@tecsinapse/cortex-core": "0.1.10",
30
- "clsx": "*",
31
- "react-icons": "^5.2.1"
32
- }
37
+ "gitHead": "433888823a08834db26af7fe5209da1bac509699"
33
38
  }
@@ -1,45 +0,0 @@
1
- import React, { forwardRef, HTMLProps } from 'react';
2
- import { badge, BadgeVariants, containerBadge } from '@tecsinapse/cortex-core';
3
-
4
- interface BadgeProps {
5
- value: string | number;
6
- variants?: BadgeVariants;
7
- }
8
-
9
- interface BadgeAnchorProps extends BadgeProps {
10
- children: JSX.Element;
11
- }
12
-
13
- export const Badge = forwardRef<
14
- HTMLDivElement,
15
- BadgeProps & Omit<HTMLProps<HTMLDivElement>, 'className'>
16
- >((props, ref) => {
17
- const { value, variants, ...rest } = props;
18
- return (
19
- <div
20
- ref={ref}
21
- className={badge({
22
- className: `relative ${variants?.className}`,
23
- intent: variants?.intent,
24
- })}
25
- {...rest}
26
- >
27
- {value}
28
- </div>
29
- );
30
- });
31
-
32
- export const BadgeAnchor = forwardRef<
33
- HTMLDivElement,
34
- BadgeAnchorProps & Omit<HTMLProps<HTMLDivElement>, 'className'>
35
- >((props, ref) => {
36
- const { value, variants, children, ...rest } = props;
37
- return (
38
- <div className={containerBadge()}>
39
- {children}
40
- <div ref={ref} className={badge(variants)} {...rest}>
41
- {value}
42
- </div>
43
- </div>
44
- );
45
- });
@@ -1,19 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import { button, ButtonVariants } from '@tecsinapse/cortex-core';
3
-
4
- interface ButtonProps {
5
- variants?: ButtonVariants;
6
- children?: JSX.Element;
7
- }
8
-
9
- export const Button = forwardRef<
10
- HTMLButtonElement,
11
- ButtonProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'className'>
12
- >((props, ref) => {
13
- const { variants, children, ...rest } = props;
14
- return (
15
- <button className={button(variants)} ref={ref} {...rest}>
16
- {children}
17
- </button>
18
- );
19
- });
@@ -1,18 +0,0 @@
1
- import React, { forwardRef, HTMLProps } from 'react'
2
- import { card } from '@tecsinapse/cortex-core'
3
-
4
- interface CardProps {
5
- children: JSX.Element
6
- }
7
- export const Card = forwardRef<HTMLDivElement, CardProps & HTMLProps<HTMLDivElement>>((props, ref) => {
8
- const { children, className, ...rest } = props
9
- return (
10
- <div
11
- className={card({ className })}
12
- ref={ref}
13
- {...rest}
14
- >
15
- {children}
16
- </div>
17
- )
18
- })
@@ -1,31 +0,0 @@
1
- import React, { forwardRef, HTMLProps } from 'react'
2
- import { hint, HintVariants } from '@tecsinapse/cortex-core'
3
-
4
- interface HintProps {
5
- children?: never
6
- description: string
7
- variants?: HintVariants
8
- }
9
-
10
- interface HintPropsWithChildrenProps {
11
- children: JSX.Element
12
- description?: never
13
- variants?: HintVariants
14
- }
15
-
16
- type HintPropsUnion = HintProps | HintPropsWithChildrenProps
17
-
18
- export const Hint = forwardRef<HTMLDivElement, HintPropsUnion & Omit<HTMLProps<HTMLDivElement>, 'className'>>(
19
- (props, ref) => {
20
- const { description, children, variants } = props
21
- return (
22
- <div
23
- className={hint(variants)}
24
- ref={ref}
25
- >
26
- {description ? <p>{description}</p> : <></>}
27
- {children}
28
- </div>
29
- )
30
- }
31
- )
@@ -1,110 +0,0 @@
1
- import React from 'react';
2
- import {
3
- input,
4
- InputBaseVariants,
5
- inputBox,
6
- labelStyle,
7
- } from '@tecsinapse/cortex-core';
8
- import { clsx } from 'clsx';
9
-
10
- const getValidChildren = (children: React.ReactNode) => {
11
- return React.Children.toArray(children).filter(el =>
12
- React.isValidElement(el)
13
- ) as React.ReactElement[];
14
- };
15
-
16
- interface InputPropsBase {
17
- variants?: InputBaseVariants;
18
- label?: string;
19
- }
20
-
21
- export interface InputProps
22
- extends React.InputHTMLAttributes<HTMLInputElement>,
23
- InputPropsBase {}
24
-
25
- export const Box = React.forwardRef<HTMLInputElement, InputProps>(
26
- ({ id, name, variants, label, placeholder, className, ...rest }, ref) => {
27
- return (
28
- <div className={'flex w-full flex-col'}>
29
- <input
30
- id={id ?? name}
31
- name={name}
32
- placeholder={placeholder ?? ' '}
33
- className={clsx(inputBox(placeholder, label, className))}
34
- {...rest}
35
- ref={ref}
36
- />
37
- <label
38
- htmlFor={id ?? name}
39
- className={labelStyle({ intent: variants?.intent, placeholder })}
40
- >
41
- {label}
42
- </label>
43
- </div>
44
- );
45
- }
46
- );
47
-
48
- type DivBaseProps = React.HTMLAttributes<HTMLDivElement>;
49
- type InputFaceProps = DivBaseProps & Pick<InputPropsBase, 'variants'>;
50
-
51
- export const Face = React.forwardRef<HTMLDivElement, InputFaceProps>(
52
- ({ children, variants, className, ...rest }, ref) => {
53
- const clones = getValidChildren(children).map(el => {
54
- return React.cloneElement(el, { ...el.props, variants });
55
- });
56
- return (
57
- <div
58
- {...rest}
59
- className={clsx(input(variants), className)}
60
- id={'input-face'}
61
- ref={ref}
62
- >
63
- {clones}
64
- </div>
65
- );
66
- }
67
- );
68
-
69
- export const Root = React.forwardRef<HTMLInputElement, InputProps>(
70
- ({ variants, className, ...rest }, ref) => {
71
- return (
72
- <Face variants={variants} className={className}>
73
- <Box {...rest} ref={ref} />
74
- </Face>
75
- );
76
- }
77
- );
78
-
79
- type InputElementsProps = DivBaseProps & {
80
- children: React.ReactNode;
81
- className?: string;
82
- };
83
-
84
- export const Left = React.forwardRef<HTMLDivElement, InputElementsProps>(
85
- ({ children, className, ...rest }, ref) => {
86
- return (
87
- <div className={clsx(className, 'mr-2.5')} {...rest} ref={ref}>
88
- {children}
89
- </div>
90
- );
91
- }
92
- );
93
-
94
- export const Right = React.forwardRef<HTMLDivElement, InputElementsProps>(
95
- ({ children, className, ...rest }, ref) => {
96
- return (
97
- <div className={clsx(className, 'ml-2.5')} {...rest} ref={ref}>
98
- {children}
99
- </div>
100
- );
101
- }
102
- );
103
-
104
- export const Input = {
105
- Root,
106
- Face,
107
- Box,
108
- Left,
109
- Right,
110
- };