@clubmed/trident-ui 2.0.0-beta.70 → 2.0.0-beta.74
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/chunks/CriteriaParticipants.js +91 -91
- package/chunks/DateField.js +12 -12
- package/examples/accordion-demo.d.ts +1 -0
- package/examples/accordion-demo.js +79 -0
- package/examples/accordion-demo.js.map +1 -0
- package/examples/accordion-multiple-demo.d.ts +1 -0
- package/examples/accordion-multiple-demo.js +79 -0
- package/examples/accordion-multiple-demo.js.map +1 -0
- package/examples/accordion-trigger-wrapper-demo.d.ts +1 -0
- package/examples/accordion-trigger-wrapper-demo.js +80 -0
- package/examples/accordion-trigger-wrapper-demo.js.map +1 -0
- package/examples/avatar-demo.js +7 -7
- package/examples/card-list-demo.js +10 -10
- package/examples/card-no-border-demo.js +7 -7
- package/examples/chip-demo.js +4 -4
- package/examples/criteria-transports-b2b-demo.d.ts +1 -0
- package/examples/criteria-transports-b2b-demo.js +51 -0
- package/examples/criteria-transports-b2b-demo.js.map +1 -0
- package/examples/criteria-transports-b2c-demo.d.ts +1 -0
- package/examples/criteria-transports-b2c-demo.js +37 -0
- package/examples/criteria-transports-b2c-demo.js.map +1 -0
- package/examples/criteria-transports-data.d.ts +7 -0
- package/examples/criteria-transports-data.js +151 -0
- package/examples/criteria-transports-data.js.map +1 -0
- package/examples/criteria-transports-demo.d.ts +1 -0
- package/examples/criteria-transports-demo.js +34 -0
- package/examples/criteria-transports-demo.js.map +1 -0
- package/examples/criteria-transports-error-demo.d.ts +1 -0
- package/examples/criteria-transports-error-demo.js +29 -0
- package/examples/criteria-transports-error-demo.js.map +1 -0
- package/examples/filter-demo.js +5 -5
- package/examples/radio-select-demo.d.ts +1 -0
- package/examples/radio-select-demo.js +100 -0
- package/examples/radio-select-demo.js.map +1 -0
- package/package.json +1 -1
- package/ui/Accordion.d.ts +30 -0
- package/ui/Accordion.js +71 -0
- package/ui/Accordion.js.map +1 -0
- package/ui/AdvancedToast.js +15 -15
- package/ui/BasicToast.js +10 -10
- package/ui/Breadcrumb.js +6 -6
- package/ui/ChatButton.js +7 -7
- package/ui/ChatWindow.js +27 -27
- package/ui/ChatWindowCsatPrompt.js +13 -13
- package/ui/ChatWindowCsatThankYou.js +7 -7
- package/ui/Chip.js +4 -4
- package/ui/ChoiceExpander.js +16 -16
- package/ui/Dropdown.js +6 -6
- package/ui/Link.js +7 -7
- package/ui/PageNavigation.js +11 -11
- package/ui/Pagination.js +21 -21
- package/ui/SidebarLayout.js +35 -35
- package/ui/Tag.js +6 -6
- package/ui/buttons/ButtonContent.js +3 -3
- package/ui/criteria/CriteriaTransports.d.ts +72 -0
- package/ui/criteria/CriteriaTransports.js +224 -0
- package/ui/criteria/CriteriaTransports.js.map +1 -0
- package/ui/forms/CheckboxSelect.js +19 -19
- package/ui/forms/CheckboxSelect.js.map +1 -1
- package/ui/forms/Filter.js +9 -9
- package/ui/forms/FloatingLabelTextField.js +18 -18
- package/ui/forms/FormControlError.js +4 -4
- package/ui/forms/NumberField.d.ts +23 -23
- package/ui/forms/PhoneField.js +1 -1
- package/ui/forms/PhoneFieldFullInput.js +9 -9
- package/ui/forms/PhoneFieldSplitInput.js +14 -14
- package/ui/forms/RadioSelect.d.ts +31 -0
- package/ui/forms/RadioSelect.js +117 -0
- package/ui/forms/RadioSelect.js.map +1 -0
- package/ui/forms/Select.js +11 -11
- package/ui/forms/TextField.js +16 -16
- package/ui/forms/checkboxes/Checkbox.js +8 -8
- package/ui/forms/password/Password.js +13 -13
- package/ui/forms/password/ValidationMessage.js +5 -5
- package/ui/journey-card/FlightSegmentCard.js +21 -21
- package/ui/journey-card/ItineraryDetails.js +10 -10
- package/ui/journey-card/JourneyDetails.js +45 -45
- package/examples/criteria-transport-demo.d.ts +0 -1
- package/examples/criteria-transport-demo.js +0 -66
- package/examples/criteria-transport-demo.js.map +0 -1
- package/ui/criteria/CriteriaTransport.d.ts +0 -37
- package/ui/criteria/CriteriaTransport.js +0 -116
- package/ui/criteria/CriteriaTransport.js.map +0 -1
|
@@ -12,8 +12,8 @@ import { Toggle as d } from "../ui/Toggle.js";
|
|
|
12
12
|
import { NumberField as f } from "../ui/forms/NumberField.js";
|
|
13
13
|
import { Switch as p } from "../ui/forms/Switch.js";
|
|
14
14
|
import { useEffect as m, useRef as h, useState as g } from "react";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
16
|
+
import { Icon as y } from "@clubmed/trident-icons";
|
|
17
17
|
//#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/compareAsc.js
|
|
18
18
|
function b(e, t) {
|
|
19
19
|
let n = a(e) - +a(t);
|
|
@@ -65,7 +65,7 @@ function D(e, t) {
|
|
|
65
65
|
function O(e, t, n) {
|
|
66
66
|
if (t != null) {
|
|
67
67
|
let e = t.unit === "year" ? n.ageYear ?? "years" : n.ageMonths ?? "months";
|
|
68
|
-
return /* @__PURE__ */
|
|
68
|
+
return /* @__PURE__ */ _("span", {
|
|
69
69
|
className: "text-b5 font-normal",
|
|
70
70
|
children: `${t.value} ${e}`
|
|
71
71
|
});
|
|
@@ -78,7 +78,7 @@ function O(e, t, n) {
|
|
|
78
78
|
}
|
|
79
79
|
return "";
|
|
80
80
|
}
|
|
81
|
-
var k = ({ label: e, description: t, addLabel: n, removeLabel: r, min: i, max: a, value: o, onChange: s }) => /* @__PURE__ */
|
|
81
|
+
var k = ({ label: e, description: t, addLabel: n, removeLabel: r, min: i, max: a, value: o, onChange: s }) => /* @__PURE__ */ _(f, {
|
|
82
82
|
controlled: !0,
|
|
83
83
|
description: t ?? void 0,
|
|
84
84
|
label: e,
|
|
@@ -92,27 +92,27 @@ var k = ({ label: e, description: t, addLabel: n, removeLabel: r, min: i, max: a
|
|
|
92
92
|
onChange: (e, t) => s(t),
|
|
93
93
|
value: o,
|
|
94
94
|
className: "w-full justify-between"
|
|
95
|
-
}), A = /* @__PURE__ */
|
|
95
|
+
}), A = /* @__PURE__ */ _(y, {
|
|
96
96
|
"aria-hidden": !0,
|
|
97
97
|
name: "CrossOutlined",
|
|
98
98
|
width: "20px"
|
|
99
|
-
}), j = ({ label: e, ariaLabel: t, onClick: n, type: r, ageLabel: i }) => /* @__PURE__ */
|
|
99
|
+
}), j = ({ label: e, ariaLabel: t, onClick: n, type: r, ageLabel: i }) => /* @__PURE__ */ v("button", {
|
|
100
100
|
"aria-label": t,
|
|
101
101
|
className: "rounded-32 border-black flex items-center justify-between gap-4 border px-12 py-6 text-b4 font-semibold",
|
|
102
102
|
onClick: n,
|
|
103
103
|
type: "button",
|
|
104
|
-
children: [/* @__PURE__ */
|
|
104
|
+
children: [/* @__PURE__ */ v("span", {
|
|
105
105
|
className: "flex items-center",
|
|
106
106
|
children: [
|
|
107
|
-
r === "adult" ? /* @__PURE__ */
|
|
107
|
+
r === "adult" ? /* @__PURE__ */ _(y, {
|
|
108
108
|
name: "PeopleSingle",
|
|
109
109
|
width: "24px"
|
|
110
|
-
}) : /* @__PURE__ */
|
|
110
|
+
}) : /* @__PURE__ */ _(y, {
|
|
111
111
|
name: "PeopleKids",
|
|
112
112
|
width: "24px"
|
|
113
113
|
}),
|
|
114
114
|
e,
|
|
115
|
-
i && /* @__PURE__ */
|
|
115
|
+
i && /* @__PURE__ */ v("span", {
|
|
116
116
|
className: "ms-4 text-b5 font-normal",
|
|
117
117
|
children: [
|
|
118
118
|
"(",
|
|
@@ -122,52 +122,52 @@ var k = ({ label: e, description: t, addLabel: n, removeLabel: r, min: i, max: a
|
|
|
122
122
|
})
|
|
123
123
|
]
|
|
124
124
|
}), A]
|
|
125
|
-
}), M = ({ onReset: e, onApply: t, resetLabel: r, applyLabel: i, withSpacer: a }) => !e && !t ? null : /* @__PURE__ */
|
|
125
|
+
}), M = ({ onReset: e, onApply: t, resetLabel: r, applyLabel: i, withSpacer: a }) => !e && !t ? null : /* @__PURE__ */ v("div", {
|
|
126
126
|
className: "flex items-center justify-between",
|
|
127
|
-
children: [e && r ? /* @__PURE__ */
|
|
127
|
+
children: [e && r ? /* @__PURE__ */ _("button", {
|
|
128
128
|
className: "text-b3 cursor-pointer font-semibold underline",
|
|
129
129
|
onClick: e,
|
|
130
130
|
type: "button",
|
|
131
131
|
children: r
|
|
132
|
-
}) : a ? /* @__PURE__ */
|
|
132
|
+
}) : a ? /* @__PURE__ */ _("span", {}) : null, t && i && /* @__PURE__ */ _(n, {
|
|
133
133
|
color: "saffron",
|
|
134
134
|
onClick: t,
|
|
135
135
|
children: i
|
|
136
136
|
})]
|
|
137
137
|
}), N = ({ title: e, description: n, contacts: a, labels: o }) => {
|
|
138
138
|
let [s, c] = g(!1);
|
|
139
|
-
return /* @__PURE__ */
|
|
139
|
+
return /* @__PURE__ */ v("div", {
|
|
140
140
|
className: "rounded-16 border-lightGrey space-y-12 border bg-white p-12",
|
|
141
141
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ v("p", {
|
|
143
143
|
className: "text-b3 flex items-center gap-12 font-semibold",
|
|
144
|
-
children: [/* @__PURE__ */
|
|
144
|
+
children: [/* @__PURE__ */ _(i, {
|
|
145
145
|
color: "sienna",
|
|
146
146
|
icon: "Error",
|
|
147
147
|
size: "size-48",
|
|
148
148
|
theme: "solid"
|
|
149
149
|
}), e]
|
|
150
150
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ _(t, {
|
|
152
152
|
isExpanded: s,
|
|
153
|
-
children: /* @__PURE__ */
|
|
153
|
+
children: /* @__PURE__ */ v("div", {
|
|
154
154
|
className: "space-y-20 pb-4",
|
|
155
|
-
children: [/* @__PURE__ */
|
|
155
|
+
children: [/* @__PURE__ */ _("p", { children: n }), a.length > 0 && /* @__PURE__ */ _("div", { children: a.map(({ description: e, href: t, icon: n, target: a, title: o }) => /* @__PURE__ */ v("a", {
|
|
156
156
|
className: "mb-20 flex gap-12",
|
|
157
157
|
href: t,
|
|
158
158
|
rel: "noreferrer",
|
|
159
159
|
target: a,
|
|
160
|
-
children: [/* @__PURE__ */
|
|
160
|
+
children: [/* @__PURE__ */ _(i, {
|
|
161
161
|
color: "black",
|
|
162
162
|
icon: n,
|
|
163
163
|
size: "size-48",
|
|
164
164
|
theme: "outline"
|
|
165
|
-
}), /* @__PURE__ */
|
|
165
|
+
}), /* @__PURE__ */ v("div", {
|
|
166
166
|
className: "space-y-8 font-sans",
|
|
167
|
-
children: [/* @__PURE__ */
|
|
167
|
+
children: [/* @__PURE__ */ _("p", {
|
|
168
168
|
className: "text-b3 font-semibold",
|
|
169
169
|
children: o
|
|
170
|
-
}), e && /* @__PURE__ */
|
|
170
|
+
}), e && /* @__PURE__ */ _(r, {
|
|
171
171
|
className: "text-b4",
|
|
172
172
|
text: e
|
|
173
173
|
})]
|
|
@@ -175,7 +175,7 @@ var k = ({ label: e, description: t, addLabel: n, removeLabel: r, min: i, max: a
|
|
|
175
175
|
}, o)) })]
|
|
176
176
|
})
|
|
177
177
|
}),
|
|
178
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ _("button", {
|
|
179
179
|
className: "text-b4 cursor-pointer underline",
|
|
180
180
|
onClick: () => c((e) => !e),
|
|
181
181
|
type: "button",
|
|
@@ -183,7 +183,7 @@ var k = ({ label: e, description: t, addLabel: n, removeLabel: r, min: i, max: a
|
|
|
183
183
|
})
|
|
184
184
|
]
|
|
185
185
|
});
|
|
186
|
-
}, P = ({ adultsCount: r, maxAdults: i, minAdults: a, birthdates: o, childAges: s, childrenCount: c, className: f, labels:
|
|
186
|
+
}, P = ({ adultsCount: r, maxAdults: i, minAdults: a, birthdates: o, childAges: s, childrenCount: c, className: f, labels: y, maxAuthorizedBirthdate: b, maxChildren: x, maxTotalParticipants: S = E, minAuthorizedBirthdate: C, minChildren: w, onChange: T, onLimitDisplay: A, onReset: P, onApply: F, title: I, variant: L = "card", withChildren: R = !0, childrenFlow: z = "age-or-birthdate-with-apply" }) => {
|
|
187
187
|
let B = L === "card", V = r + c >= S, H = h(V);
|
|
188
188
|
m(() => {
|
|
189
189
|
V && !H.current && A?.(), H.current = V;
|
|
@@ -192,28 +192,28 @@ var k = ({ label: e, description: t, addLabel: n, removeLabel: r, min: i, max: a
|
|
|
192
192
|
m(() => {
|
|
193
193
|
J((e) => c > e.length ? [...e, ...Array(c - e.length).fill("")] : e.slice(0, c));
|
|
194
194
|
}, [c]);
|
|
195
|
-
let te = z !== "birthdate-only", ne = z === "age-or-birthdate-with-apply", X = z === "age-or-birthdate-with-apply", Z = R && te && !!
|
|
196
|
-
addLabel:
|
|
197
|
-
description:
|
|
198
|
-
label:
|
|
195
|
+
let te = z !== "birthdate-only", ne = z === "age-or-birthdate-with-apply", X = z === "age-or-birthdate-with-apply", Z = R && te && !!y.enterDateOfBirth, re = R && ne && !!y.participantDetails && (r > 0 || c > 0), Q = /* @__PURE__ */ _(k, {
|
|
196
|
+
addLabel: y.addAdult,
|
|
197
|
+
description: y.adultsDescription,
|
|
198
|
+
label: y.adults,
|
|
199
199
|
max: i,
|
|
200
200
|
min: a,
|
|
201
201
|
onChange: (e) => T({
|
|
202
202
|
type: "adultsCount",
|
|
203
203
|
payload: e
|
|
204
204
|
}),
|
|
205
|
-
removeLabel:
|
|
205
|
+
removeLabel: y.removeAdult,
|
|
206
206
|
value: r
|
|
207
|
-
}), ie = o.length > 0 && /* @__PURE__ */
|
|
207
|
+
}), ie = o.length > 0 && /* @__PURE__ */ _("div", {
|
|
208
208
|
className: B ? "space-y-12" : "grid grid-cols-1 gap-20 md:grid-cols-2 md:gap-x-20",
|
|
209
|
-
children: o.map((e, t) => /* @__PURE__ */
|
|
210
|
-
label:
|
|
209
|
+
children: o.map((e, t) => /* @__PURE__ */ _(u, {
|
|
210
|
+
label: y.childBirthdate.replace("{n}", String(t + 1)),
|
|
211
211
|
value: e,
|
|
212
212
|
min: C ?? l(),
|
|
213
213
|
max: b,
|
|
214
|
-
invalidDateErrorMessage:
|
|
215
|
-
minDateErrorMessage:
|
|
216
|
-
maxDateErrorMessage:
|
|
214
|
+
invalidDateErrorMessage: y.childBirthdateInvalidDateError,
|
|
215
|
+
minDateErrorMessage: y.childBirthdateMinAgeError,
|
|
216
|
+
maxDateErrorMessage: y.childBirthdateMaxAgeError,
|
|
217
217
|
onChange: (e, n) => T({
|
|
218
218
|
type: "birthdate",
|
|
219
219
|
payload: {
|
|
@@ -222,21 +222,21 @@ var k = ({ label: e, description: t, addLabel: n, removeLabel: r, min: i, max: a
|
|
|
222
222
|
}
|
|
223
223
|
})
|
|
224
224
|
}, t))
|
|
225
|
-
}), ae = !U && c > 0 && /* @__PURE__ */
|
|
225
|
+
}), ae = !U && c > 0 && /* @__PURE__ */ v("div", {
|
|
226
226
|
className: "space-y-12",
|
|
227
|
-
children: [
|
|
227
|
+
children: [y.ageQuestion && /* @__PURE__ */ _("p", {
|
|
228
228
|
className: "text-b4",
|
|
229
|
-
children:
|
|
230
|
-
}), Array.from({ length: c }, (e, t) => /* @__PURE__ */
|
|
229
|
+
children: y.ageQuestion
|
|
230
|
+
}), Array.from({ length: c }, (e, t) => /* @__PURE__ */ v("div", {
|
|
231
231
|
className: "space-y-4",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
232
|
+
children: [/* @__PURE__ */ _("p", {
|
|
233
233
|
className: "text-b3 font-semibold px-20",
|
|
234
|
-
children:
|
|
235
|
-
}), /* @__PURE__ */
|
|
234
|
+
children: y.childLabel ? D(y.childLabel, t + 1) : `Child ${t + 1}`
|
|
235
|
+
}), /* @__PURE__ */ v("div", {
|
|
236
236
|
className: "flex items-center gap-12",
|
|
237
237
|
children: [
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
"aria-label":
|
|
238
|
+
/* @__PURE__ */ _("input", {
|
|
239
|
+
"aria-label": y.childLabel ? D(y.childLabel, t + 1) : `Child ${t + 1} age`,
|
|
240
240
|
className: "rounded-pill border-lightGrey h-48 w-80 border px-20 text-b3 font-semibold",
|
|
241
241
|
min: 0,
|
|
242
242
|
onChange: (e) => {
|
|
@@ -246,21 +246,21 @@ var k = ({ label: e, description: t, addLabel: n, removeLabel: r, min: i, max: a
|
|
|
246
246
|
type: "number",
|
|
247
247
|
value: q[t] ?? ""
|
|
248
248
|
}),
|
|
249
|
-
|
|
249
|
+
y.ageYear && y.ageMonths && /* @__PURE__ */ _(d, {
|
|
250
250
|
size: "small",
|
|
251
251
|
index: G === "year" ? 0 : 1,
|
|
252
252
|
items: [{
|
|
253
253
|
id: "year",
|
|
254
254
|
color: "saffron",
|
|
255
|
-
label:
|
|
255
|
+
label: y.ageYear
|
|
256
256
|
}, {
|
|
257
257
|
id: "month",
|
|
258
258
|
color: "saffron",
|
|
259
|
-
label:
|
|
259
|
+
label: y.ageMonths
|
|
260
260
|
}],
|
|
261
261
|
onClick: (e) => K(e === 0 ? "year" : "month")
|
|
262
262
|
}),
|
|
263
|
-
|
|
263
|
+
y.ageApply && /* @__PURE__ */ _(n, {
|
|
264
264
|
color: "black",
|
|
265
265
|
size: "tertiary",
|
|
266
266
|
onClick: () => {
|
|
@@ -274,51 +274,51 @@ var k = ({ label: e, description: t, addLabel: n, removeLabel: r, min: i, max: a
|
|
|
274
274
|
}
|
|
275
275
|
});
|
|
276
276
|
},
|
|
277
|
-
children:
|
|
277
|
+
children: y.ageApply
|
|
278
278
|
})
|
|
279
279
|
]
|
|
280
280
|
})]
|
|
281
281
|
}, t))]
|
|
282
|
-
}), oe = re && /* @__PURE__ */
|
|
282
|
+
}), oe = re && /* @__PURE__ */ v("div", {
|
|
283
283
|
className: "space-y-8",
|
|
284
|
-
children: [/* @__PURE__ */
|
|
284
|
+
children: [/* @__PURE__ */ v("button", {
|
|
285
285
|
"aria-expanded": Y,
|
|
286
286
|
className: "flex w-full cursor-pointer items-center justify-between border-b border-lightGrey pb-4",
|
|
287
287
|
onClick: () => ee((e) => !e),
|
|
288
288
|
type: "button",
|
|
289
|
-
children: [/* @__PURE__ */
|
|
289
|
+
children: [/* @__PURE__ */ _("span", {
|
|
290
290
|
className: "text-b4",
|
|
291
|
-
children:
|
|
292
|
-
}), /* @__PURE__ */
|
|
291
|
+
children: y.participantDetails
|
|
292
|
+
}), /* @__PURE__ */ _("svg", {
|
|
293
293
|
"aria-hidden": !0,
|
|
294
294
|
className: e("size-20 transition-transform", { "rotate-180": Y }),
|
|
295
295
|
fill: "none",
|
|
296
296
|
stroke: "currentColor",
|
|
297
297
|
strokeWidth: 2,
|
|
298
298
|
viewBox: "0 0 24 24",
|
|
299
|
-
children: /* @__PURE__ */
|
|
299
|
+
children: /* @__PURE__ */ _("path", {
|
|
300
300
|
d: "M6 9l6 6 6-6",
|
|
301
301
|
strokeLinecap: "round",
|
|
302
302
|
strokeLinejoin: "round"
|
|
303
303
|
})
|
|
304
304
|
})]
|
|
305
|
-
}), /* @__PURE__ */
|
|
305
|
+
}), /* @__PURE__ */ _(t, {
|
|
306
306
|
isExpanded: Y,
|
|
307
|
-
children: /* @__PURE__ */
|
|
307
|
+
children: /* @__PURE__ */ v("div", {
|
|
308
308
|
className: "grid grid-cols-2 gap-8",
|
|
309
|
-
children: [Array.from({ length: r }, (e, t) => /* @__PURE__ */
|
|
310
|
-
ariaLabel:
|
|
311
|
-
label:
|
|
309
|
+
children: [Array.from({ length: r }, (e, t) => /* @__PURE__ */ _(j, {
|
|
310
|
+
ariaLabel: y.removeParticipant,
|
|
311
|
+
label: y.adultLabel ? D(y.adultLabel, t + 1) : `Adult ${t + 1}`,
|
|
312
312
|
onClick: () => T({
|
|
313
313
|
type: "adultsCount",
|
|
314
314
|
payload: r - 1
|
|
315
315
|
}),
|
|
316
316
|
type: "adult"
|
|
317
317
|
}, `adult-${t}`)), Array.from({ length: c }, (e, t) => {
|
|
318
|
-
let n = O(o[t], s?.[t],
|
|
319
|
-
return /* @__PURE__ */
|
|
318
|
+
let n = O(o[t], s?.[t], y), r = y.childLabel ? D(y.childLabel, t + 1) : `Child ${t + 1}`;
|
|
319
|
+
return /* @__PURE__ */ _(j, {
|
|
320
320
|
ageLabel: n || void 0,
|
|
321
|
-
ariaLabel:
|
|
321
|
+
ariaLabel: y.removeParticipant,
|
|
322
322
|
label: r,
|
|
323
323
|
onClick: () => T({
|
|
324
324
|
type: "childrenCount",
|
|
@@ -329,32 +329,32 @@ var k = ({ label: e, description: t, addLabel: n, removeLabel: r, min: i, max: a
|
|
|
329
329
|
})]
|
|
330
330
|
})
|
|
331
331
|
})]
|
|
332
|
-
}), $ = R && /* @__PURE__ */
|
|
332
|
+
}), $ = R && /* @__PURE__ */ v("div", {
|
|
333
333
|
className: "space-y-8",
|
|
334
334
|
children: [
|
|
335
|
-
/* @__PURE__ */
|
|
336
|
-
addLabel:
|
|
337
|
-
description:
|
|
338
|
-
label:
|
|
335
|
+
/* @__PURE__ */ _(k, {
|
|
336
|
+
addLabel: y.addChild,
|
|
337
|
+
description: y.childrenAgeLimit,
|
|
338
|
+
label: y.children,
|
|
339
339
|
max: x,
|
|
340
340
|
min: w,
|
|
341
341
|
onChange: (e) => T({
|
|
342
342
|
type: "childrenCount",
|
|
343
343
|
payload: e
|
|
344
344
|
}),
|
|
345
|
-
removeLabel:
|
|
345
|
+
removeLabel: y.removeChild,
|
|
346
346
|
value: c
|
|
347
347
|
}),
|
|
348
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ _(t, {
|
|
349
349
|
isExpanded: Z && c > 0 || !Z && o.length > 0,
|
|
350
|
-
children: /* @__PURE__ */
|
|
350
|
+
children: /* @__PURE__ */ v("div", {
|
|
351
351
|
className: "border-lightGrey space-y-12 border-t pt-12",
|
|
352
|
-
children: [Z && /* @__PURE__ */
|
|
352
|
+
children: [Z && /* @__PURE__ */ v("div", {
|
|
353
353
|
className: "flex items-center justify-between",
|
|
354
|
-
children: [/* @__PURE__ */
|
|
354
|
+
children: [/* @__PURE__ */ _("p", {
|
|
355
355
|
className: "text-b3 font-semibold",
|
|
356
|
-
children:
|
|
357
|
-
}), /* @__PURE__ */
|
|
356
|
+
children: y.enterDateOfBirth
|
|
357
|
+
}), /* @__PURE__ */ _(p, {
|
|
358
358
|
checked: U,
|
|
359
359
|
onChange: (e, t) => W(t)
|
|
360
360
|
})]
|
|
@@ -364,47 +364,47 @@ var k = ({ label: e, description: t, addLabel: n, removeLabel: r, min: i, max: a
|
|
|
364
364
|
oe
|
|
365
365
|
]
|
|
366
366
|
});
|
|
367
|
-
return B ? /* @__PURE__ */
|
|
367
|
+
return B ? /* @__PURE__ */ v("div", {
|
|
368
368
|
className: e("rounded-16 border-lightGrey flex flex-col gap-20 border bg-white p-20", f),
|
|
369
|
-
children: [/* @__PURE__ */
|
|
369
|
+
children: [/* @__PURE__ */ v("div", {
|
|
370
370
|
className: "rounded-16 bg-lightSand space-y-8 p-20",
|
|
371
371
|
children: [
|
|
372
|
-
I && /* @__PURE__ */
|
|
372
|
+
I && /* @__PURE__ */ _("p", {
|
|
373
373
|
className: "text-b2 font-semibold",
|
|
374
374
|
children: I
|
|
375
375
|
}),
|
|
376
|
-
V &&
|
|
377
|
-
/* @__PURE__ */
|
|
376
|
+
V && y.limit && /* @__PURE__ */ _(N, { ...y.limit }),
|
|
377
|
+
/* @__PURE__ */ _("div", {
|
|
378
378
|
className: "rounded-16 bg-white p-12",
|
|
379
379
|
children: Q
|
|
380
380
|
}),
|
|
381
|
-
$ && /* @__PURE__ */
|
|
381
|
+
$ && /* @__PURE__ */ _("div", {
|
|
382
382
|
className: "rounded-16 bg-white p-12",
|
|
383
383
|
children: $
|
|
384
384
|
})
|
|
385
385
|
]
|
|
386
|
-
}), /* @__PURE__ */
|
|
387
|
-
applyLabel:
|
|
386
|
+
}), /* @__PURE__ */ _(M, {
|
|
387
|
+
applyLabel: y.apply,
|
|
388
388
|
onApply: X ? F : void 0,
|
|
389
389
|
onReset: P,
|
|
390
|
-
resetLabel:
|
|
390
|
+
resetLabel: y.reset,
|
|
391
391
|
withSpacer: !0
|
|
392
392
|
})]
|
|
393
|
-
}) : /* @__PURE__ */
|
|
393
|
+
}) : /* @__PURE__ */ v("div", {
|
|
394
394
|
className: e("space-y-20", f),
|
|
395
395
|
children: [
|
|
396
|
-
I && /* @__PURE__ */
|
|
396
|
+
I && /* @__PURE__ */ _("p", {
|
|
397
397
|
className: "text-b2 font-semibold",
|
|
398
398
|
children: I
|
|
399
399
|
}),
|
|
400
|
-
V &&
|
|
400
|
+
V && y.limit && /* @__PURE__ */ _(N, { ...y.limit }),
|
|
401
401
|
Q,
|
|
402
402
|
$,
|
|
403
|
-
/* @__PURE__ */
|
|
404
|
-
applyLabel:
|
|
403
|
+
/* @__PURE__ */ _(M, {
|
|
404
|
+
applyLabel: y.apply,
|
|
405
405
|
onApply: X ? F : void 0,
|
|
406
406
|
onReset: P,
|
|
407
|
-
resetLabel:
|
|
407
|
+
resetLabel: y.reset
|
|
408
408
|
})
|
|
409
409
|
]
|
|
410
410
|
});
|
package/chunks/DateField.js
CHANGED
|
@@ -5,8 +5,8 @@ import { useValue as r } from "../ui/hooks/useValue.js";
|
|
|
5
5
|
import { a as i, c as a, i as o, n as s, s as c } from "./addLeadingZeros.js";
|
|
6
6
|
import { t as l } from "./formatISO.js";
|
|
7
7
|
import { useCallback as u, useEffect as d, useId as f, useRef as p, useState as m } from "react";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
9
|
+
import { Icon as _ } from "@clubmed/trident-icons";
|
|
10
10
|
//#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInMilliseconds.js
|
|
11
11
|
function v(e, t) {
|
|
12
12
|
return o(e) - +o(t);
|
|
@@ -172,7 +172,7 @@ var z = (e) => e ? typeof e == "string" ? e : s(new Date(e)) ? l(new Date(e), {
|
|
|
172
172
|
A,
|
|
173
173
|
I,
|
|
174
174
|
H
|
|
175
|
-
]), /* @__PURE__ */
|
|
175
|
+
]), /* @__PURE__ */ h(n, {
|
|
176
176
|
id: o,
|
|
177
177
|
label: c,
|
|
178
178
|
description: l,
|
|
@@ -184,10 +184,10 @@ var z = (e) => e ? typeof e == "string" ? e : s(new Date(e)) ? l(new Date(e), {
|
|
|
184
184
|
validationStatus: x,
|
|
185
185
|
errorMessage: w,
|
|
186
186
|
className: N,
|
|
187
|
-
children: /* @__PURE__ */
|
|
187
|
+
children: /* @__PURE__ */ g("div", {
|
|
188
188
|
className: "relative",
|
|
189
189
|
role: "group",
|
|
190
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ h("input", {
|
|
191
191
|
...P,
|
|
192
192
|
type: "date",
|
|
193
193
|
className: e("text-b3 rounded-pill date-field min-h-[50px] w-full border px-20 py-12 ps-[52px] font-normal outline-none focus-visible:ring-4 focus-visible:ring-black focus-visible:ring-offset-2", {
|
|
@@ -209,29 +209,29 @@ var z = (e) => e ? typeof e == "string" ? e : s(new Date(e)) ? l(new Date(e), {
|
|
|
209
209
|
onChange: G,
|
|
210
210
|
onFocus: () => L(!0),
|
|
211
211
|
onBlur: () => L(!1)
|
|
212
|
-
}), /* @__PURE__ */
|
|
212
|
+
}), /* @__PURE__ */ g("div", {
|
|
213
213
|
className: e("pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12", {
|
|
214
214
|
"text-grey": T,
|
|
215
215
|
"text-red": !T && R === "error",
|
|
216
216
|
"text-green": !T && R === "success"
|
|
217
217
|
}),
|
|
218
|
-
children: [/* @__PURE__ */
|
|
218
|
+
children: [/* @__PURE__ */ g("button", {
|
|
219
219
|
className: "pointer-events-auto leading-none outline-none focus-visible:ring-4 focus-visible:ring-black focus-visible:ring-offset-2",
|
|
220
220
|
onClick: K,
|
|
221
|
-
children: [/* @__PURE__ */
|
|
221
|
+
children: [/* @__PURE__ */ h(_, {
|
|
222
222
|
name: S,
|
|
223
223
|
iconType: C,
|
|
224
224
|
width: "24px"
|
|
225
|
-
}), /* @__PURE__ */
|
|
225
|
+
}), /* @__PURE__ */ h("span", {
|
|
226
226
|
className: "sr-only",
|
|
227
227
|
children: b
|
|
228
228
|
})]
|
|
229
|
-
}), /* @__PURE__ */
|
|
229
|
+
}), /* @__PURE__ */ g("span", {
|
|
230
230
|
className: "ms-auto flex gap-x-8",
|
|
231
|
-
children: [R === "error" && /* @__PURE__ */
|
|
231
|
+
children: [R === "error" && /* @__PURE__ */ h(_, {
|
|
232
232
|
name: "CrossDefault",
|
|
233
233
|
width: "24px"
|
|
234
|
-
}), R === "success" && /* @__PURE__ */
|
|
234
|
+
}), R === "success" && /* @__PURE__ */ h(_, {
|
|
235
235
|
name: "CheckDefault",
|
|
236
236
|
width: "24px"
|
|
237
237
|
})]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function AccordionDemo(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Accordion as e } from "../ui/Accordion.js";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
//#region lib/examples/accordion-demo.tsx
|
|
5
|
+
var r = [
|
|
6
|
+
{
|
|
7
|
+
id: "what-is-trident",
|
|
8
|
+
header: /* @__PURE__ */ n("span", {
|
|
9
|
+
className: "flex w-full items-center justify-between py-16 text-left font-semibold",
|
|
10
|
+
children: ["What is Trident UI?", /* @__PURE__ */ t("span", {
|
|
11
|
+
className: "ml-8 text-sm opacity-60 transition-transform in-[[aria-expanded='true']]:rotate-180",
|
|
12
|
+
children: "▾"
|
|
13
|
+
})]
|
|
14
|
+
}),
|
|
15
|
+
content: /* @__PURE__ */ t("p", {
|
|
16
|
+
className: "pb-16 text-sm text-black/70",
|
|
17
|
+
children: "Trident UI is ClubMed's open-source component library built on React and Tailwind CSS. It provides accessible, composable primitives for building consistent product interfaces."
|
|
18
|
+
})
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "how-to-install",
|
|
22
|
+
header: /* @__PURE__ */ n("span", {
|
|
23
|
+
className: "flex w-full items-center justify-between py-16 text-left font-semibold",
|
|
24
|
+
children: ["How do I install it?", /* @__PURE__ */ t("span", {
|
|
25
|
+
className: "ml-8 text-sm opacity-60 transition-transform in-[[aria-expanded='true']]:rotate-180",
|
|
26
|
+
children: "▾"
|
|
27
|
+
})]
|
|
28
|
+
}),
|
|
29
|
+
content: /* @__PURE__ */ n("p", {
|
|
30
|
+
className: "pb-16 text-sm text-black/70",
|
|
31
|
+
children: [
|
|
32
|
+
"Run",
|
|
33
|
+
" ",
|
|
34
|
+
/* @__PURE__ */ t("code", {
|
|
35
|
+
className: "rounded bg-black/5 px-4 py-1 font-mono text-xs",
|
|
36
|
+
children: "npx shadcn@latest add https://develop.trident-ui.pro.clubmed/r/accordion.json"
|
|
37
|
+
}),
|
|
38
|
+
" ",
|
|
39
|
+
"to add the component to your project."
|
|
40
|
+
]
|
|
41
|
+
})
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "allow-multiple",
|
|
45
|
+
header: /* @__PURE__ */ n("span", {
|
|
46
|
+
className: "flex w-full items-center justify-between py-16 text-left font-semibold",
|
|
47
|
+
children: ["Does it support multiple open panels?", /* @__PURE__ */ t("span", {
|
|
48
|
+
className: "ml-8 text-sm opacity-60 transition-transform in-[[aria-expanded='true']]:rotate-180",
|
|
49
|
+
children: "▾"
|
|
50
|
+
})]
|
|
51
|
+
}),
|
|
52
|
+
content: /* @__PURE__ */ n("p", {
|
|
53
|
+
className: "pb-16 text-sm text-black/70",
|
|
54
|
+
children: [
|
|
55
|
+
"Yes — pass",
|
|
56
|
+
" ",
|
|
57
|
+
/* @__PURE__ */ t("code", {
|
|
58
|
+
className: "rounded bg-black/5 px-4 py-1 font-mono text-xs",
|
|
59
|
+
children: "allowMultiple"
|
|
60
|
+
}),
|
|
61
|
+
" to let any number of panels be open at the same time. By default only one panel is open at once."
|
|
62
|
+
]
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
];
|
|
66
|
+
function i() {
|
|
67
|
+
return /* @__PURE__ */ t("div", {
|
|
68
|
+
className: "w-full max-w-lg space-y-12",
|
|
69
|
+
children: /* @__PURE__ */ t(e, {
|
|
70
|
+
items: r,
|
|
71
|
+
className: "divide-y divide-black/10 rounded-12 border border-black/10",
|
|
72
|
+
"aria-label": "FAQ"
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
export { i as default };
|
|
78
|
+
|
|
79
|
+
//# sourceMappingURL=accordion-demo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion-demo.js","names":[],"sources":["../../lib/examples/accordion-demo.tsx"],"sourcesContent":["'use client';\n\nimport { Accordion } from '@/ui/Accordion';\n\nconst items = [\n {\n id: 'what-is-trident',\n header: (\n <span className=\"flex w-full items-center justify-between py-16 text-left font-semibold\">\n What is Trident UI?\n <span className=\"ml-8 text-sm opacity-60 transition-transform in-[[aria-expanded='true']]:rotate-180\">\n ▾\n </span>\n </span>\n ),\n content: (\n <p className=\"pb-16 text-sm text-black/70\">\n Trident UI is ClubMed's open-source component library built on React and Tailwind CSS.\n It provides accessible, composable primitives for building consistent product interfaces.\n </p>\n ),\n },\n {\n id: 'how-to-install',\n header: (\n <span className=\"flex w-full items-center justify-between py-16 text-left font-semibold\">\n How do I install it?\n <span className=\"ml-8 text-sm opacity-60 transition-transform in-[[aria-expanded='true']]:rotate-180\">\n ▾\n </span>\n </span>\n ),\n content: (\n <p className=\"pb-16 text-sm text-black/70\">\n Run{' '}\n <code className=\"rounded bg-black/5 px-4 py-1 font-mono text-xs\">\n npx shadcn@latest add https://develop.trident-ui.pro.clubmed/r/accordion.json\n </code>{' '}\n to add the component to your project.\n </p>\n ),\n },\n {\n id: 'allow-multiple',\n header: (\n <span className=\"flex w-full items-center justify-between py-16 text-left font-semibold\">\n Does it support multiple open panels?\n <span className=\"ml-8 text-sm opacity-60 transition-transform in-[[aria-expanded='true']]:rotate-180\">\n ▾\n </span>\n </span>\n ),\n content: (\n <p className=\"pb-16 text-sm text-black/70\">\n Yes — pass{' '}\n <code className=\"rounded bg-black/5 px-4 py-1 font-mono text-xs\">allowMultiple</code> to let\n any number of panels be open at the same time. By default only one panel is open at once.\n </p>\n ),\n },\n];\n\nexport default function AccordionDemo() {\n return (\n <div className=\"w-full max-w-lg space-y-12\">\n <Accordion\n items={items}\n className=\"divide-y divide-black/10 rounded-12 border border-black/10\"\n aria-label=\"FAQ\"\n />\n </div>\n );\n}\n"],"mappings":";;;;AAIA,IAAM,IAAQ;CACZ;EACE,IAAI;EACJ,QACE,kBAAC,QAAD;GAAM,WAAU;aAAhB,CAAyF,uBAEvF,kBAAC,QAAD;IAAM,WAAU;cAAsF;IAE/F,CAAA,CAAA;;EAGX,SACE,kBAAC,KAAD;GAAG,WAAU;aAA8B;GAGvC,CAAA;EAEP;CACD;EACE,IAAI;EACJ,QACE,kBAAC,QAAD;GAAM,WAAU;aAAhB,CAAyF,wBAEvF,kBAAC,QAAD;IAAM,WAAU;cAAsF;IAE/F,CAAA,CAAA;;EAGX,SACE,kBAAC,KAAD;GAAG,WAAU;aAAb;IAA2C;IACrC;IACJ,kBAAC,QAAD;KAAM,WAAU;eAAiD;KAE1D,CAAA;IAAC;IAAI;;;EAIjB;CACD;EACE,IAAI;EACJ,QACE,kBAAC,QAAD;GAAM,WAAU;aAAhB,CAAyF,yCAEvF,kBAAC,QAAD;IAAM,WAAU;cAAsF;IAE/F,CAAA,CAAA;;EAGX,SACE,kBAAC,KAAD;GAAG,WAAU;aAAb;IAA2C;IAC9B;IACX,kBAAC,QAAD;KAAM,WAAU;eAAiD;KAAoB,CAAA;;;;;CAK5F;AAED,SAAwB,IAAgB;AACtC,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACS;GACP,WAAU;GACV,cAAW;GACX,CAAA;EACE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function AccordionMultipleDemo(): import("react/jsx-runtime").JSX.Element;
|