@pibit.ai/cure-design-system 0.3.7 → 0.3.8

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.
@@ -1,8 +1,8 @@
1
- import { jsx as d, jsxs as x, Fragment as b } from "react/jsx-runtime";
1
+ import { jsx as u, jsxs as c, Fragment as f } from "react/jsx-runtime";
2
2
  import { X as v } from "@untitledui/icons";
3
3
  import { Dot as w } from "../../foundations/dot-icon/index.js";
4
4
  import { badgeTypes as t } from "./badge-types.js";
5
- import { cx as u } from "../../utils/cn.js";
5
+ import { cx as d } from "../../utils/cn.js";
6
6
  const y = {
7
7
  clear: {
8
8
  root: "bg-primary text-secondary ring-secondary",
@@ -70,8 +70,8 @@ const y = {
70
70
  addonButton: "hover:bg-utility-orange-100 text-utility-orange-400 hover:text-utility-orange-500"
71
71
  }
72
72
  }, B = Object.fromEntries(
73
- Object.entries(y).map(([i, s]) => [i, { root: "", addon: s.addon }])
74
- ), c = {
73
+ Object.entries(y).map(([e, s]) => [e, { root: "", addon: s.addon }])
74
+ ), x = {
75
75
  [t.pillColor]: {
76
76
  common: "size-max flex items-center whitespace-nowrap rounded-full ring-1 ring-inset",
77
77
  styles: y
@@ -97,193 +97,173 @@ const y = {
97
97
  common: "size-max flex items-center whitespace-nowrap rounded-sm ring-1 ring-inset bg-primary text-secondary ring-secondary",
98
98
  styles: B
99
99
  }
100
- }, j = (i) => {
101
- const { type: s = "pill-color", size: m = "xs", color: e = "gray", children: p } = i, o = c[s], l = {
102
- xs: "py-0.5 px-2 text-xs font-medium",
103
- sm: "py-0.5 px-2 text-sm font-medium",
104
- md: "py-1 px-3 text-sm font-medium",
100
+ }, j = (e) => {
101
+ const { type: s = "pill-color", size: a = "sm", color: i = "gray", children: p } = e, o = x[s], l = {
102
+ sm: "py-0.5 px-2 text-xs font-medium",
103
+ md: "py-0.5 px-2 text-sm font-medium",
105
104
  lg: "py-1 px-3 text-sm font-medium"
106
105
  }, n = {
107
- xs: "py-0.5 px-2 text-xs font-medium",
108
- sm: "py-0.5 px-2 text-sm font-medium",
109
- md: "py-1 px-3 text-sm font-medium",
106
+ sm: "py-0.5 px-2 text-xs font-medium",
107
+ md: "py-0.5 px-2 text-sm font-medium",
110
108
  lg: "py-1 px-3 text-sm font-medium rounded-lg"
111
109
  }, r = {
112
110
  [t.pillColor]: l,
113
111
  [t.color]: n,
114
112
  [t.modern]: n
115
113
  };
116
- return /* @__PURE__ */ d("span", { className: u(o.common, r[s][m], o.styles[e].root, i.className), children: p });
117
- }, T = (i) => {
118
- const { size: s = "md", color: m = "gray", type: e = "pill-color", className: p, children: o } = i, l = h[e], n = {
119
- xs: "gap-0.5 py-0.5 px-1 text-xs font-medium",
120
- sm: "gap-1 py-0.5 pl-1.5 pr-2 text-xs font-medium",
121
- md: "gap-1.5 py-0.5 pl-2 pr-2.5 text-sm font-medium",
122
- lg: "gap-1.5 py-1 pl-2.5 pr-3 text-sm font-medium"
114
+ return /* @__PURE__ */ u("span", { className: d(o.common, r[s][a], o.styles[i].root, e.className), children: p });
115
+ }, T = (e) => {
116
+ const { size: s = "sm", color: a = "gray", type: i = "pill-color", className: p, children: o } = e, l = h[i], n = {
117
+ sm: "gap-0.5 py-0.5 px-1 text-xs font-medium",
118
+ md: "gap-1 py-0.5 pl-1.5 pr-2 text-xs font-medium",
119
+ lg: "gap-1.5 py-0.5 pl-2 pr-2.5 text-sm font-medium"
123
120
  }, r = {
124
- xs: "gap-0.5 py-0.5 px-1 text-xs font-medium",
125
- sm: "gap-1 py-0.5 px-1.5 text-xs font-medium",
126
- md: "gap-1.5 py-0.5 px-2 text-sm font-medium",
127
- lg: "gap-1.5 py-1 px-2.5 text-sm font-medium rounded-lg"
128
- }, a = {
121
+ sm: "gap-0.5 py-0.5 px-1 text-xs font-medium",
122
+ md: "gap-1 py-0.5 px-1.5 text-xs font-medium",
123
+ lg: "gap-1.5 py-0.5 px-2 text-sm font-medium"
124
+ }, m = {
129
125
  [t.pillColor]: n,
130
126
  [t.color]: r,
131
127
  [t.modern]: r
132
- }, g = m;
133
- return /* @__PURE__ */ x("span", { className: u(l.common, a[e][s], l.styles[g].root, p), children: [
134
- /* @__PURE__ */ d(w, { className: l.styles[g].addon, size: "sm" }),
128
+ }, g = a;
129
+ return /* @__PURE__ */ c("span", { className: d(l.common, m[i][s], l.styles[g].root, p), children: [
130
+ /* @__PURE__ */ u(w, { className: l.styles[g].addon, size: "sm" }),
135
131
  o
136
132
  ] });
137
- }, W = (i) => {
133
+ }, W = (e) => {
138
134
  const {
139
- size: s = "md",
140
- color: m = "gray",
141
- type: e = "pill-color",
135
+ size: s = "sm",
136
+ color: a = "gray",
137
+ type: i = "pill-color",
142
138
  iconLeading: p,
143
139
  iconTrailing: o,
144
140
  children: l,
145
141
  className: n
146
- } = i, r = h[e], a = p ? "leading" : "trailing", g = {
147
- xs: {
142
+ } = e, r = h[i], m = p ? "leading" : "trailing", g = {
143
+ sm: {
148
144
  trailing: "gap-0.5 py-0.5 px-1 text-xs font-medium",
149
145
  leading: "gap-0.5 py-0.5 px-1 text-xs font-medium"
150
146
  },
151
- sm: {
147
+ md: {
152
148
  trailing: "gap-0.5 py-0.5 pl-2 pr-1.5 text-xs font-medium",
153
149
  leading: "gap-0.5 py-0.5 pr-2 pl-1.5 text-xs font-medium"
154
150
  },
155
- md: {
151
+ lg: {
156
152
  trailing: "gap-1 py-0.5 pl-2.5 pr-2 text-sm font-medium",
157
153
  leading: "gap-1 py-0.5 pr-2.5 pl-2 text-sm font-medium"
158
- },
159
- lg: {
160
- trailing: "gap-1 py-1 pl-3 pr-2.5 text-sm font-medium",
161
- leading: "gap-1 py-1 pr-3 pl-2.5 text-sm font-medium"
162
154
  }
163
- }, f = {
164
- xs: {
155
+ }, b = {
156
+ sm: {
165
157
  trailing: "gap-0.5 py-0.5 px-1 text-xs font-medium",
166
158
  leading: "gap-0.5 py-0.5 px-1 text-xs font-medium"
167
159
  },
168
- sm: {
160
+ md: {
169
161
  trailing: "gap-0.5 py-0.5 pl-2 pr-1.5 text-xs font-medium",
170
162
  leading: "gap-0.5 py-0.5 pr-2 pl-1.5 text-xs font-medium"
171
163
  },
172
- md: {
164
+ lg: {
173
165
  trailing: "gap-1 py-0.5 pl-2 pr-1.5 text-sm font-medium",
174
166
  leading: "gap-1 py-0.5 pr-2 pl-1.5 text-sm font-medium"
175
- },
176
- lg: {
177
- trailing: "gap-1 py-1 pl-2.5 pr-2 text-sm font-medium rounded-lg",
178
- leading: "gap-1 py-1 pr-2.5 pl-2 text-sm font-medium rounded-lg"
179
167
  }
180
168
  }, z = {
181
169
  [t.pillColor]: g,
182
- [t.color]: f,
183
- [t.modern]: f
170
+ [t.color]: b,
171
+ [t.modern]: b
184
172
  };
185
- return /* @__PURE__ */ x("span", { className: u(r.common, z[e][s][a], r.styles[m].root, n), children: [
186
- p && /* @__PURE__ */ d(b, { children: p }),
173
+ return /* @__PURE__ */ c("span", { className: d(r.common, z[i][s][m], r.styles[a].root, n), children: [
174
+ p && /* @__PURE__ */ u(f, { children: p }),
187
175
  l,
188
- o && /* @__PURE__ */ d(b, { children: o })
176
+ o && /* @__PURE__ */ u(f, { children: o })
189
177
  ] });
190
- }, L = (i) => {
191
- const { size: s = "md", color: m = "gray", flag: e = "AU", type: p = "pill-color", children: o } = i, l = c[p], n = {
192
- xs: "gap-0.5 py-0.5 pl-0.75 pr-2 text-xs font-medium",
193
- sm: "gap-1 py-0.5 pl-0.75 pr-2 text-xs font-medium",
194
- md: "gap-1.5 py-0.5 pl-1 pr-2.5 text-sm font-medium",
195
- lg: "gap-1.5 py-1 pl-1.5 pr-3 text-sm font-medium"
178
+ }, L = (e) => {
179
+ const { size: s = "sm", color: a = "gray", flag: i = "AU", type: p = "pill-color", children: o } = e, l = x[p], n = {
180
+ sm: "gap-0.5 py-0.5 pl-0.75 pr-2 text-xs font-medium",
181
+ md: "gap-1 py-0.5 pl-0.75 pr-2 text-xs font-medium",
182
+ lg: "gap-1.5 py-0.5 pl-1 pr-2.5 text-sm font-medium"
196
183
  }, r = {
197
- xs: "gap-0.5 py-0.5 pl-1 pr-1.5 text-xs font-medium",
198
- sm: "gap-1 py-0.5 pl-1 pr-1.5 text-xs font-medium",
199
- md: "gap-1.5 py-0.5 pl-1.5 pr-2 text-sm font-medium",
200
- lg: "gap-1.5 py-1 pl-2 pr-2.5 text-sm font-medium rounded-lg"
201
- }, a = {
184
+ sm: "gap-0.5 py-0.5 pl-1 pr-1.5 text-xs font-medium",
185
+ md: "gap-1 py-0.5 pl-1 pr-1.5 text-xs font-medium",
186
+ lg: "gap-1.5 py-0.5 pl-1.5 pr-2 text-sm font-medium"
187
+ }, m = {
202
188
  [t.pillColor]: n,
203
189
  [t.color]: r,
204
190
  [t.modern]: r
205
191
  };
206
- return /* @__PURE__ */ x("span", { className: u(l.common, a[p][s], l.styles[m].root), children: [
207
- /* @__PURE__ */ d(
192
+ return /* @__PURE__ */ c("span", { className: d(l.common, m[p][s], l.styles[a].root), children: [
193
+ /* @__PURE__ */ u(
208
194
  "img",
209
195
  {
210
- src: `https://www.untitledui.com/images/flags/${e}.svg`,
196
+ src: `https://www.untitledui.com/images/flags/${i}.svg`,
211
197
  className: "size-4 max-w-none rounded-full",
212
- alt: `${e} flag`
198
+ alt: `${i} flag`
213
199
  }
214
200
  ),
215
201
  o
216
202
  ] });
217
- }, O = (i) => {
218
- const { size: s = "md", color: m = "gray", type: e = "pill-color", imgSrc: p, children: o } = i, l = c[e], n = {
219
- xs: "gap-0.5 py-0.5 pl-0.75 pr-2 text-xs font-medium",
220
- sm: "gap-1 py-0.5 pl-0.75 pr-2 text-xs font-medium",
221
- md: "gap-1.5 py-0.5 pl-1 pr-2.5 text-sm font-medium",
222
- lg: "gap-1.5 py-1 pl-1.5 pr-3 text-sm font-medium"
203
+ }, O = (e) => {
204
+ const { size: s = "sm", color: a = "gray", type: i = "pill-color", imgSrc: p, children: o } = e, l = x[i], n = {
205
+ sm: "gap-0.5 py-0.5 pl-0.75 pr-2 text-xs font-medium",
206
+ md: "gap-1 py-0.5 pl-0.75 pr-2 text-xs font-medium",
207
+ lg: "gap-1.5 py-0.5 pl-1 pr-2.5 text-sm font-medium"
223
208
  }, r = {
224
- xs: "gap-0.5 py-0.5 pl-1 pr-1.5 text-xs font-medium",
225
- sm: "gap-1 py-0.5 pl-1 pr-1.5 text-xs font-medium",
226
- md: "gap-1.5 py-0.5 pl-1.5 pr-2 text-sm font-medium",
227
- lg: "gap-1.5 py-1 pl-2 pr-2.5 text-sm font-medium rounded-lg"
228
- }, a = {
209
+ sm: "gap-0.5 py-0.5 pl-1 pr-1.5 text-xs font-medium",
210
+ md: "gap-1 py-0.5 pl-1 pr-1.5 text-xs font-medium",
211
+ lg: "gap-1.5 py-0.5 pl-1.5 pr-2 text-sm font-medium"
212
+ }, m = {
229
213
  [t.pillColor]: n,
230
214
  [t.color]: r,
231
215
  [t.modern]: r
232
216
  };
233
- return /* @__PURE__ */ x("span", { className: u(l.common, a[e][s], l.styles[m].root), children: [
234
- /* @__PURE__ */ d("img", { src: p, className: "size-4 max-w-none rounded-full", alt: "Badge image" }),
217
+ return /* @__PURE__ */ c("span", { className: d(l.common, m[i][s], l.styles[a].root), children: [
218
+ /* @__PURE__ */ u("img", { src: p, className: "size-4 max-w-none rounded-full", alt: "Badge image" }),
235
219
  o
236
220
  ] });
237
- }, D = (i) => {
238
- const { size: s = "md", color: m = "gray", type: e = "pill-color", icon: p = v, buttonLabel: o, children: l } = i, n = c[e], r = {
239
- xs: "gap-0.5 py-0.5 pl-2 pr-0.75 text-xs font-medium",
221
+ }, D = (e) => {
222
+ const { size: s = "sm", color: a = "gray", type: i = "pill-color", icon: p = v, buttonLabel: o, children: l } = e, n = x[i], r = {
240
223
  sm: "gap-0.5 py-0.5 pl-2 pr-0.75 text-xs font-medium",
241
- md: "gap-0.5 py-0.5 pl-2.5 pr-1 text-sm font-medium",
242
- lg: "gap-0.5 py-1 pl-3 pr-1.5 text-sm font-medium"
243
- }, a = {
244
- xs: "gap-0.5 py-0.5 pl-1.5 pr-0.75 text-xs font-medium",
224
+ md: "gap-0.5 py-0.5 pl-2 pr-0.75 text-xs font-medium",
225
+ lg: "gap-0.5 py-0.5 pl-2.5 pr-1 text-sm font-medium"
226
+ }, m = {
245
227
  sm: "gap-0.5 py-0.5 pl-1.5 pr-0.75 text-xs font-medium",
246
- md: "gap-0.5 py-0.5 pl-2 pr-1 text-sm font-medium",
247
- lg: "gap-0.5 py-1 pl-2.5 pr-1.5 text-sm font-medium rounded-lg"
228
+ md: "gap-0.5 py-0.5 pl-1.5 pr-0.75 text-xs font-medium",
229
+ lg: "gap-0.5 py-0.5 pl-2 pr-1 text-sm font-medium"
248
230
  }, g = {
249
231
  [t.pillColor]: r,
250
- [t.color]: a,
251
- [t.modern]: a
232
+ [t.color]: m,
233
+ [t.modern]: m
252
234
  };
253
- return /* @__PURE__ */ x("span", { className: u(n.common, g[e][s], n.styles[m].root), children: [
235
+ return /* @__PURE__ */ c("span", { className: d(n.common, g[i][s], n.styles[a].root), children: [
254
236
  l,
255
- /* @__PURE__ */ d(
237
+ /* @__PURE__ */ u(
256
238
  "button",
257
239
  {
258
240
  type: "button",
259
241
  "aria-label": o,
260
- onClick: i.onButtonClick,
261
- className: u(
242
+ onClick: e.onButtonClick,
243
+ className: d(
262
244
  "flex cursor-pointer items-center justify-center p-0.5 outline-focus-ring transition duration-100 ease-linear focus-visible:outline-2",
263
- n.styles[m].addonButton,
264
- e === "pill-color" ? "rounded-full" : "rounded-[3px]"
245
+ n.styles[a].addonButton,
246
+ i === "pill-color" ? "rounded-full" : "rounded-[3px]"
265
247
  ),
266
- children: /* @__PURE__ */ d(p, { className: "size-3 stroke-[3px] transition-inherit-all" })
248
+ children: /* @__PURE__ */ u(p, { className: "size-3 stroke-[3px] transition-inherit-all" })
267
249
  }
268
250
  )
269
251
  ] });
270
- }, F = (i) => {
271
- const { size: s = "md", color: m = "gray", type: e = "pill-color", icon: p } = i, o = c[e], l = {
272
- xs: "p-1",
273
- sm: "p-1.25",
274
- md: "p-1.5",
275
- lg: "p-2"
252
+ }, F = (e) => {
253
+ const { size: s = "sm", color: a = "gray", type: i = "pill-color", icon: p } = e, o = x[i], l = {
254
+ sm: "p-1",
255
+ md: "p-1.25",
256
+ lg: "p-1.5"
276
257
  }, n = {
277
- xs: "p-1",
278
- sm: "p-1.25",
279
- md: "p-1.5",
280
- lg: "p-2 rounded-lg"
258
+ sm: "p-1",
259
+ md: "p-1.25",
260
+ lg: "p-1.5"
281
261
  }, r = {
282
262
  [t.pillColor]: l,
283
263
  [t.color]: n,
284
264
  [t.modern]: n
285
265
  };
286
- return /* @__PURE__ */ d("span", { className: u(o.common, r[e][s], o.styles[m].root), children: /* @__PURE__ */ d(p, { className: u("size-3 stroke-[3px]", o.styles[m].addon) }) });
266
+ return /* @__PURE__ */ u("span", { className: d(o.common, r[i][s], o.styles[a].root), children: /* @__PURE__ */ u(p, { className: d("size-3 stroke-[3px]", o.styles[a].addon) }) });
287
267
  };
288
268
  export {
289
269
  j as Badge,