@dgshahr/ui-kit 0.0.5 → 0.0.7

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 (73) hide show
  1. package/dist/Accordion/AccordionItem.d.ts.map +1 -1
  2. package/dist/Accordion/index.cjs +1 -11
  3. package/dist/Accordion/index.js +5 -1
  4. package/dist/AccordionItem-eMnIUJ1V.cjs +1 -0
  5. package/dist/AccordionItem-tKSPLNKs.js +91 -0
  6. package/dist/Alert/index.cjs +1 -242
  7. package/dist/Alert/index.d.ts.map +1 -1
  8. package/dist/Alert/index.js +141 -144
  9. package/dist/ArrowLeft2-B76dkC-C.cjs +1 -0
  10. package/dist/{ArrowLeft2-BURhvXT2.js → ArrowLeft2-jP2w1vwt.js} +7 -7
  11. package/dist/ArrowRight2-CYowPzS8.cjs +1 -0
  12. package/dist/{ArrowRight2-DCxJPvNC.js → ArrowRight2-CcHdxGRE.js} +7 -7
  13. package/dist/Badge/index.cjs +1 -72
  14. package/dist/Badge/index.d.ts.map +1 -1
  15. package/dist/Badge/index.js +46 -52
  16. package/dist/Breadcrumb/index.cjs +1 -34
  17. package/dist/Breadcrumb/index.d.ts.map +1 -1
  18. package/dist/Breadcrumb/index.js +39 -30
  19. package/dist/Button/index.cjs +1 -119
  20. package/dist/Button/index.d.ts.map +1 -1
  21. package/dist/Button/index.js +97 -104
  22. package/dist/Button/variants.d.ts.map +1 -1
  23. package/dist/Divider/index.cjs +1 -25
  24. package/dist/Divider/index.js +12 -16
  25. package/dist/Form/Checkbox/index.cjs +1 -72
  26. package/dist/Form/Checkbox/index.js +22 -26
  27. package/dist/Form/Input/index.cjs +1 -182
  28. package/dist/Form/Input/index.d.ts.map +1 -1
  29. package/dist/Form/Input/index.js +63 -71
  30. package/dist/Form/RadioButton/index.cjs +1 -22
  31. package/dist/Form/RadioButton/index.js +13 -13
  32. package/dist/Form/Textarea/index.cjs +1 -27
  33. package/dist/Form/Textarea/index.d.ts.map +1 -1
  34. package/dist/Form/Textarea/index.js +19 -19
  35. package/dist/Form/Wrappers/SelectableInputWrapper/SelectableInputWrapper.d.ts.map +1 -1
  36. package/dist/Pagination/index.cjs +1 -119
  37. package/dist/Pagination/index.d.ts.map +1 -1
  38. package/dist/Pagination/index.js +96 -107
  39. package/dist/SelectableInputWrapper-B3ylMTsl.js +76 -0
  40. package/dist/SelectableInputWrapper-C9x3IShC.cjs +1 -0
  41. package/dist/Slide-C506y48c.js +233 -0
  42. package/dist/Slide-Zmb0vKbn.cjs +1 -0
  43. package/dist/Slider/Navigation.d.ts +9 -0
  44. package/dist/Slider/Navigation.d.ts.map +1 -0
  45. package/dist/Slider/NavigationDot.d.ts +0 -3
  46. package/dist/Slider/NavigationDot.d.ts.map +1 -1
  47. package/dist/Slider/Slider.d.ts +2 -1
  48. package/dist/Slider/Slider.d.ts.map +1 -1
  49. package/dist/Slider/context.d.ts +3 -7
  50. package/dist/Slider/context.d.ts.map +1 -1
  51. package/dist/Slider/index.cjs +1 -11
  52. package/dist/Slider/index.js +5 -1
  53. package/dist/TextFieldWrapper-Cg4f8_zY.js +151 -0
  54. package/dist/TextFieldWrapper-Ci0-vx4J.cjs +1 -0
  55. package/dist/assets/Button.css +1 -1681
  56. package/dist/assets/styles.css +1 -1617
  57. package/dist/clsx-C11secjj.cjs +1 -0
  58. package/dist/clsx-OuTLNxxd.js +16 -0
  59. package/dist/index.cjs +1 -34
  60. package/dist/index.js +28 -12
  61. package/package.json +5 -4
  62. package/dist/AccordionItem-DN7bi5kw.js +0 -103
  63. package/dist/AccordionItem-lq6ehxKe.cjs +0 -106
  64. package/dist/ArrowLeft2-iZ0Au6Fn.cjs +0 -24
  65. package/dist/ArrowRight2-DTuru_sP.cjs +0 -27
  66. package/dist/SelectableInputWrapper-D2aYQb9J.cjs +0 -71
  67. package/dist/SelectableInputWrapper-DAj8v1nv.js +0 -69
  68. package/dist/Slide-BDD1_RXD.js +0 -215
  69. package/dist/Slide-Q5_7SCZR.cjs +0 -218
  70. package/dist/TextFieldWrapper--hxpmYuz.js +0 -167
  71. package/dist/TextFieldWrapper-DaoZxs1E.cjs +0 -169
  72. package/dist/clsx-BtxeOLZW.cjs +0 -5
  73. package/dist/clsx-ChV9xqsO.js +0 -3
@@ -0,0 +1 @@
1
+ "use strict";function i(r){var f,n,t="";if(typeof r=="string"||typeof r=="number")t+=r;else if(typeof r=="object")if(Array.isArray(r)){var s=r.length;for(f=0;f<s;f++)r[f]&&(n=i(r[f]))&&(t&&(t+=" "),t+=n)}else for(n in r)r[n]&&(t&&(t+=" "),t+=n);return t}function o(){for(var r,f,n=0,t="",s=arguments.length;n<s;n++)(r=arguments[n])&&(f=i(r))&&(t&&(t+=" "),t+=f);return t}exports.clsx=o;
@@ -0,0 +1,16 @@
1
+ function a(r) {
2
+ var f, n, t = "";
3
+ if (typeof r == "string" || typeof r == "number") t += r;
4
+ else if (typeof r == "object") if (Array.isArray(r)) {
5
+ var o = r.length;
6
+ for (f = 0; f < o; f++) r[f] && (n = a(r[f])) && (t && (t += " "), t += n);
7
+ } else for (n in r) r[n] && (t && (t += " "), t += n);
8
+ return t;
9
+ }
10
+ function i() {
11
+ for (var r, f, n = 0, t = "", o = arguments.length; n < o; n++) (r = arguments[n]) && (f = a(r)) && (t && (t += " "), t += f);
12
+ return t;
13
+ }
14
+ export {
15
+ i as c
16
+ };
package/dist/index.cjs CHANGED
@@ -1,34 +1 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
-
5
- require('./assets/styles.css');;/* empty css */
6
- const AccordionItem = require('./AccordionItem-lq6ehxKe.cjs');
7
- const Alert = require('./Alert/index.cjs');
8
- const Badge = require('./Badge/index.cjs');
9
- const Breadcrumb = require('./Breadcrumb/index.cjs');
10
- const Button = require('./Button/index.cjs');
11
- const Divider = require('./Divider/index.cjs');
12
- const Form_Checkbox = require('./Form/Checkbox/index.cjs');
13
- const Form_Input = require('./Form/Input/index.cjs');
14
- const Form_RadioButton = require('./Form/RadioButton/index.cjs');
15
- const Form_Textarea = require('./Form/Textarea/index.cjs');
16
- const Pagination = require('./Pagination/index.cjs');
17
- const Slide = require('./Slide-Q5_7SCZR.cjs');
18
-
19
-
20
-
21
- exports.AccordionGroup = AccordionItem.AccordionGroup;
22
- exports.AccordionItem = AccordionItem.AccordionItem;
23
- exports.Alert = Alert;
24
- exports.Badge = Badge;
25
- exports.Breadcrumb = Breadcrumb;
26
- exports.Button = Button;
27
- exports.Divider = Divider;
28
- exports.Checkbox = Form_Checkbox;
29
- exports.Input = Form_Input;
30
- exports.RadioButton = Form_RadioButton;
31
- exports.Textarea = Form_Textarea;
32
- exports.Pagination = Pagination;
33
- exports.Slide = Slide.Slide;
34
- exports.Slider = Slide.Slider;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/styles.css');;/* empty css */const e=require("./AccordionItem-eMnIUJ1V.cjs"),o=require("./Alert/index.cjs"),t=require("./Badge/index.cjs"),i=require("./Breadcrumb/index.cjs"),n=require("./Button/index.cjs"),c=require("./Divider/index.cjs"),u=require("./Form/Checkbox/index.cjs"),d=require("./Form/Input/index.cjs"),a=require("./Form/RadioButton/index.cjs"),s=require("./Form/Textarea/index.cjs"),q=require("./Pagination/index.cjs"),r=require("./Slide-Zmb0vKbn.cjs");exports.AccordionGroup=e.AccordionGroup;exports.AccordionItem=e.AccordionItem;exports.Alert=o;exports.Badge=t;exports.Breadcrumb=i;exports.Button=n;exports.Divider=c;exports.Checkbox=u;exports.Input=d;exports.RadioButton=a;exports.Textarea=s;exports.Pagination=q;exports.Slide=r.Slide;exports.Slider=r.Slider;
package/dist/index.js CHANGED
@@ -1,13 +1,29 @@
1
1
  import './assets/styles.css';/* empty css */
2
- export { A as AccordionGroup, a as AccordionItem } from './AccordionItem-DN7bi5kw.js';
3
- export { default as Alert } from './Alert/index.js';
4
- export { default as Badge } from './Badge/index.js';
5
- export { default as Breadcrumb } from './Breadcrumb/index.js';
6
- export { default as Button } from './Button/index.js';
7
- export { default as Divider } from './Divider/index.js';
8
- export { default as Checkbox } from './Form/Checkbox/index.js';
9
- export { default as Input } from './Form/Input/index.js';
10
- export { default as RadioButton } from './Form/RadioButton/index.js';
11
- export { default as Textarea } from './Form/Textarea/index.js';
12
- export { default as Pagination } from './Pagination/index.js';
13
- export { a as Slide, S as Slider } from './Slide-BDD1_RXD.js';
2
+ import { A as e, a as t } from "./AccordionItem-tKSPLNKs.js";
3
+ import { default as d } from "./Alert/index.js";
4
+ import { default as p } from "./Badge/index.js";
5
+ import { default as s } from "./Breadcrumb/index.js";
6
+ import { default as l } from "./Button/index.js";
7
+ import { default as n } from "./Divider/index.js";
8
+ import { default as A } from "./Form/Checkbox/index.js";
9
+ import { default as S } from "./Form/Input/index.js";
10
+ import { default as g } from "./Form/RadioButton/index.js";
11
+ import { default as h } from "./Form/Textarea/index.js";
12
+ import { default as v } from "./Pagination/index.js";
13
+ import { a as D, S as G } from "./Slide-C506y48c.js";
14
+ export {
15
+ e as AccordionGroup,
16
+ t as AccordionItem,
17
+ d as Alert,
18
+ p as Badge,
19
+ s as Breadcrumb,
20
+ l as Button,
21
+ A as Checkbox,
22
+ n as Divider,
23
+ S as Input,
24
+ v as Pagination,
25
+ g as RadioButton,
26
+ D as Slide,
27
+ G as Slider,
28
+ h as Textarea
29
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dgshahr/ui-kit",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "dgshahr ui-kit",
5
5
  "author": "dgshahr",
6
6
  "license": "MIT",
@@ -151,9 +151,10 @@
151
151
  },
152
152
  "scripts": {
153
153
  "dev": "storybook dev -p 6006",
154
- "build": "tsc && vite build && node scripts/generate-exports.js",
154
+ "build": "rm -rf dist && tsc && vite build && node scripts/generate-exports.js",
155
155
  "build:story": "storybook build",
156
- "lint": "eslint --fix src/**/* --report-unused-disable-directives --max-warnings 0 -f codeframe",
156
+ "start:story": "npx http-server storybook-static",
157
+ "lint": "eslint --fix src/**/* --report-unused-disable-directives --max-warnings 0 --no-warn-ignored -f codeframe",
157
158
  "format": "prettier src/**/* --write --ignore-unknown",
158
159
  "prepublishOnly": "npm run build",
159
160
  "prepare": "husky",
@@ -217,4 +218,4 @@
217
218
  "yarn format"
218
219
  ]
219
220
  }
220
- }
221
+ }
@@ -1,103 +0,0 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { c as clsx } from './clsx-ChV9xqsO.js';
3
- import { createContext, useContext, useState, useId } from 'react';
4
- import Divider from './Divider/index.js';
5
-
6
- const accordionContext = createContext({
7
- activeKey: null,
8
- setActiveKey: () => {
9
- }
10
- });
11
- const useAccordionData = () => useContext(accordionContext);
12
-
13
- const AccordionGroup = (props) => {
14
- const { defaultActiveKey = null, className, children } = props;
15
- const [activeKey, setActiveKey] = useState(defaultActiveKey);
16
- return /* @__PURE__ */ jsx("div", { className: clsx("flex flex-col", className), children: /* @__PURE__ */ jsx(
17
- accordionContext.Provider,
18
- {
19
- value: {
20
- activeKey,
21
- setActiveKey
22
- },
23
- children
24
- }
25
- ) });
26
- };
27
-
28
- const ArrowDown2Icon = (props) => /* @__PURE__ */ jsx(
29
- "svg",
30
- {
31
- xmlns: "http://www.w3.org/2000/svg",
32
- width: "1em",
33
- height: "1em",
34
- fill: "none",
35
- viewBox: "0 0 24 24",
36
- ...props,
37
- children: /* @__PURE__ */ jsx(
38
- "path",
39
- {
40
- fill: "currentColor",
41
- d: "M4.47 7.97a.75.75 0 0 1 .976-.073l.084.073L12 14.439l6.47-6.47a.75.75 0 0 1 .976-.072l.084.073a.75.75 0 0 1 .073.976l-.073.084-7 7a.75.75 0 0 1-.976.073l-.084-.073-7-7a.75.75 0 0 1 0-1.06"
42
- }
43
- )
44
- }
45
- );
46
-
47
- const AccordionItem = (props) => {
48
- const { children, title, accordionKey, className, contentClassName } = props;
49
- const { activeKey, setActiveKey } = useAccordionData();
50
- const reactUseId = useId();
51
- const accordionItemKey = accordionKey ?? reactUseId;
52
- const isItemActive = accordionItemKey === activeKey;
53
- return /* @__PURE__ */ jsxs("div", { className: clsx("bg-white px-4 pt-4", className), children: [
54
- /* @__PURE__ */ jsxs(
55
- "button",
56
- {
57
- className: clsx(
58
- "flex justify-between items-center w-full",
59
- isItemActive ? "text-primary-500" : "text-gray-600"
60
- ),
61
- onClick: () => {
62
- if (isItemActive) setActiveKey(null);
63
- else setActiveKey(accordionItemKey);
64
- },
65
- children: [
66
- /* @__PURE__ */ jsx("div", { className: isItemActive ? "font-h5-bold" : "font-p1-medium", children: title }),
67
- /* @__PURE__ */ jsx(
68
- ArrowDown2Icon,
69
- {
70
- className: clsx(
71
- "transition duration-300 ease-in-out shrink-0 w-auto h-auto",
72
- isItemActive && "rotate-180"
73
- ),
74
- width: 20,
75
- height: 20
76
- }
77
- )
78
- ]
79
- }
80
- ),
81
- /* @__PURE__ */ jsx(
82
- "div",
83
- {
84
- className: clsx(
85
- "grid font-p1-regular text-gray-600 overflow-hidden transition-all duration-300 ease-in-out",
86
- isItemActive ? "grid-rows-[1fr] opacity-100 mt-3" : "grid-rows-[0fr] opacity-0",
87
- contentClassName
88
- ),
89
- children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children })
90
- }
91
- ),
92
- /* @__PURE__ */ jsx(
93
- Divider,
94
- {
95
- type: "horizontal",
96
- color: "white",
97
- className: "mt-4"
98
- }
99
- )
100
- ] });
101
- };
102
-
103
- export { AccordionGroup as A, AccordionItem as a };
@@ -1,106 +0,0 @@
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 Divider = require('./Divider/index.cjs');
7
-
8
- const accordionContext = react.createContext({
9
- activeKey: null,
10
- setActiveKey: () => {
11
- }
12
- });
13
- const useAccordionData = () => react.useContext(accordionContext);
14
-
15
- const AccordionGroup = (props) => {
16
- const { defaultActiveKey = null, className, children } = props;
17
- const [activeKey, setActiveKey] = react.useState(defaultActiveKey);
18
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx("flex flex-col", className), children: /* @__PURE__ */ jsxRuntime.jsx(
19
- accordionContext.Provider,
20
- {
21
- value: {
22
- activeKey,
23
- setActiveKey
24
- },
25
- children
26
- }
27
- ) });
28
- };
29
-
30
- const ArrowDown2Icon = (props) => /* @__PURE__ */ jsxRuntime.jsx(
31
- "svg",
32
- {
33
- xmlns: "http://www.w3.org/2000/svg",
34
- width: "1em",
35
- height: "1em",
36
- fill: "none",
37
- viewBox: "0 0 24 24",
38
- ...props,
39
- children: /* @__PURE__ */ jsxRuntime.jsx(
40
- "path",
41
- {
42
- fill: "currentColor",
43
- d: "M4.47 7.97a.75.75 0 0 1 .976-.073l.084.073L12 14.439l6.47-6.47a.75.75 0 0 1 .976-.072l.084.073a.75.75 0 0 1 .073.976l-.073.084-7 7a.75.75 0 0 1-.976.073l-.084-.073-7-7a.75.75 0 0 1 0-1.06"
44
- }
45
- )
46
- }
47
- );
48
-
49
- const AccordionItem = (props) => {
50
- const { children, title, accordionKey, className, contentClassName } = props;
51
- const { activeKey, setActiveKey } = useAccordionData();
52
- const reactUseId = react.useId();
53
- const accordionItemKey = accordionKey ?? reactUseId;
54
- const isItemActive = accordionItemKey === activeKey;
55
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx.clsx("bg-white px-4 pt-4", className), children: [
56
- /* @__PURE__ */ jsxRuntime.jsxs(
57
- "button",
58
- {
59
- className: clsx.clsx(
60
- "flex justify-between items-center w-full",
61
- isItemActive ? "text-primary-500" : "text-gray-600"
62
- ),
63
- onClick: () => {
64
- if (isItemActive) setActiveKey(null);
65
- else setActiveKey(accordionItemKey);
66
- },
67
- children: [
68
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: isItemActive ? "font-h5-bold" : "font-p1-medium", children: title }),
69
- /* @__PURE__ */ jsxRuntime.jsx(
70
- ArrowDown2Icon,
71
- {
72
- className: clsx.clsx(
73
- "transition duration-300 ease-in-out shrink-0 w-auto h-auto",
74
- isItemActive && "rotate-180"
75
- ),
76
- width: 20,
77
- height: 20
78
- }
79
- )
80
- ]
81
- }
82
- ),
83
- /* @__PURE__ */ jsxRuntime.jsx(
84
- "div",
85
- {
86
- className: clsx.clsx(
87
- "grid font-p1-regular text-gray-600 overflow-hidden transition-all duration-300 ease-in-out",
88
- isItemActive ? "grid-rows-[1fr] opacity-100 mt-3" : "grid-rows-[0fr] opacity-0",
89
- contentClassName
90
- ),
91
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden", children })
92
- }
93
- ),
94
- /* @__PURE__ */ jsxRuntime.jsx(
95
- Divider,
96
- {
97
- type: "horizontal",
98
- color: "white",
99
- className: "mt-4"
100
- }
101
- )
102
- ] });
103
- };
104
-
105
- exports.AccordionGroup = AccordionGroup;
106
- exports.AccordionItem = AccordionItem;
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- const jsxRuntime = require('react/jsx-runtime');
4
-
5
- const ArrowLeft2Icon = (props) => /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(
15
- "path",
16
- {
17
- fill: "currentColor",
18
- d: "M16.28 4.47a.75.75 0 0 1 .073.976l-.073.084L9.811 12l6.47 6.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073-7-7a.75.75 0 0 1-.073-.976l.073-.084 7-7a.75.75 0 0 1 1.06 0"
19
- }
20
- )
21
- }
22
- );
23
-
24
- exports.ArrowLeft2Icon = ArrowLeft2Icon;
@@ -1,27 +0,0 @@
1
- 'use strict';
2
-
3
- const jsxRuntime = require('react/jsx-runtime');
4
-
5
- const ArrowRight2Icon = (props) => /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(
15
- "path",
16
- {
17
- stroke: "currentColor",
18
- strokeLinecap: "round",
19
- strokeLinejoin: "round",
20
- strokeWidth: 1.5,
21
- d: "m8.5 5 7 7-7 7"
22
- }
23
- )
24
- }
25
- );
26
-
27
- exports.ArrowRight2Icon = ArrowRight2Icon;
@@ -1,71 +0,0 @@
1
- 'use strict';
2
-
3
- require('./assets/styles.css');const jsxRuntime = require('react/jsx-runtime');
4
- const clsx = require('./clsx-BtxeOLZW.cjs');
5
- ;/* empty css */
6
-
7
- const SelectableInputWrapper = (props) => {
8
- const {
9
- children,
10
- containerClassName,
11
- errorMessage,
12
- helperMessage,
13
- isError,
14
- label,
15
- variant = "default"
16
- } = props;
17
- const icon = props.icon;
18
- return /* @__PURE__ */ jsxRuntime.jsxs(
19
- "label",
20
- {
21
- className: clsx.clsx(
22
- "flex w-fit justify-between items-center group has-[:disabled]:opacity-40 has-[:disabled]:cursor-not-allowed transition",
23
- {
24
- "p-3 border w-full border-solid rounded-xl bg-white has-[:checked]:bg-primary-50": variant === "bordered",
25
- "has-[:checked]:border-primary-500 border-gray-200 hover:ring-4 hover:ring-gray-100 has-[:focus]:ring has-[:focus]:ring-primary-300 has-[:focus]:ring-offset-1 has-[:focus]:ring-offset-white": variant === "bordered" && !isError,
26
- "border-error-500 hover:ring-4 hover:ring-error-50 has-[:focus]:ring has-[:focus]:ring-error-300 has-[:focus]:ring-offset-1 has-[:focus]:ring-offset-white": variant === "bordered" && isError
27
- },
28
- containerClassName
29
- ),
30
- children: [
31
- /* @__PURE__ */ jsxRuntime.jsxs(
32
- "div",
33
- {
34
- className: clsx.clsx(
35
- "flex space-x-2 space-x-reverse",
36
- errorMessage ?? helperMessage ? "items-start" : "items-center"
37
- ),
38
- children: [
39
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx("relative h-[18px] w-[18px]", { "mt-1": label }), children: children({
40
- inputClassName: clsx.clsx(
41
- "peer w-full h-full disabled:bg-gray-200 appearance-none border border-gray-300 group-hover:border-primary-500 checked:bg-primary-500 checked:border-transparent transition-all",
42
- {
43
- "group-hover:ring-4 group-hover:ring-gray-100 focus:!ring focus:!ring-primary-300 focus:ring-offset-1 focus:ring-offset-white": variant !== "bordered" && !isError,
44
- "!border-error-500 group-hover:ring-4 group-hover:ring-error-50 focus:!ring focus:!ring-error-300 focus:ring-offset-1 focus:ring-offset-white": variant !== "bordered" && isError
45
- }
46
- ),
47
- checkedInputClassName: "absolute top-0 left-0 w-full h-full flex items-center justify-center text-white opacity-0 peer-checked:opacity-100 transition-opacity"
48
- }) }),
49
- Boolean(label) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
50
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-p2-medium text-gray-700 transition group-hover:text-primary-500", children: label }),
51
- Boolean(errorMessage ?? helperMessage) && /* @__PURE__ */ jsxRuntime.jsx(
52
- "div",
53
- {
54
- className: clsx.clsx(
55
- "font-p3-regular",
56
- errorMessage && isError ? "text-error-500" : "text-gray-500"
57
- ),
58
- children: isError && errorMessage ? errorMessage : helperMessage
59
- }
60
- )
61
- ] })
62
- ]
63
- }
64
- ),
65
- variant === "bordered" && icon ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-600 group-hover:text-primary-500 group-checked:text-primary-500", children: icon }) : null
66
- ]
67
- }
68
- );
69
- };
70
-
71
- exports.SelectableInputWrapper = SelectableInputWrapper;
@@ -1,69 +0,0 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { c as clsx } from './clsx-ChV9xqsO.js';
3
- import './assets/styles.css';/* empty css */
4
-
5
- const SelectableInputWrapper = (props) => {
6
- const {
7
- children,
8
- containerClassName,
9
- errorMessage,
10
- helperMessage,
11
- isError,
12
- label,
13
- variant = "default"
14
- } = props;
15
- const icon = props.icon;
16
- return /* @__PURE__ */ jsxs(
17
- "label",
18
- {
19
- className: clsx(
20
- "flex w-fit justify-between items-center group has-[:disabled]:opacity-40 has-[:disabled]:cursor-not-allowed transition",
21
- {
22
- "p-3 border w-full border-solid rounded-xl bg-white has-[:checked]:bg-primary-50": variant === "bordered",
23
- "has-[:checked]:border-primary-500 border-gray-200 hover:ring-4 hover:ring-gray-100 has-[:focus]:ring has-[:focus]:ring-primary-300 has-[:focus]:ring-offset-1 has-[:focus]:ring-offset-white": variant === "bordered" && !isError,
24
- "border-error-500 hover:ring-4 hover:ring-error-50 has-[:focus]:ring has-[:focus]:ring-error-300 has-[:focus]:ring-offset-1 has-[:focus]:ring-offset-white": variant === "bordered" && isError
25
- },
26
- containerClassName
27
- ),
28
- children: [
29
- /* @__PURE__ */ jsxs(
30
- "div",
31
- {
32
- className: clsx(
33
- "flex space-x-2 space-x-reverse",
34
- errorMessage ?? helperMessage ? "items-start" : "items-center"
35
- ),
36
- children: [
37
- /* @__PURE__ */ jsx("div", { className: clsx("relative h-[18px] w-[18px]", { "mt-1": label }), children: children({
38
- inputClassName: clsx(
39
- "peer w-full h-full disabled:bg-gray-200 appearance-none border border-gray-300 group-hover:border-primary-500 checked:bg-primary-500 checked:border-transparent transition-all",
40
- {
41
- "group-hover:ring-4 group-hover:ring-gray-100 focus:!ring focus:!ring-primary-300 focus:ring-offset-1 focus:ring-offset-white": variant !== "bordered" && !isError,
42
- "!border-error-500 group-hover:ring-4 group-hover:ring-error-50 focus:!ring focus:!ring-error-300 focus:ring-offset-1 focus:ring-offset-white": variant !== "bordered" && isError
43
- }
44
- ),
45
- checkedInputClassName: "absolute top-0 left-0 w-full h-full flex items-center justify-center text-white opacity-0 peer-checked:opacity-100 transition-opacity"
46
- }) }),
47
- Boolean(label) && /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
48
- /* @__PURE__ */ jsx("div", { className: "font-p2-medium text-gray-700 transition group-hover:text-primary-500", children: label }),
49
- Boolean(errorMessage ?? helperMessage) && /* @__PURE__ */ jsx(
50
- "div",
51
- {
52
- className: clsx(
53
- "font-p3-regular",
54
- errorMessage && isError ? "text-error-500" : "text-gray-500"
55
- ),
56
- children: isError && errorMessage ? errorMessage : helperMessage
57
- }
58
- )
59
- ] })
60
- ]
61
- }
62
- ),
63
- variant === "bordered" && icon ? /* @__PURE__ */ jsx("div", { className: "text-gray-600 group-hover:text-primary-500 group-checked:text-primary-500", children: icon }) : null
64
- ]
65
- }
66
- );
67
- };
68
-
69
- export { SelectableInputWrapper as S };