@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.
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -32
- package/dist/patterns/table/TableWrapper.d.ts +6 -3
- package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
- package/dist/patterns/table/TableWrapper.js +145 -0
- package/dist/patterns/table/table.d.ts +5 -3
- package/dist/patterns/table/table.d.ts.map +1 -1
- package/dist/patterns/table/table.js +195 -173
- package/dist/primitives/badge/badge-types.d.ts +1 -1
- package/dist/primitives/badge/badge-types.d.ts.map +1 -1
- package/dist/primitives/badge/badge.d.ts.map +1 -1
- package/dist/primitives/badge/badge.js +89 -109
- package/dist/styles/components.css +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
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
|
|
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(([
|
|
74
|
-
),
|
|
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 = (
|
|
101
|
-
const { type: s = "pill-color", size:
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
108
|
-
|
|
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__ */
|
|
117
|
-
}, T = (
|
|
118
|
-
const { size: s = "
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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 =
|
|
133
|
-
return /* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
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 = (
|
|
133
|
+
}, W = (e) => {
|
|
138
134
|
const {
|
|
139
|
-
size: s = "
|
|
140
|
-
color:
|
|
141
|
-
type:
|
|
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
|
-
} =
|
|
147
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
},
|
|
164
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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]:
|
|
183
|
-
[t.modern]:
|
|
170
|
+
[t.color]: b,
|
|
171
|
+
[t.modern]: b
|
|
184
172
|
};
|
|
185
|
-
return /* @__PURE__ */
|
|
186
|
-
p && /* @__PURE__ */
|
|
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__ */
|
|
176
|
+
o && /* @__PURE__ */ u(f, { children: o })
|
|
189
177
|
] });
|
|
190
|
-
}, L = (
|
|
191
|
-
const { size: s = "
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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__ */
|
|
207
|
-
/* @__PURE__ */
|
|
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/${
|
|
196
|
+
src: `https://www.untitledui.com/images/flags/${i}.svg`,
|
|
211
197
|
className: "size-4 max-w-none rounded-full",
|
|
212
|
-
alt: `${
|
|
198
|
+
alt: `${i} flag`
|
|
213
199
|
}
|
|
214
200
|
),
|
|
215
201
|
o
|
|
216
202
|
] });
|
|
217
|
-
}, O = (
|
|
218
|
-
const { size: s = "
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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__ */
|
|
234
|
-
/* @__PURE__ */
|
|
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 = (
|
|
238
|
-
const { size: s = "
|
|
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
|
|
242
|
-
lg: "gap-0.5 py-
|
|
243
|
-
},
|
|
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-
|
|
247
|
-
lg: "gap-0.5 py-
|
|
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]:
|
|
251
|
-
[t.modern]:
|
|
232
|
+
[t.color]: m,
|
|
233
|
+
[t.modern]: m
|
|
252
234
|
};
|
|
253
|
-
return /* @__PURE__ */
|
|
235
|
+
return /* @__PURE__ */ c("span", { className: d(n.common, g[i][s], n.styles[a].root), children: [
|
|
254
236
|
l,
|
|
255
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ u(
|
|
256
238
|
"button",
|
|
257
239
|
{
|
|
258
240
|
type: "button",
|
|
259
241
|
"aria-label": o,
|
|
260
|
-
onClick:
|
|
261
|
-
className:
|
|
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[
|
|
264
|
-
|
|
245
|
+
n.styles[a].addonButton,
|
|
246
|
+
i === "pill-color" ? "rounded-full" : "rounded-[3px]"
|
|
265
247
|
),
|
|
266
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ u(p, { className: "size-3 stroke-[3px] transition-inherit-all" })
|
|
267
249
|
}
|
|
268
250
|
)
|
|
269
251
|
] });
|
|
270
|
-
}, F = (
|
|
271
|
-
const { size: s = "
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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
|
-
|
|
278
|
-
|
|
279
|
-
|
|
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__ */
|
|
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,
|