@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
@@ -1,10 +1,9 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { c as clsx } from '../clsx-ChV9xqsO.js';
3
- import { useState } from 'react';
4
- import Button from '../Button/index.js';
1
+ import { jsx as i, jsxs as g } from "react/jsx-runtime";
2
+ import { c as l } from "../clsx-OuTLNxxd.js";
3
+ import { useState as p } from "react";
4
+ import c from "../Button/index.js";
5
5
  import '../assets/styles.css';/* empty css */
6
-
7
- const CheckCircleBoldIcon = (props) => /* @__PURE__ */ jsx(
6
+ const w = (t) => /* @__PURE__ */ i(
8
7
  "svg",
9
8
  {
10
9
  xmlns: "http://www.w3.org/2000/svg",
@@ -12,8 +11,8 @@ const CheckCircleBoldIcon = (props) => /* @__PURE__ */ jsx(
12
11
  height: "1em",
13
12
  fill: "none",
14
13
  viewBox: "0 0 24 24",
15
- ...props,
16
- children: /* @__PURE__ */ jsx(
14
+ ...t,
15
+ children: /* @__PURE__ */ i(
17
16
  "path",
18
17
  {
19
18
  fill: "currentColor",
@@ -23,9 +22,7 @@ const CheckCircleBoldIcon = (props) => /* @__PURE__ */ jsx(
23
22
  }
24
23
  )
25
24
  }
26
- );
27
-
28
- const CloseRemoveIcon = (props) => /* @__PURE__ */ jsx(
25
+ ), f = (t) => /* @__PURE__ */ i(
29
26
  "svg",
30
27
  {
31
28
  xmlns: "http://www.w3.org/2000/svg",
@@ -33,8 +30,8 @@ const CloseRemoveIcon = (props) => /* @__PURE__ */ jsx(
33
30
  height: "1em",
34
31
  fill: "none",
35
32
  viewBox: "0 0 24 24",
36
- ...props,
37
- children: /* @__PURE__ */ jsx(
33
+ ...t,
34
+ children: /* @__PURE__ */ i(
38
35
  "path",
39
36
  {
40
37
  fill: "currentColor",
@@ -42,9 +39,7 @@ const CloseRemoveIcon = (props) => /* @__PURE__ */ jsx(
42
39
  }
43
40
  )
44
41
  }
45
- );
46
-
47
- const DangerBoldIcon = (props) => /* @__PURE__ */ jsx(
42
+ ), y = (t) => /* @__PURE__ */ i(
48
43
  "svg",
49
44
  {
50
45
  xmlns: "http://www.w3.org/2000/svg",
@@ -52,8 +47,8 @@ const DangerBoldIcon = (props) => /* @__PURE__ */ jsx(
52
47
  height: "1em",
53
48
  fill: "none",
54
49
  viewBox: "0 0 24 24",
55
- ...props,
56
- children: /* @__PURE__ */ jsx(
50
+ ...t,
51
+ children: /* @__PURE__ */ i(
57
52
  "path",
58
53
  {
59
54
  fill: "currentColor",
@@ -61,9 +56,7 @@ const DangerBoldIcon = (props) => /* @__PURE__ */ jsx(
61
56
  }
62
57
  )
63
58
  }
64
- );
65
-
66
- const InfoCircleBoldIcon = (props) => /* @__PURE__ */ jsx(
59
+ ), v = (t) => /* @__PURE__ */ i(
67
60
  "svg",
68
61
  {
69
62
  xmlns: "http://www.w3.org/2000/svg",
@@ -71,8 +64,8 @@ const InfoCircleBoldIcon = (props) => /* @__PURE__ */ jsx(
71
64
  height: "1em",
72
65
  fill: "none",
73
66
  viewBox: "0 0 24 24",
74
- ...props,
75
- children: /* @__PURE__ */ jsx(
67
+ ...t,
68
+ children: /* @__PURE__ */ i(
76
69
  "path",
77
70
  {
78
71
  fill: "currentColor",
@@ -82,159 +75,163 @@ const InfoCircleBoldIcon = (props) => /* @__PURE__ */ jsx(
82
75
  }
83
76
  )
84
77
  }
85
- );
86
-
87
- const alertVariantClassNames = {
78
+ ), o = {
88
79
  container: {
89
- warning: "bg-warning-50 border-warning-200",
90
- primary: "bg-primary-50 border-primary-100",
91
- error: "bg-error-50 border-error-200",
92
- success: "bg-success-50 border-success-200",
93
- gray: "bg-gray-50 border-gray-200"
80
+ warning: "dgs-ui-kit-bg-warning-50 dgs-ui-kit-border-warning-200",
81
+ primary: "dgs-ui-kit-bg-primary-50 dgs-ui-kit-border-primary-100",
82
+ error: "dgs-ui-kit-bg-error-50 dgs-ui-kit-border-error-200",
83
+ success: "dgs-ui-kit-bg-success-50 dgs-ui-kit-border-success-200",
84
+ gray: "dgs-ui-kit-bg-gray-50 dgs-ui-kit-border-gray-200"
94
85
  },
95
86
  icon: {
96
- warning: "text-warning-700",
97
- primary: "text-primary-400",
98
- error: "text-error-600",
99
- success: "text-success-600",
100
- gray: "text-gray-600"
87
+ warning: "dgs-ui-kit-text-warning-700",
88
+ primary: "dgs-ui-kit-text-primary-400",
89
+ error: "dgs-ui-kit-text-error-600",
90
+ success: "dgs-ui-kit-text-success-600",
91
+ gray: "dgs-ui-kit-text-gray-600"
101
92
  },
102
93
  title: {
103
- warning: "text-warning-800",
104
- primary: "text-primary-700",
105
- error: "text-error-700",
106
- success: "text-success-800",
107
- gray: "text-gray-800"
94
+ warning: "dgs-ui-kit-text-warning-800",
95
+ primary: "dgs-ui-kit-text-primary-700",
96
+ error: "dgs-ui-kit-text-error-700",
97
+ success: "dgs-ui-kit-text-success-800",
98
+ gray: "dgs-ui-kit-text-gray-800"
108
99
  },
109
100
  close: {
110
- warning: "text-warning-800",
111
- primary: "text-primary-600",
112
- error: "text-error-600",
113
- success: "text-success-800",
114
- gray: "text-gray-800"
101
+ warning: "dgs-ui-kit-text-warning-800",
102
+ primary: "dgs-ui-kit-text-primary-600",
103
+ error: "dgs-ui-kit-text-error-600",
104
+ success: "dgs-ui-kit-text-success-800",
105
+ gray: "dgs-ui-kit-text-gray-800"
115
106
  },
116
107
  text: {
117
- warning: "text-warning-800",
118
- primary: "text-primary-600",
119
- error: "text-error-600",
120
- success: "text-success-800",
121
- gray: "text-gray-700"
108
+ warning: "dgs-ui-kit-text-warning-800",
109
+ primary: "dgs-ui-kit-text-primary-600",
110
+ error: "dgs-ui-kit-text-error-600",
111
+ success: "dgs-ui-kit-text-success-800",
112
+ gray: "dgs-ui-kit-text-gray-700"
122
113
  }
123
- };
124
- const alertSizeClassNames = {
114
+ }, s = {
125
115
  container: {
126
- large: "p-4",
127
- small: "p-3"
116
+ large: "dgs-ui-kit-p-4",
117
+ small: "dgs-ui-kit-p-3"
128
118
  },
129
119
  icon: {
130
120
  large: 24,
131
121
  small: 20
132
122
  },
133
123
  title: {
134
- large: "font-h5-bold mb-2",
135
- small: "font-h6-bold mb-1"
124
+ large: "dgs-ui-kit-font-h5-bold mb-2",
125
+ small: "dgs-ui-kit-font-h6-bold mb-1"
136
126
  },
137
127
  close: {
138
128
  large: 20,
139
129
  small: 20
140
130
  },
141
131
  text: {
142
- large: "font-p2-regular",
143
- small: "font-p3-regular"
132
+ large: "dgs-ui-kit-font-p2-regular",
133
+ small: "dgs-ui-kit-font-p3-regular"
144
134
  }
145
135
  };
146
-
147
- function getAlertIcon(variant, size) {
148
- let IconComponent = InfoCircleBoldIcon;
149
- if (variant === "error") IconComponent = DangerBoldIcon;
150
- else if (variant === "success") IconComponent = CheckCircleBoldIcon;
151
- return /* @__PURE__ */ jsx(
152
- IconComponent,
136
+ function b(t, r) {
137
+ let e = v;
138
+ return t === "error" ? e = y : t === "success" && (e = w), /* @__PURE__ */ i(
139
+ e,
153
140
  {
154
- className: clsx("shrink-0 my-[2px]", alertVariantClassNames.icon[variant]),
155
- width: alertSizeClassNames.icon[size],
156
- height: alertSizeClassNames.icon[size]
141
+ className: l(
142
+ "dgs-ui-kit-shrink-0 dgs-ui-kit-my-[2px]",
143
+ o.icon[t]
144
+ ),
145
+ width: s.icon[r],
146
+ height: s.icon[r]
157
147
  }
158
148
  );
159
149
  }
160
- const Alert = (props) => {
150
+ const M = (t) => {
161
151
  const {
162
- variant = "primary",
163
- size = "small",
164
- title,
165
- text,
166
- primaryButton,
167
- outlineButton,
168
- closable,
169
- className
170
- } = props;
171
- const [show, setShow] = useState(true);
172
- if (show)
173
- return /* @__PURE__ */ jsxs(
174
- "div",
175
- {
176
- className: clsx(
177
- "w-full flex gap-x-3 rounded-xl border border-solid",
178
- alertVariantClassNames.container[variant],
179
- alertSizeClassNames.container[size],
180
- className
181
- ),
182
- children: [
183
- getAlertIcon(variant, size),
184
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1", children: [
185
- Boolean(title) && /* @__PURE__ */ jsx(
186
- "div",
187
- {
188
- className: clsx(
189
- alertVariantClassNames.title[variant],
190
- alertSizeClassNames.title[size]
191
- ),
192
- children: title
193
- }
194
- ),
195
- /* @__PURE__ */ jsx("p", { className: clsx(alertVariantClassNames.text[variant], alertSizeClassNames.text[size]), children: text }),
196
- (Boolean(primaryButton?.text) || Boolean(outlineButton?.text)) && /* @__PURE__ */ jsxs("div", { className: clsx("flex gap-x-2 items-center", size === "large" ? "mt-4" : "mt-3"), children: [
197
- Boolean(primaryButton?.text) && /* @__PURE__ */ jsx(
198
- Button,
199
- {
200
- variant: "primary",
201
- color: variant,
202
- size: "small",
203
- ...primaryButton,
204
- children: primaryButton?.text
205
- }
152
+ variant: r = "primary",
153
+ size: e = "small",
154
+ title: d,
155
+ text: u,
156
+ primaryButton: a,
157
+ outlineButton: n,
158
+ closable: m,
159
+ className: k
160
+ } = t, [x, h] = p(!0);
161
+ return x ? /* @__PURE__ */ g(
162
+ "div",
163
+ {
164
+ className: l(
165
+ "dgs-ui-kit-w-full dgs-ui-kit-flex dgs-ui-kit-gap-x-3 dgs-ui-kit-rounded-xl dgs-ui-kit-border dgs-ui-kit-border-solid",
166
+ o.container[r],
167
+ s.container[e],
168
+ k
169
+ ),
170
+ children: [
171
+ b(r, e),
172
+ /* @__PURE__ */ g("div", { className: "dgs-ui-kit-flex dgs-ui-kit-flex-col dgs-ui-kit-flex-1", children: [
173
+ !!d && /* @__PURE__ */ i(
174
+ "div",
175
+ {
176
+ className: l(
177
+ o.title[r],
178
+ s.title[e]
206
179
  ),
207
- Boolean(outlineButton?.text) && /* @__PURE__ */ jsx(
208
- Button,
209
- {
210
- variant: "outline",
211
- color: variant,
212
- size: "small",
213
- ...outlineButton,
214
- children: outlineButton?.text
215
- }
216
- )
217
- ] })
218
- ] }),
219
- closable && /* @__PURE__ */ jsx(
220
- "button",
180
+ children: d
181
+ }
182
+ ),
183
+ /* @__PURE__ */ i("p", { className: l(o.text[r], s.text[e]), children: u }),
184
+ (!!a?.text || !!n?.text) && /* @__PURE__ */ g(
185
+ "div",
221
186
  {
222
- className: "shrink-0 my-[2px] h-fit",
223
- onClick: () => setShow(false),
224
- children: /* @__PURE__ */ jsx(
225
- CloseRemoveIcon,
226
- {
227
- className: clsx(alertVariantClassNames.close[variant]),
228
- width: alertSizeClassNames.close[size],
229
- height: alertSizeClassNames.close[size]
230
- }
231
- )
187
+ className: l(
188
+ "dgs-ui-kit-flex dgs-ui-kit-gap-x-2 dgs-ui-kit-items-center",
189
+ e === "large" ? "dgs-ui-kit-mt-4" : "dgs-ui-kit-mt-3"
190
+ ),
191
+ children: [
192
+ !!a?.text && /* @__PURE__ */ i(
193
+ c,
194
+ {
195
+ variant: "primary",
196
+ color: r,
197
+ size: "small",
198
+ ...a,
199
+ children: a?.text
200
+ }
201
+ ),
202
+ !!n?.text && /* @__PURE__ */ i(
203
+ c,
204
+ {
205
+ variant: "outline",
206
+ color: r,
207
+ size: "small",
208
+ ...n,
209
+ children: n?.text
210
+ }
211
+ )
212
+ ]
232
213
  }
233
214
  )
234
- ]
235
- }
236
- );
237
- return null;
215
+ ] }),
216
+ m && /* @__PURE__ */ i(
217
+ "button",
218
+ {
219
+ className: "dgs-ui-kit-shrink-0 dgs-ui-kit-my-[2px] dgs-ui-kit-h-fit",
220
+ onClick: () => h(!1),
221
+ children: /* @__PURE__ */ i(
222
+ f,
223
+ {
224
+ className: l(o.close[r]),
225
+ width: s.close[e],
226
+ height: s.close[e]
227
+ }
228
+ )
229
+ }
230
+ )
231
+ ]
232
+ }
233
+ ) : null;
234
+ };
235
+ export {
236
+ M as default
238
237
  };
239
-
240
- export { Alert as default };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),l=t=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...t,children:e.jsx("path",{fill:"currentColor",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"})});exports.ArrowLeft2Icon=l;
@@ -1,6 +1,5 @@
1
- import { jsx } from 'react/jsx-runtime';
2
-
3
- const ArrowLeft2Icon = (props) => /* @__PURE__ */ jsx(
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ const t = (o) => /* @__PURE__ */ l(
4
3
  "svg",
5
4
  {
6
5
  xmlns: "http://www.w3.org/2000/svg",
@@ -8,8 +7,8 @@ const ArrowLeft2Icon = (props) => /* @__PURE__ */ jsx(
8
7
  height: "1em",
9
8
  fill: "none",
10
9
  viewBox: "0 0 24 24",
11
- ...props,
12
- children: /* @__PURE__ */ jsx(
10
+ ...o,
11
+ children: /* @__PURE__ */ l(
13
12
  "path",
14
13
  {
15
14
  fill: "currentColor",
@@ -18,5 +17,6 @@ const ArrowLeft2Icon = (props) => /* @__PURE__ */ jsx(
18
17
  )
19
18
  }
20
19
  );
21
-
22
- export { ArrowLeft2Icon as A };
20
+ export {
21
+ t as A
22
+ };
@@ -0,0 +1 @@
1
+ "use strict";const o=require("react/jsx-runtime"),t=r=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...r,children:o.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m8.5 5 7 7-7 7"})});exports.ArrowRight2Icon=t;
@@ -1,6 +1,5 @@
1
- import { jsx } from 'react/jsx-runtime';
2
-
3
- const ArrowRight2Icon = (props) => /* @__PURE__ */ jsx(
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ const e = (r) => /* @__PURE__ */ o(
4
3
  "svg",
5
4
  {
6
5
  xmlns: "http://www.w3.org/2000/svg",
@@ -8,8 +7,8 @@ const ArrowRight2Icon = (props) => /* @__PURE__ */ jsx(
8
7
  height: "1em",
9
8
  fill: "none",
10
9
  viewBox: "0 0 24 24",
11
- ...props,
12
- children: /* @__PURE__ */ jsx(
10
+ ...r,
11
+ children: /* @__PURE__ */ o(
13
12
  "path",
14
13
  {
15
14
  stroke: "currentColor",
@@ -21,5 +20,6 @@ const ArrowRight2Icon = (props) => /* @__PURE__ */ jsx(
21
20
  )
22
21
  }
23
22
  );
24
-
25
- export { ArrowRight2Icon as A };
23
+ export {
24
+ e as A
25
+ };
@@ -1,72 +1 @@
1
- 'use strict';
2
-
3
- require('../assets/styles.css');const jsxRuntime = require('react/jsx-runtime');
4
- ;/* empty css */
5
-
6
- function styleBadge(options) {
7
- const defaultClassName = "inline-flex items-center justify-center rounded-[20px]";
8
- const typeClassName = {
9
- twoTone: {
10
- primary: "bg-primary-50 text-primary-600",
11
- secondary: "bg-secondary-100 text-secondary-700",
12
- gray: "bg-gray-100 text-gray-600",
13
- success: "bg-success-50 text-success-800",
14
- error: "bg-error-50 text-error-600",
15
- warning: "bg-warning-50 text-warning-700"
16
- },
17
- solid: {
18
- primary: "bg-primary-500 text-white",
19
- secondary: "bg-secondary-600 text-white",
20
- gray: "bg-gray-600 text-white",
21
- success: "bg-success-600 text-white",
22
- error: "bg-error-500 text-white",
23
- warning: "bg-warning-500 text-black"
24
- }
25
- };
26
- const textSizeClassName = {
27
- small: "font-oveline-demibold py-1 px-2 gap-[2px]",
28
- medium: "font-caption-demibold py-1 px-[10px] gap-1",
29
- large: "font-button-small py-2 px-4 gap-[6px]"
30
- };
31
- const numberSizeClassName = {
32
- small: "font-caption-demibold py-[2px] px-[6px] min-w-5",
33
- medium: "font-p3-medium px-[6px] min-w-6",
34
- large: "font-h5-bold py-[2px] px-2 min-w-8"
35
- };
36
- return [
37
- defaultClassName,
38
- typeClassName[options.type][options.color],
39
- options.valueType === "text" ? textSizeClassName[options.size] : numberSizeClassName[options.size],
40
- options.className.length > 0 ? options.className : ""
41
- ].slice().join(" ");
42
- }
43
- function getIconSize(badgSize) {
44
- if (badgSize === "small") return "w-3 h-3";
45
- if (badgSize === "medium") return "w-[14px] h-[14px]";
46
- return "w-4 h-4";
47
- }
48
- const Badge = (props) => {
49
- const {
50
- type = "solid",
51
- color = "primary",
52
- size = "medium",
53
- valueType = "text",
54
- value,
55
- width,
56
- className = ""
57
- } = props;
58
- const icon = props.icon;
59
- return /* @__PURE__ */ jsxRuntime.jsxs(
60
- "div",
61
- {
62
- className: styleBadge({ type, color, size, valueType, className }),
63
- style: { width: width ?? "auto" },
64
- children: [
65
- icon && valueType === "text" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: getIconSize(size), children: icon }),
66
- value
67
- ]
68
- }
69
- );
70
- };
71
-
72
- module.exports = Badge;
1
+ "use strict";require('../assets/styles.css');const d=require("react/jsx-runtime");;/* empty css */function n(i){const e="dgs-ui-kit-inline-flex dgs-ui-kit-items-center dgs-ui-kit-justify-center dgs-ui-kit-rounded-[20px]",g={twoTone:{primary:"dgs-ui-kit-bg-primary-50 dgs-ui-kit-text-primary-600",secondary:"dgs-ui-kit-bg-secondary-100 dgs-ui-kit-text-secondary-700",gray:"dgs-ui-kit-bg-gray-100 dgs-ui-kit-text-gray-600",success:"dgs-ui-kit-bg-success-50 dgs-ui-kit-text-success-800",error:"dgs-ui-kit-bg-error-50 dgs-ui-kit-text-error-600",warning:"dgs-ui-kit-bg-warning-50 dgs-ui-kit-text-warning-700"},solid:{primary:"dgs-ui-kit-bg-primary-500 dgs-ui-kit-text-white",secondary:"dgs-ui-kit-bg-secondary-600 dgs-ui-kit-text-white",gray:"dgs-ui-kit-bg-gray-600 dgs-ui-kit-text-white",success:"dgs-ui-kit-bg-success-600 dgs-ui-kit-text-white",error:"dgs-ui-kit-bg-error-500 dgs-ui-kit-text-white",warning:"dgs-ui-kit-bg-warning-500 dgs-ui-kit-text-black"}},t={small:"dgs-ui-kit-font-oveline-demibold dgs-ui-kit-py-1 dgs-ui-kit-px-2 dgs-ui-kit-gap-[2px]",medium:"dgs-ui-kit-font-caption-demibold dgs-ui-kit-py-1 dgs-ui-kit-px-[10px] dgs-ui-kit-gap-1",large:"dgs-ui-kit-font-button-small dgs-ui-kit-py-2 dgs-ui-kit-px-4 dgs-ui-kit-gap-[6px]"},s={small:"dgs-ui-kit-font-caption-demibold dgs-ui-kit-py-[2px] dgs-ui-kit-px-[6px] dgs-ui-kit-min-w-5",medium:"dgs-ui-kit-font-p3-medium dgs-ui-kit-px-[6px] dgs-ui-kit-min-w-6",large:"dgs-ui-kit-font-h5-bold dgs-ui-kit-py-[2px] dgs-ui-kit-px-2 dgs-ui-kit-min-w-8"};return[e,g[i.type][i.color],i.valueType==="text"?t[i.size]:s[i.size],i.className.length>0?i.className:""].slice().join(" ")}function c(i){return i==="small"?"dgs-ui-kit-w-3 dgs-ui-kit-h-3":i==="medium"?"dgs-ui-kit-w-[14px] dgs-ui-kit-h-[14px]":"dgs-ui-kit-w-4 dgs-ui-kit-h-4"}const l=i=>{const{type:e="solid",color:g="primary",size:t="medium",valueType:s="text",value:r,width:a,className:k=""}=i,u=i.icon;return d.jsxs("div",{className:n({type:e,color:g,size:t,valueType:s,className:k}),style:{width:a??"auto"},children:[u&&s==="text"&&d.jsx("span",{className:c(t),children:u}),r]})};module.exports=l;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/Badge/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,kBAAkB,CAAC;AAE1B,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IAC3E,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC9B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,kBAAmB,SAAQ,cAAc;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,UAAU,qBAAsB,SAAQ,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC;IAClE,SAAS,EAAE,QAAQ,CAAC;CACrB;AAED,KAAK,UAAU,GAAG,kBAAkB,GAAG,qBAAqB,CAAC;AAyD7D,QAAA,MAAM,KAAK,UAAW,UAAU,4CAsB/B,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/Badge/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,kBAAkB,CAAC;AAE1B,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IAC3E,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC9B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,kBAAmB,SAAQ,cAAc;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,UAAU,qBAAsB,SAAQ,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC;IAClE,SAAS,EAAE,QAAQ,CAAC;CACrB;AAED,KAAK,UAAU,GAAG,kBAAkB,GAAG,qBAAqB,CAAC;AA4D7D,QAAA,MAAM,KAAK,UAAW,UAAU,4CAsB/B,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -1,70 +1,64 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
1
+ import { jsxs as k, jsx as n } from "react/jsx-runtime";
2
2
  import '../assets/styles.css';/* empty css */
3
-
4
- function styleBadge(options) {
5
- const defaultClassName = "inline-flex items-center justify-center rounded-[20px]";
6
- const typeClassName = {
3
+ function c(i) {
4
+ const e = "dgs-ui-kit-inline-flex dgs-ui-kit-items-center dgs-ui-kit-justify-center dgs-ui-kit-rounded-[20px]", g = {
7
5
  twoTone: {
8
- primary: "bg-primary-50 text-primary-600",
9
- secondary: "bg-secondary-100 text-secondary-700",
10
- gray: "bg-gray-100 text-gray-600",
11
- success: "bg-success-50 text-success-800",
12
- error: "bg-error-50 text-error-600",
13
- warning: "bg-warning-50 text-warning-700"
6
+ primary: "dgs-ui-kit-bg-primary-50 dgs-ui-kit-text-primary-600",
7
+ secondary: "dgs-ui-kit-bg-secondary-100 dgs-ui-kit-text-secondary-700",
8
+ gray: "dgs-ui-kit-bg-gray-100 dgs-ui-kit-text-gray-600",
9
+ success: "dgs-ui-kit-bg-success-50 dgs-ui-kit-text-success-800",
10
+ error: "dgs-ui-kit-bg-error-50 dgs-ui-kit-text-error-600",
11
+ warning: "dgs-ui-kit-bg-warning-50 dgs-ui-kit-text-warning-700"
14
12
  },
15
13
  solid: {
16
- primary: "bg-primary-500 text-white",
17
- secondary: "bg-secondary-600 text-white",
18
- gray: "bg-gray-600 text-white",
19
- success: "bg-success-600 text-white",
20
- error: "bg-error-500 text-white",
21
- warning: "bg-warning-500 text-black"
14
+ primary: "dgs-ui-kit-bg-primary-500 dgs-ui-kit-text-white",
15
+ secondary: "dgs-ui-kit-bg-secondary-600 dgs-ui-kit-text-white",
16
+ gray: "dgs-ui-kit-bg-gray-600 dgs-ui-kit-text-white",
17
+ success: "dgs-ui-kit-bg-success-600 dgs-ui-kit-text-white",
18
+ error: "dgs-ui-kit-bg-error-500 dgs-ui-kit-text-white",
19
+ warning: "dgs-ui-kit-bg-warning-500 dgs-ui-kit-text-black"
22
20
  }
23
- };
24
- const textSizeClassName = {
25
- small: "font-oveline-demibold py-1 px-2 gap-[2px]",
26
- medium: "font-caption-demibold py-1 px-[10px] gap-1",
27
- large: "font-button-small py-2 px-4 gap-[6px]"
28
- };
29
- const numberSizeClassName = {
30
- small: "font-caption-demibold py-[2px] px-[6px] min-w-5",
31
- medium: "font-p3-medium px-[6px] min-w-6",
32
- large: "font-h5-bold py-[2px] px-2 min-w-8"
21
+ }, t = {
22
+ small: "dgs-ui-kit-font-oveline-demibold dgs-ui-kit-py-1 dgs-ui-kit-px-2 dgs-ui-kit-gap-[2px]",
23
+ medium: "dgs-ui-kit-font-caption-demibold dgs-ui-kit-py-1 dgs-ui-kit-px-[10px] dgs-ui-kit-gap-1",
24
+ large: "dgs-ui-kit-font-button-small dgs-ui-kit-py-2 dgs-ui-kit-px-4 dgs-ui-kit-gap-[6px]"
25
+ }, s = {
26
+ small: "dgs-ui-kit-font-caption-demibold dgs-ui-kit-py-[2px] dgs-ui-kit-px-[6px] dgs-ui-kit-min-w-5",
27
+ medium: "dgs-ui-kit-font-p3-medium dgs-ui-kit-px-[6px] dgs-ui-kit-min-w-6",
28
+ large: "dgs-ui-kit-font-h5-bold dgs-ui-kit-py-[2px] dgs-ui-kit-px-2 dgs-ui-kit-min-w-8"
33
29
  };
34
30
  return [
35
- defaultClassName,
36
- typeClassName[options.type][options.color],
37
- options.valueType === "text" ? textSizeClassName[options.size] : numberSizeClassName[options.size],
38
- options.className.length > 0 ? options.className : ""
31
+ e,
32
+ g[i.type][i.color],
33
+ i.valueType === "text" ? t[i.size] : s[i.size],
34
+ i.className.length > 0 ? i.className : ""
39
35
  ].slice().join(" ");
40
36
  }
41
- function getIconSize(badgSize) {
42
- if (badgSize === "small") return "w-3 h-3";
43
- if (badgSize === "medium") return "w-[14px] h-[14px]";
44
- return "w-4 h-4";
37
+ function l(i) {
38
+ return i === "small" ? "dgs-ui-kit-w-3 dgs-ui-kit-h-3" : i === "medium" ? "dgs-ui-kit-w-[14px] dgs-ui-kit-h-[14px]" : "dgs-ui-kit-w-4 dgs-ui-kit-h-4";
45
39
  }
46
- const Badge = (props) => {
40
+ const x = (i) => {
47
41
  const {
48
- type = "solid",
49
- color = "primary",
50
- size = "medium",
51
- valueType = "text",
52
- value,
53
- width,
54
- className = ""
55
- } = props;
56
- const icon = props.icon;
57
- return /* @__PURE__ */ jsxs(
42
+ type: e = "solid",
43
+ color: g = "primary",
44
+ size: t = "medium",
45
+ valueType: s = "text",
46
+ value: u,
47
+ width: r,
48
+ className: a = ""
49
+ } = i, d = i.icon;
50
+ return /* @__PURE__ */ k(
58
51
  "div",
59
52
  {
60
- className: styleBadge({ type, color, size, valueType, className }),
61
- style: { width: width ?? "auto" },
53
+ className: c({ type: e, color: g, size: t, valueType: s, className: a }),
54
+ style: { width: r ?? "auto" },
62
55
  children: [
63
- icon && valueType === "text" && /* @__PURE__ */ jsx("span", { className: getIconSize(size), children: icon }),
64
- value
56
+ d && s === "text" && /* @__PURE__ */ n("span", { className: l(t), children: d }),
57
+ u
65
58
  ]
66
59
  }
67
60
  );
68
61
  };
69
-
70
- export { Badge as default };
62
+ export {
63
+ x as default
64
+ };