@dgshahr/ui-kit 0.0.1

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 (89) hide show
  1. package/dist/Accordion/AccordionGroup.d.ts +8 -0
  2. package/dist/Accordion/AccordionGroup.d.ts.map +1 -0
  3. package/dist/Accordion/AccordionItem.d.ts +10 -0
  4. package/dist/Accordion/AccordionItem.d.ts.map +1 -0
  5. package/dist/Accordion/context.d.ts +8 -0
  6. package/dist/Accordion/context.d.ts.map +1 -0
  7. package/dist/Accordion/index.cjs +11 -0
  8. package/dist/Accordion/index.d.ts +3 -0
  9. package/dist/Accordion/index.d.ts.map +1 -0
  10. package/dist/Accordion/index.js +2 -0
  11. package/dist/AccordionItem-BBbE__nk.js +103 -0
  12. package/dist/AccordionItem-BOXOB5GK.cjs +106 -0
  13. package/dist/Alert/index.cjs +242 -0
  14. package/dist/Alert/index.d.ts +17 -0
  15. package/dist/Alert/index.d.ts.map +1 -0
  16. package/dist/Alert/index.js +240 -0
  17. package/dist/Alert/variants.d.ts +14 -0
  18. package/dist/Alert/variants.d.ts.map +1 -0
  19. package/dist/ArrowLeft2-BURhvXT2.js +22 -0
  20. package/dist/ArrowLeft2-iZ0Au6Fn.cjs +24 -0
  21. package/dist/ArrowRight2-DCxJPvNC.js +25 -0
  22. package/dist/ArrowRight2-DTuru_sP.cjs +27 -0
  23. package/dist/Badge/index.cjs +72 -0
  24. package/dist/Badge/index.d.ts +21 -0
  25. package/dist/Badge/index.d.ts.map +1 -0
  26. package/dist/Badge/index.js +70 -0
  27. package/dist/Breadcrumb/index.cjs +34 -0
  28. package/dist/Breadcrumb/index.d.ts +13 -0
  29. package/dist/Breadcrumb/index.d.ts.map +1 -0
  30. package/dist/Breadcrumb/index.js +32 -0
  31. package/dist/Button/index.cjs +119 -0
  32. package/dist/Button/index.d.ts +13 -0
  33. package/dist/Button/index.d.ts.map +1 -0
  34. package/dist/Button/index.js +117 -0
  35. package/dist/Button/variants.d.ts +5 -0
  36. package/dist/Button/variants.d.ts.map +1 -0
  37. package/dist/Divider/index.cjs +25 -0
  38. package/dist/Divider/index.d.ts +9 -0
  39. package/dist/Divider/index.d.ts.map +1 -0
  40. package/dist/Divider/index.js +23 -0
  41. package/dist/Form/Checkbox/index.cjs +72 -0
  42. package/dist/Form/Checkbox/index.d.ts +8 -0
  43. package/dist/Form/Checkbox/index.d.ts.map +1 -0
  44. package/dist/Form/Checkbox/index.js +70 -0
  45. package/dist/Form/Input/index.cjs +182 -0
  46. package/dist/Form/Input/index.d.ts +12 -0
  47. package/dist/Form/Input/index.d.ts.map +1 -0
  48. package/dist/Form/Input/index.js +180 -0
  49. package/dist/Form/RadioButton/index.cjs +22 -0
  50. package/dist/Form/RadioButton/index.d.ts +6 -0
  51. package/dist/Form/RadioButton/index.d.ts.map +1 -0
  52. package/dist/Form/RadioButton/index.js +20 -0
  53. package/dist/Form/Textarea/index.cjs +27 -0
  54. package/dist/Form/Textarea/index.d.ts +7 -0
  55. package/dist/Form/Textarea/index.d.ts.map +1 -0
  56. package/dist/Form/Textarea/index.js +25 -0
  57. package/dist/Pagination/index.cjs +119 -0
  58. package/dist/Pagination/index.d.ts +13 -0
  59. package/dist/Pagination/index.d.ts.map +1 -0
  60. package/dist/Pagination/index.js +117 -0
  61. package/dist/Pagination/utils.d.ts +8 -0
  62. package/dist/Pagination/utils.d.ts.map +1 -0
  63. package/dist/SelectableInputWrapper-D2aYQb9J.cjs +71 -0
  64. package/dist/SelectableInputWrapper-DAj8v1nv.js +69 -0
  65. package/dist/Slide-6SD8mElS.js +198 -0
  66. package/dist/Slide-BiCQh7AV.cjs +201 -0
  67. package/dist/Slider/NavigationDot.d.ts +11 -0
  68. package/dist/Slider/NavigationDot.d.ts.map +1 -0
  69. package/dist/Slider/Slide.d.ts +7 -0
  70. package/dist/Slider/Slide.d.ts.map +1 -0
  71. package/dist/Slider/Slider.d.ts +25 -0
  72. package/dist/Slider/Slider.d.ts.map +1 -0
  73. package/dist/Slider/context.d.ts +8 -0
  74. package/dist/Slider/context.d.ts.map +1 -0
  75. package/dist/Slider/index.cjs +11 -0
  76. package/dist/Slider/index.d.ts +3 -0
  77. package/dist/Slider/index.d.ts.map +1 -0
  78. package/dist/Slider/index.js +2 -0
  79. package/dist/TextFieldWrapper-C80myx6j.cjs +169 -0
  80. package/dist/TextFieldWrapper-D3oaEPmc.js +167 -0
  81. package/dist/assets/Button.css +1675 -0
  82. package/dist/assets/styles.css +1611 -0
  83. package/dist/clsx-BtxeOLZW.cjs +5 -0
  84. package/dist/clsx-ChV9xqsO.js +3 -0
  85. package/dist/index.cjs +34 -0
  86. package/dist/index.d.ts +13 -0
  87. package/dist/index.d.ts.map +1 -0
  88. package/dist/index.js +13 -0
  89. package/package.json +83 -0
@@ -0,0 +1,119 @@
1
+ 'use strict';
2
+
3
+ require('../assets/Button.css');const jsxRuntime = require('react/jsx-runtime');
4
+ const clsx = require('../clsx-BtxeOLZW.cjs');
5
+
6
+ const variantStyle = {
7
+ primary: {
8
+ primary: "bg-primary-500 active:bg-primary-600 hover:bg-primary-300 text-white border-transparent",
9
+ success: "bg-success-500 active:bg-success-600 hover:bg-success-300 text-white border-transparent",
10
+ error: "bg-error-500 active:bg-error-600 hover:bg-error-300 text-white border-transparent",
11
+ warning: "bg-warning-500 active:bg-warning-600 hover:bg-warning-300 text-gray-900 border-transparent",
12
+ gray: "bg-gray-500 active:bg-gray-600 hover:bg-gray-300 text-white border-transparent"
13
+ },
14
+ secondary: {
15
+ primary: "text-primary-500 bg-gray-100 active:bg-gray-200 hover:bg-gray-50 disabled:bg-gray-100 border-transparent",
16
+ success: "text-gray-700 hover:text-gray-600 active:text-gray-800 bg-success-100 active:bg-success-200 hover:bg-success-50 disabled:bg-success-100 border-transparent",
17
+ error: "text-gray-700 hover:text-gray-600 active:text-gray-800 bg-error-100 active:bg-error-200 hover:bg-error-50 disabled:bg-error-100 border-transparent",
18
+ warning: "text-gray-700 hover:text-gray-600 active:text-gray-800 bg-warning-100 active:bg-warning-200 hover:bg-warning-50 disabled:bg-warning-100 border-transparent",
19
+ gray: "text-gray-700 hover:text-gray-600 active:text-gray-800 bg-gray-100 active:bg-gray-200 hover:bg-gray-50 disabled:bg-gray-100 border-transparent"
20
+ },
21
+ outline: {
22
+ primary: "text-primary-500 border-primary-300 hover:border-primary-200 active:border-primary-600 active:text-primary-600",
23
+ success: "text-success-600 hover:text-success-400 border-success-500 hover:border-success-400 active:border-success-600 active:text-success-800",
24
+ error: "text-error-600 hover:text-error-400 border-error-500 hover:border-error-400 active:border-error-600 active:text-error-800",
25
+ warning: "text-warning-600 hover:text-warning-400 border-warning-500 hover:border-warning-400 active:border-warning-600 active:text-warning-800",
26
+ gray: "text-gray-600 hover:text-gray-400 border-gray-500 hover:border-gray-400 active:border-gray-600 active:text-gray-800"
27
+ },
28
+ text: {
29
+ primary: "text-primary-500 hover:text-primary-300 border-transparent active:text-primary-700",
30
+ success: "text-success-700 hover:text-success-600 border-transparent active:text-success-800",
31
+ error: "text-error-700 hover:text-error-600 border-transparent active:text-error-800",
32
+ warning: "text-warning-700 hover:text-warning-600 border-transparent active:text-warning-800",
33
+ gray: "text-gray-700 hover:text-gray-600 border-transparent active:text-gray-800"
34
+ }
35
+ };
36
+ const sizeStyle = {
37
+ small: "button-small-icon py-2.5 px-4 font-button-small",
38
+ medium: "button-medium-icon py-3 px-5 font-button-medium",
39
+ large: "button-large-icon py-3 px-6 font-button-large"
40
+ };
41
+ const iconOnlyButtonSizeStyle = {
42
+ small: "button-small-icon p-[10px]",
43
+ medium: "button-medium-icon p-3",
44
+ large: "button-large-icon p-3"
45
+ };
46
+
47
+ const REMOVE_OPACITY_CLASS = "opacity-0";
48
+ function styleButton({
49
+ variant = "primary",
50
+ color = "primary",
51
+ isFullWidth,
52
+ className,
53
+ size = "medium",
54
+ children
55
+ }) {
56
+ const defaultClassName = "border relative rounded-lg min-w-max h-fit disabled:cursor-not-allowed transition-all duration-300 flex items-center disabled:opacity-40";
57
+ return [
58
+ defaultClassName,
59
+ isFullWidth ? "w-full justify-center" : "w-fit",
60
+ variantStyle[variant][color],
61
+ children ? sizeStyle[size] : iconOnlyButtonSizeStyle[size],
62
+ Number(className?.length) > 0 && className
63
+ ].slice().join(" ");
64
+ }
65
+ const Button = ({
66
+ variant = "primary",
67
+ color = "primary",
68
+ isFullWidth,
69
+ className,
70
+ size,
71
+ leftIcon,
72
+ rightIcon,
73
+ isLoading,
74
+ children,
75
+ ...props
76
+ }) => {
77
+ return /* @__PURE__ */ jsxRuntime.jsxs(
78
+ "button",
79
+ {
80
+ className: styleButton({
81
+ variant,
82
+ color,
83
+ isFullWidth,
84
+ className,
85
+ size,
86
+ children
87
+ }) + " rounded-lg",
88
+ ...props,
89
+ children: [
90
+ rightIcon && /* @__PURE__ */ jsxRuntime.jsx(
91
+ "span",
92
+ {
93
+ className: clsx.clsx(
94
+ "block icon-button",
95
+ { "ml-2": children },
96
+ { [REMOVE_OPACITY_CLASS]: isLoading }
97
+ ),
98
+ children: rightIcon
99
+ }
100
+ ),
101
+ children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx({ [REMOVE_OPACITY_CLASS]: isLoading }), children }),
102
+ isLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-0 left-0 w-full h-full flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "dot-flashing" }) }),
103
+ leftIcon && /* @__PURE__ */ jsxRuntime.jsx(
104
+ "span",
105
+ {
106
+ className: clsx.clsx(
107
+ "block icon-button",
108
+ { "mr-2": children },
109
+ { [REMOVE_OPACITY_CLASS]: isLoading }
110
+ ),
111
+ children: leftIcon
112
+ }
113
+ )
114
+ ]
115
+ }
116
+ );
117
+ };
118
+
119
+ module.exports = Button;
@@ -0,0 +1,13 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ export interface ButtonProps extends React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
3
+ variant?: 'primary' | 'secondary' | 'outline' | 'text';
4
+ color?: 'primary' | 'warning' | 'error' | 'success' | 'gray';
5
+ isFullWidth?: boolean;
6
+ size?: 'small' | 'medium' | 'large';
7
+ leftIcon?: JSX.Element;
8
+ rightIcon?: JSX.Element;
9
+ isLoading?: boolean;
10
+ }
11
+ declare const Button: FC<PropsWithChildren<ButtonProps>>;
12
+ export default Button;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAInD,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,iBAAiB,CAC7B,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAC7C,iBAAiB,CAClB;IACD,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC;IACvD,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IAC7D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AA0BD,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAwD9C,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,117 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { c as clsx } from '../clsx-ChV9xqsO.js';
3
+
4
+ import '../assets/Button.css';const variantStyle = {
5
+ primary: {
6
+ primary: "bg-primary-500 active:bg-primary-600 hover:bg-primary-300 text-white border-transparent",
7
+ success: "bg-success-500 active:bg-success-600 hover:bg-success-300 text-white border-transparent",
8
+ error: "bg-error-500 active:bg-error-600 hover:bg-error-300 text-white border-transparent",
9
+ warning: "bg-warning-500 active:bg-warning-600 hover:bg-warning-300 text-gray-900 border-transparent",
10
+ gray: "bg-gray-500 active:bg-gray-600 hover:bg-gray-300 text-white border-transparent"
11
+ },
12
+ secondary: {
13
+ primary: "text-primary-500 bg-gray-100 active:bg-gray-200 hover:bg-gray-50 disabled:bg-gray-100 border-transparent",
14
+ success: "text-gray-700 hover:text-gray-600 active:text-gray-800 bg-success-100 active:bg-success-200 hover:bg-success-50 disabled:bg-success-100 border-transparent",
15
+ error: "text-gray-700 hover:text-gray-600 active:text-gray-800 bg-error-100 active:bg-error-200 hover:bg-error-50 disabled:bg-error-100 border-transparent",
16
+ warning: "text-gray-700 hover:text-gray-600 active:text-gray-800 bg-warning-100 active:bg-warning-200 hover:bg-warning-50 disabled:bg-warning-100 border-transparent",
17
+ gray: "text-gray-700 hover:text-gray-600 active:text-gray-800 bg-gray-100 active:bg-gray-200 hover:bg-gray-50 disabled:bg-gray-100 border-transparent"
18
+ },
19
+ outline: {
20
+ primary: "text-primary-500 border-primary-300 hover:border-primary-200 active:border-primary-600 active:text-primary-600",
21
+ success: "text-success-600 hover:text-success-400 border-success-500 hover:border-success-400 active:border-success-600 active:text-success-800",
22
+ error: "text-error-600 hover:text-error-400 border-error-500 hover:border-error-400 active:border-error-600 active:text-error-800",
23
+ warning: "text-warning-600 hover:text-warning-400 border-warning-500 hover:border-warning-400 active:border-warning-600 active:text-warning-800",
24
+ gray: "text-gray-600 hover:text-gray-400 border-gray-500 hover:border-gray-400 active:border-gray-600 active:text-gray-800"
25
+ },
26
+ text: {
27
+ primary: "text-primary-500 hover:text-primary-300 border-transparent active:text-primary-700",
28
+ success: "text-success-700 hover:text-success-600 border-transparent active:text-success-800",
29
+ error: "text-error-700 hover:text-error-600 border-transparent active:text-error-800",
30
+ warning: "text-warning-700 hover:text-warning-600 border-transparent active:text-warning-800",
31
+ gray: "text-gray-700 hover:text-gray-600 border-transparent active:text-gray-800"
32
+ }
33
+ };
34
+ const sizeStyle = {
35
+ small: "button-small-icon py-2.5 px-4 font-button-small",
36
+ medium: "button-medium-icon py-3 px-5 font-button-medium",
37
+ large: "button-large-icon py-3 px-6 font-button-large"
38
+ };
39
+ const iconOnlyButtonSizeStyle = {
40
+ small: "button-small-icon p-[10px]",
41
+ medium: "button-medium-icon p-3",
42
+ large: "button-large-icon p-3"
43
+ };
44
+
45
+ const REMOVE_OPACITY_CLASS = "opacity-0";
46
+ function styleButton({
47
+ variant = "primary",
48
+ color = "primary",
49
+ isFullWidth,
50
+ className,
51
+ size = "medium",
52
+ children
53
+ }) {
54
+ const defaultClassName = "border relative rounded-lg min-w-max h-fit disabled:cursor-not-allowed transition-all duration-300 flex items-center disabled:opacity-40";
55
+ return [
56
+ defaultClassName,
57
+ isFullWidth ? "w-full justify-center" : "w-fit",
58
+ variantStyle[variant][color],
59
+ children ? sizeStyle[size] : iconOnlyButtonSizeStyle[size],
60
+ Number(className?.length) > 0 && className
61
+ ].slice().join(" ");
62
+ }
63
+ const Button = ({
64
+ variant = "primary",
65
+ color = "primary",
66
+ isFullWidth,
67
+ className,
68
+ size,
69
+ leftIcon,
70
+ rightIcon,
71
+ isLoading,
72
+ children,
73
+ ...props
74
+ }) => {
75
+ return /* @__PURE__ */ jsxs(
76
+ "button",
77
+ {
78
+ className: styleButton({
79
+ variant,
80
+ color,
81
+ isFullWidth,
82
+ className,
83
+ size,
84
+ children
85
+ }) + " rounded-lg",
86
+ ...props,
87
+ children: [
88
+ rightIcon && /* @__PURE__ */ jsx(
89
+ "span",
90
+ {
91
+ className: clsx(
92
+ "block icon-button",
93
+ { "ml-2": children },
94
+ { [REMOVE_OPACITY_CLASS]: isLoading }
95
+ ),
96
+ children: rightIcon
97
+ }
98
+ ),
99
+ children && /* @__PURE__ */ jsx("div", { className: clsx({ [REMOVE_OPACITY_CLASS]: isLoading }), children }),
100
+ isLoading && /* @__PURE__ */ jsx("div", { className: "absolute top-0 left-0 w-full h-full flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "dot-flashing" }) }),
101
+ leftIcon && /* @__PURE__ */ jsx(
102
+ "span",
103
+ {
104
+ className: clsx(
105
+ "block icon-button",
106
+ { "mr-2": children },
107
+ { [REMOVE_OPACITY_CLASS]: isLoading }
108
+ ),
109
+ children: leftIcon
110
+ }
111
+ )
112
+ ]
113
+ }
114
+ );
115
+ };
116
+
117
+ export { Button as default };
@@ -0,0 +1,5 @@
1
+ import { ButtonProps } from '.';
2
+ export declare const variantStyle: Record<Required<ButtonProps>['variant'], Record<Required<ButtonProps>['color'], string>>;
3
+ export declare const sizeStyle: Record<Required<ButtonProps>['size'], string>;
4
+ export declare const iconOnlyButtonSizeStyle: Record<Required<ButtonProps>['size'], string>;
5
+ //# sourceMappingURL=variants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../src/components/Button/variants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC;AAErC,eAAO,MAAM,YAAY,EAAE,MAAM,CAC/B,QAAQ,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,EAChC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAyC/C,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAInE,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAIjF,CAAC"}
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ require('../assets/styles.css');const jsxRuntime = require('react/jsx-runtime');
4
+ ;/* empty css */
5
+
6
+ function styleDivider({ type, size = "thin", color = "gray", className }) {
7
+ const typeClassName = type === "horizontal" ? "w-full" : "h-full";
8
+ const sizeClassName = {
9
+ horizontal: {
10
+ thin: "h-[1px]",
11
+ thick: "h-1"
12
+ },
13
+ vertical: {
14
+ thin: "w-[1px]",
15
+ thick: "w-1"
16
+ }
17
+ };
18
+ const colorClassName = color === "gray" ? "bg-gray-200" : "bg-gray-100";
19
+ return [typeClassName, sizeClassName[type][size], colorClassName, className ?? ""].slice().join(" ");
20
+ }
21
+ const Divider = (props) => {
22
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styleDivider(props) });
23
+ };
24
+
25
+ module.exports = Divider;
@@ -0,0 +1,9 @@
1
+ interface DividerProps {
2
+ type: 'horizontal' | 'vertical';
3
+ size?: 'thin' | 'thick';
4
+ color?: 'white' | 'gray';
5
+ className?: string;
6
+ }
7
+ declare const Divider: (props: DividerProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default Divider;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/Divider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,UAAU,YAAY;IACpB,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA0BD,QAAA,MAAM,OAAO,UAAW,YAAY,4CAEnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import '../assets/styles.css';/* empty css */
3
+
4
+ function styleDivider({ type, size = "thin", color = "gray", className }) {
5
+ const typeClassName = type === "horizontal" ? "w-full" : "h-full";
6
+ const sizeClassName = {
7
+ horizontal: {
8
+ thin: "h-[1px]",
9
+ thick: "h-1"
10
+ },
11
+ vertical: {
12
+ thin: "w-[1px]",
13
+ thick: "w-1"
14
+ }
15
+ };
16
+ const colorClassName = color === "gray" ? "bg-gray-200" : "bg-gray-100";
17
+ return [typeClassName, sizeClassName[type][size], colorClassName, className ?? ""].slice().join(" ");
18
+ }
19
+ const Divider = (props) => {
20
+ return /* @__PURE__ */ jsx("div", { className: styleDivider(props) });
21
+ };
22
+
23
+ export { Divider as default };
@@ -0,0 +1,72 @@
1
+ 'use strict';
2
+
3
+ const jsxRuntime = require('react/jsx-runtime');
4
+ const clsx = require('../../clsx-BtxeOLZW.cjs');
5
+ const SelectableInputWrapper = require('../../SelectableInputWrapper-D2aYQb9J.cjs');
6
+
7
+ const Minus4Icon = (props) => /* @__PURE__ */ jsxRuntime.jsx(
8
+ "svg",
9
+ {
10
+ xmlns: "http://www.w3.org/2000/svg",
11
+ width: "1em",
12
+ height: "1em",
13
+ fill: "none",
14
+ viewBox: "0 0 24 24",
15
+ ...props,
16
+ children: /* @__PURE__ */ jsxRuntime.jsx(
17
+ "path",
18
+ {
19
+ fill: "currentColor",
20
+ d: "M6 11a.75.75 0 0 0 0 1.5zm12 1.5a.75.75 0 0 0 0-1.5zm-12 0h12V11H6z"
21
+ }
22
+ )
23
+ }
24
+ );
25
+
26
+ const CheckmarkIcon = (props) => /* @__PURE__ */ jsxRuntime.jsx(
27
+ "svg",
28
+ {
29
+ xmlns: "http://www.w3.org/2000/svg",
30
+ width: "1em",
31
+ height: "1em",
32
+ fill: "none",
33
+ viewBox: "0 0 24 24",
34
+ ...props,
35
+ children: /* @__PURE__ */ jsxRuntime.jsx(
36
+ "path",
37
+ {
38
+ fill: "currentColor",
39
+ d: "M9.613 17.57a.75.75 0 0 1-.53-.22l-4.375-4.376a.75.75 0 0 1 1.06-1.06l3.845 3.844 9.1-9.1a.75.75 0 1 1 1.06 1.061l-9.635 9.63a.75.75 0 0 1-.525.22"
40
+ }
41
+ )
42
+ }
43
+ );
44
+
45
+ const Checkbox = (props) => {
46
+ const { className, isIndeterminate, ...rest } = props;
47
+ return /* @__PURE__ */ jsxRuntime.jsx(SelectableInputWrapper.SelectableInputWrapper, { ...rest, children: ({ inputClassName, checkedInputClassName }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
48
+ /* @__PURE__ */ jsxRuntime.jsx(
49
+ "input",
50
+ {
51
+ type: "checkbox",
52
+ className: clsx.clsx("rounded", inputClassName, className),
53
+ ...rest
54
+ }
55
+ ),
56
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: checkedInputClassName, children: isIndeterminate ? /* @__PURE__ */ jsxRuntime.jsx(
57
+ Minus4Icon,
58
+ {
59
+ width: 16,
60
+ height: 16
61
+ }
62
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
63
+ CheckmarkIcon,
64
+ {
65
+ width: 16,
66
+ height: 16
67
+ }
68
+ ) })
69
+ ] }) });
70
+ };
71
+
72
+ module.exports = Checkbox;
@@ -0,0 +1,8 @@
1
+ import { SelectableInputBaseUnionProps } from '../Wrappers/SelectableInputWrapper/SelectableInputWrapper';
2
+ import { DetailedHTMLProps, InputHTMLAttributes } from 'react';
3
+ type CheckboxProps = SelectableInputBaseUnionProps & Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, 'type'> & {
4
+ isIndeterminate?: boolean;
5
+ };
6
+ declare const Checkbox: (props: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default Checkbox;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Form/Checkbox/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2DAA2D,CAAC;AAC/G,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAKpE,KAAK,aAAa,GAAG,6BAA6B,GAChD,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC,GAAG;IACzF,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEJ,QAAA,MAAM,QAAQ,UAAW,aAAa,4CA4BrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,70 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { c as clsx } from '../../clsx-ChV9xqsO.js';
3
+ import { S as SelectableInputWrapper } from '../../SelectableInputWrapper-DAj8v1nv.js';
4
+
5
+ const Minus4Icon = (props) => /* @__PURE__ */ jsx(
6
+ "svg",
7
+ {
8
+ xmlns: "http://www.w3.org/2000/svg",
9
+ width: "1em",
10
+ height: "1em",
11
+ fill: "none",
12
+ viewBox: "0 0 24 24",
13
+ ...props,
14
+ children: /* @__PURE__ */ jsx(
15
+ "path",
16
+ {
17
+ fill: "currentColor",
18
+ d: "M6 11a.75.75 0 0 0 0 1.5zm12 1.5a.75.75 0 0 0 0-1.5zm-12 0h12V11H6z"
19
+ }
20
+ )
21
+ }
22
+ );
23
+
24
+ const CheckmarkIcon = (props) => /* @__PURE__ */ jsx(
25
+ "svg",
26
+ {
27
+ xmlns: "http://www.w3.org/2000/svg",
28
+ width: "1em",
29
+ height: "1em",
30
+ fill: "none",
31
+ viewBox: "0 0 24 24",
32
+ ...props,
33
+ children: /* @__PURE__ */ jsx(
34
+ "path",
35
+ {
36
+ fill: "currentColor",
37
+ d: "M9.613 17.57a.75.75 0 0 1-.53-.22l-4.375-4.376a.75.75 0 0 1 1.06-1.06l3.845 3.844 9.1-9.1a.75.75 0 1 1 1.06 1.061l-9.635 9.63a.75.75 0 0 1-.525.22"
38
+ }
39
+ )
40
+ }
41
+ );
42
+
43
+ const Checkbox = (props) => {
44
+ const { className, isIndeterminate, ...rest } = props;
45
+ return /* @__PURE__ */ jsx(SelectableInputWrapper, { ...rest, children: ({ inputClassName, checkedInputClassName }) => /* @__PURE__ */ jsxs(Fragment, { children: [
46
+ /* @__PURE__ */ jsx(
47
+ "input",
48
+ {
49
+ type: "checkbox",
50
+ className: clsx("rounded", inputClassName, className),
51
+ ...rest
52
+ }
53
+ ),
54
+ /* @__PURE__ */ jsx("div", { className: checkedInputClassName, children: isIndeterminate ? /* @__PURE__ */ jsx(
55
+ Minus4Icon,
56
+ {
57
+ width: 16,
58
+ height: 16
59
+ }
60
+ ) : /* @__PURE__ */ jsx(
61
+ CheckmarkIcon,
62
+ {
63
+ width: 16,
64
+ height: 16
65
+ }
66
+ ) })
67
+ ] }) });
68
+ };
69
+
70
+ export { Checkbox as default };
@@ -0,0 +1,182 @@
1
+ 'use strict';
2
+
3
+ const jsxRuntime = require('react/jsx-runtime');
4
+ const clsx = require('../../clsx-BtxeOLZW.cjs');
5
+ const react = require('react');
6
+ const TextFieldWrapper = require('../../TextFieldWrapper-C80myx6j.cjs');
7
+
8
+ const CloseSquareIcon = (props) => /* @__PURE__ */ jsxRuntime.jsxs(
9
+ "svg",
10
+ {
11
+ xmlns: "http://www.w3.org/2000/svg",
12
+ width: "1em",
13
+ height: "1em",
14
+ fill: "none",
15
+ viewBox: "0 0 24 24",
16
+ ...props,
17
+ children: [
18
+ /* @__PURE__ */ jsxRuntime.jsx(
19
+ "path",
20
+ {
21
+ fill: "currentColor",
22
+ fillRule: "evenodd",
23
+ d: "m15.456 9.595-5.852 5.852-1.061-1.06 5.853-5.853z",
24
+ clipRule: "evenodd"
25
+ }
26
+ ),
27
+ /* @__PURE__ */ jsxRuntime.jsx(
28
+ "path",
29
+ {
30
+ fill: "currentColor",
31
+ fillRule: "evenodd",
32
+ d: "m9.6 8.532 5.856 5.858-1.06 1.06-5.857-5.857z",
33
+ clipRule: "evenodd"
34
+ }
35
+ ),
36
+ /* @__PURE__ */ jsxRuntime.jsx(
37
+ "path",
38
+ {
39
+ fill: "currentColor",
40
+ fillRule: "evenodd",
41
+ d: "M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12m10-8.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17",
42
+ clipRule: "evenodd"
43
+ }
44
+ )
45
+ ]
46
+ }
47
+ );
48
+
49
+ const EyeIcon = (props) => /* @__PURE__ */ jsxRuntime.jsxs(
50
+ "svg",
51
+ {
52
+ xmlns: "http://www.w3.org/2000/svg",
53
+ width: "1em",
54
+ height: "1em",
55
+ fill: "none",
56
+ viewBox: "0 0 24 24",
57
+ ...props,
58
+ children: [
59
+ /* @__PURE__ */ jsxRuntime.jsx(
60
+ "path",
61
+ {
62
+ fill: "currentColor",
63
+ d: "M12.247 20.812c-4.033 0-7.654-2.828-9.686-7.558a.75.75 0 0 1 0-.592c2.034-4.732 5.655-7.557 9.687-7.557s7.657 2.825 9.69 7.557a.75.75 0 0 1 0 .592c-2.032 4.73-5.653 7.554-9.685 7.557zm-8.182-7.853c1.806 3.983 4.846 6.352 8.18 6.352 3.334.002 6.373-2.369 8.18-6.352-1.808-3.986-4.848-6.354-8.182-6.354s-6.37 2.368-8.176 6.354z"
64
+ }
65
+ ),
66
+ /* @__PURE__ */ jsxRuntime.jsx(
67
+ "path",
68
+ {
69
+ fill: "currentColor",
70
+ d: "M12.247 16.789a3.825 3.825 0 1 1 0-7.651 3.825 3.825 0 0 1 0 7.65m0-6.152a2.326 2.326 0 1 0 0 4.651 2.326 2.326 0 0 0 0-4.651"
71
+ }
72
+ )
73
+ ]
74
+ }
75
+ );
76
+
77
+ const HideIcon = (props) => /* @__PURE__ */ jsxRuntime.jsx(
78
+ "svg",
79
+ {
80
+ xmlns: "http://www.w3.org/2000/svg",
81
+ width: "1em",
82
+ height: "1em",
83
+ fill: "none",
84
+ viewBox: "0 0 24 24",
85
+ ...props,
86
+ children: /* @__PURE__ */ jsxRuntime.jsx(
87
+ "path",
88
+ {
89
+ fill: "currentColor",
90
+ fillRule: "evenodd",
91
+ d: "M20.417 3.22a.75.75 0 0 1 0 1.06L4.643 20.055a.744.744 0 0 1-1.06 0 .75.75 0 0 1 0-1.06l1.972-1.971c-1.413-1.293-2.613-3.036-3.493-5.089a.75.75 0 0 1 0-.593C3.082 8.977 4.52 7.02 6.22 5.683c3.292-2.606 7.621-2.744 11.048-.375l2.088-2.088a.75.75 0 0 1 1.06 0m-.37 4.82c.724.962 1.36 2.073 1.891 3.299a.74.74 0 0 1 0 .595C19.842 16.79 16.128 19.69 12 19.69a8.8 8.8 0 0 1-2.769-.451.75.75 0 0 1 .474-1.424A7.3 7.3 0 0 0 12 18.19c3.428 0 6.561-2.442 8.43-6.553a14.5 14.5 0 0 0-1.58-2.694.75.75 0 0 1 1.197-.902M7.15 6.862c-1.437 1.13-2.67 2.776-3.58 4.778.794 1.752 1.836 3.23 3.047 4.322l2.138-2.138a3.87 3.87 0 0 1-.67-2.184A3.92 3.92 0 0 1 12 7.722a3.9 3.9 0 0 1 2.187.669l2.001-2.002c-2.853-1.844-6.325-1.676-9.038.472m8.088 4.6a.75.75 0 0 1 .606.872 3.92 3.92 0 0 1-3.141 3.147.75.75 0 0 1-.268-1.476 2.41 2.41 0 0 0 1.932-1.937.754.754 0 0 1 .87-.606M12 9.221a2.418 2.418 0 0 0-2.152 3.509l3.245-3.246A2.4 2.4 0 0 0 12 9.222",
92
+ clipRule: "evenodd"
93
+ }
94
+ )
95
+ }
96
+ );
97
+
98
+ const Input = react.forwardRef(function Input2(props, ref) {
99
+ const {
100
+ dir = "rtl",
101
+ placeholderDir = dir,
102
+ containerClassName,
103
+ leftIcon,
104
+ prefix,
105
+ postfix,
106
+ isClearOption,
107
+ onClear,
108
+ ...restProps
109
+ } = props;
110
+ const [type, setType] = react.useState(restProps.type);
111
+ return /* @__PURE__ */ jsxRuntime.jsx(
112
+ TextFieldWrapper.TextFieldWrapper,
113
+ {
114
+ ...props,
115
+ containerClassName: clsx.clsx("items-center", containerClassName),
116
+ children: ({ handleChangeField, value, setValue }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
117
+ prefix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-p1-regular text-gray-500", children: prefix }),
118
+ /* @__PURE__ */ jsxRuntime.jsx(
119
+ "input",
120
+ {
121
+ ...restProps,
122
+ ref,
123
+ className: clsx.clsx(
124
+ "bg-transparent focus:outline-none flex-1",
125
+ dir === "rtl" ? "text-right" : "!text-left",
126
+ placeholderDir === "rtl" ? "placeholder:text-right" : "placeholder:text-left",
127
+ {
128
+ ss02: restProps.type != "password"
129
+ },
130
+ props.className
131
+ ),
132
+ ...dir === "ltr" ? { style: { direction: "ltr" } } : {},
133
+ value,
134
+ onChange: handleChangeField,
135
+ type
136
+ }
137
+ ),
138
+ isClearOption && value && value.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
139
+ "button",
140
+ {
141
+ onClick: () => {
142
+ setValue("");
143
+ if (typeof onClear === "function") onClear();
144
+ },
145
+ children: /* @__PURE__ */ jsxRuntime.jsx(
146
+ CloseSquareIcon,
147
+ {
148
+ className: "text-gray-600",
149
+ width: 20,
150
+ height: 20
151
+ }
152
+ )
153
+ }
154
+ ),
155
+ postfix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-p1-regular text-gray-500", children: postfix }),
156
+ leftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-600", children: leftIcon }),
157
+ restProps.type === "password" && /* @__PURE__ */ jsxRuntime.jsx(
158
+ "button",
159
+ {
160
+ onClick: () => setType((prv) => prv === "text" ? "password" : "text"),
161
+ className: "text-gray-600",
162
+ children: type === "password" ? /* @__PURE__ */ jsxRuntime.jsx(
163
+ EyeIcon,
164
+ {
165
+ width: 20,
166
+ height: 20
167
+ }
168
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
169
+ HideIcon,
170
+ {
171
+ width: 20,
172
+ height: 20
173
+ }
174
+ )
175
+ }
176
+ )
177
+ ] })
178
+ }
179
+ );
180
+ });
181
+
182
+ module.exports = Input;