@xjur-ui/react 1.0.0 → 1.0.2
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/.turbo/turbo-build.log +63 -57
- package/CHANGELOG.md +18 -0
- package/dist/components/avatar.d.ts +11 -0
- package/dist/components/avatar.js +58 -0
- package/dist/components/badge.d.ts +13 -0
- package/dist/components/{ui/input/message.js → badge.js} +30 -47
- package/dist/components/{ui/button.d.ts → button.d.ts} +2 -2
- package/dist/components/{ui/button.js → button.js} +9 -6
- package/dist/components/calendar.d.ts +11 -0
- package/dist/components/calendar.js +751 -0
- package/dist/components/checkbox.d.ts +8 -0
- package/dist/components/{ui/input/root.js → checkbox.js} +69 -79
- package/dist/components/chip.d.ts +24 -0
- package/dist/components/chip.js +255 -0
- package/dist/components/collapsible.d.ts +8 -0
- package/dist/components/collapsible.js +41 -0
- package/dist/components/date-picker.d.ts +20 -0
- package/dist/components/date-picker.js +232 -0
- package/dist/components/divider.d.ts +7 -0
- package/dist/components/divider.js +28 -0
- package/dist/components/dropdown-menu.d.ts +22 -0
- package/dist/components/dropdown-menu.js +294 -0
- package/dist/components/{resources/icons.d.ts → icon.d.ts} +11 -2
- package/dist/components/{ui/icon.js → icon.js} +20 -5
- package/dist/components/input.d.ts +32 -0
- package/dist/components/input.js +315 -0
- package/dist/components/list.d.ts +25 -0
- package/dist/components/{ui/input/content.js → list.js} +83 -87
- package/dist/components/{ui/logo.d.ts → logo.d.ts} +2 -2
- package/dist/components/{ui/logo.js → logo.js} +5 -5
- package/dist/components/{ui/otp-input.js → otp-input.js} +1 -1
- package/dist/components/radio.d.ts +10 -0
- package/dist/components/{ui/input/label.js → radio.js} +68 -77
- package/dist/components/search-input.d.ts +17 -0
- package/dist/components/search-input.js +274 -0
- package/dist/components/select.d.ts +33 -0
- package/dist/components/select.js +550 -0
- package/dist/components/sheet.d.ts +19 -0
- package/dist/components/sheet.js +251 -0
- package/dist/components/switch.d.ts +7 -0
- package/dist/components/switch.js +36 -0
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +54 -0
- package/dist/components/tag.d.ts +18 -0
- package/dist/components/tag.js +189 -0
- package/dist/components/{ui/typography.d.ts → typography.d.ts} +4 -4
- package/dist/components/{ui/typography.js → typography.js} +1 -1
- package/dist/index.css +1233 -62
- package/dist/index.d.ts +2 -17
- package/dist/index.js +0 -788
- package/eslint.config.js +8 -1
- package/package.json +41 -10
- package/src/components/avatar.tsx +53 -0
- package/src/components/badge.tsx +40 -0
- package/src/components/{ui/button.tsx → button.tsx} +7 -5
- package/src/components/calendar.tsx +123 -0
- package/src/components/checkbox.tsx +57 -0
- package/src/components/chip.tsx +109 -0
- package/src/components/collapsible.tsx +35 -0
- package/src/components/date-picker.tsx +160 -0
- package/src/components/divider.tsx +23 -0
- package/src/components/dropdown-menu.tsx +101 -0
- package/src/components/{ui/icon.tsx → icon.tsx} +1 -1
- package/src/components/input.tsx +256 -0
- package/src/components/list.tsx +111 -0
- package/src/components/radio.tsx +74 -0
- package/src/components/search-input.tsx +112 -0
- package/src/components/select.tsx +240 -0
- package/src/components/sheet.tsx +141 -0
- package/src/components/switch.tsx +31 -0
- package/src/components/tabs.tsx +53 -0
- package/src/components/tag.tsx +91 -0
- package/src/index.css +4 -1
- package/src/index.ts +0 -1
- package/src/{components/resources → resources}/icons.ts +16 -1
- package/src/resources/input-mask.ts +91 -0
- package/dist/components/resources/icons.js +0 -133
- package/dist/components/resources/logo/horizontal.d.ts +0 -12
- package/dist/components/resources/logo/horizontal.js +0 -107
- package/dist/components/resources/logo/icon.d.ts +0 -12
- package/dist/components/resources/logo/icon.js +0 -79
- package/dist/components/resources/logo/index.d.ts +0 -4
- package/dist/components/resources/logo/index.js +0 -291
- package/dist/components/resources/logo/vertical.d.ts +0 -12
- package/dist/components/resources/logo/vertical.js +0 -107
- package/dist/components/ui/accordion.d.ts +0 -5
- package/dist/components/ui/accordion.js +0 -8
- package/dist/components/ui/icon.d.ts +0 -12
- package/dist/components/ui/index.d.ts +0 -17
- package/dist/components/ui/index.js +0 -788
- package/dist/components/ui/input/content.d.ts +0 -9
- package/dist/components/ui/input/index.d.ts +0 -12
- package/dist/components/ui/input/index.js +0 -335
- package/dist/components/ui/input/label.d.ts +0 -12
- package/dist/components/ui/input/message.d.ts +0 -10
- package/dist/components/ui/input/root.d.ts +0 -18
- package/dist/components/ui/input/slot.d.ts +0 -10
- package/dist/components/ui/input/slot.js +0 -20
- package/dist/components/ui/input/text.d.ts +0 -10
- package/dist/components/ui/input/text.js +0 -195
- package/src/components/ui/accordion.tsx +0 -3
- package/src/components/ui/index.ts +0 -13
- package/src/components/ui/input/content.tsx +0 -59
- package/src/components/ui/input/index.ts +0 -6
- package/src/components/ui/input/label.tsx +0 -41
- package/src/components/ui/input/message.tsx +0 -37
- package/src/components/ui/input/root.tsx +0 -57
- package/src/components/ui/input/slot.tsx +0 -21
- package/src/components/ui/input/text.tsx +0 -69
- /package/dist/components/{ui/otp-input.d.ts → otp-input.d.ts} +0 -0
- /package/src/components/{ui/logo.tsx → logo.tsx} +0 -0
- /package/src/components/{ui/otp-input.tsx → otp-input.tsx} +0 -0
- /package/src/components/{ui/typography.tsx → typography.tsx} +0 -0
- /package/src/{components/resources → resources}/logo/horizontal.tsx +0 -0
- /package/src/{components/resources → resources}/logo/icon.tsx +0 -0
- /package/src/{components/resources → resources}/logo/index.ts +0 -0
- /package/src/{components/resources → resources}/logo/vertical.tsx +0 -0
|
@@ -0,0 +1,751 @@
|
|
|
1
|
+
// src/components/calendar.tsx
|
|
2
|
+
import "react-day-picker/style.css";
|
|
3
|
+
|
|
4
|
+
// ../../node_modules/date-fns/locale/_lib/buildFormatLongFn.js
|
|
5
|
+
function buildFormatLongFn(args) {
|
|
6
|
+
return (options = {}) => {
|
|
7
|
+
const width = options.width ? String(options.width) : args.defaultWidth;
|
|
8
|
+
const format = args.formats[width] || args.formats[args.defaultWidth];
|
|
9
|
+
return format;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// ../../node_modules/date-fns/locale/_lib/buildLocalizeFn.js
|
|
14
|
+
function buildLocalizeFn(args) {
|
|
15
|
+
return (value, options) => {
|
|
16
|
+
const context = options?.context ? String(options.context) : "standalone";
|
|
17
|
+
let valuesArray;
|
|
18
|
+
if (context === "formatting" && args.formattingValues) {
|
|
19
|
+
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
20
|
+
const width = options?.width ? String(options.width) : defaultWidth;
|
|
21
|
+
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
22
|
+
} else {
|
|
23
|
+
const defaultWidth = args.defaultWidth;
|
|
24
|
+
const width = options?.width ? String(options.width) : args.defaultWidth;
|
|
25
|
+
valuesArray = args.values[width] || args.values[defaultWidth];
|
|
26
|
+
}
|
|
27
|
+
const index = args.argumentCallback ? args.argumentCallback(value) : value;
|
|
28
|
+
return valuesArray[index];
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// ../../node_modules/date-fns/locale/_lib/buildMatchFn.js
|
|
33
|
+
function buildMatchFn(args) {
|
|
34
|
+
return (string, options = {}) => {
|
|
35
|
+
const width = options.width;
|
|
36
|
+
const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
37
|
+
const matchResult = string.match(matchPattern);
|
|
38
|
+
if (!matchResult) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const matchedString = matchResult[0];
|
|
42
|
+
const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
|
43
|
+
const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
|
|
44
|
+
// [TODO] -- I challenge you to fix the type
|
|
45
|
+
findKey(parsePatterns, (pattern) => pattern.test(matchedString))
|
|
46
|
+
);
|
|
47
|
+
let value;
|
|
48
|
+
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
49
|
+
value = options.valueCallback ? (
|
|
50
|
+
// [TODO] -- I challenge you to fix the type
|
|
51
|
+
options.valueCallback(value)
|
|
52
|
+
) : value;
|
|
53
|
+
const rest = string.slice(matchedString.length);
|
|
54
|
+
return { value, rest };
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function findKey(object, predicate) {
|
|
58
|
+
for (const key in object) {
|
|
59
|
+
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
|
|
60
|
+
return key;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return void 0;
|
|
64
|
+
}
|
|
65
|
+
function findIndex(array, predicate) {
|
|
66
|
+
for (let key = 0; key < array.length; key++) {
|
|
67
|
+
if (predicate(array[key])) {
|
|
68
|
+
return key;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return void 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// ../../node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
|
|
75
|
+
function buildMatchPatternFn(args) {
|
|
76
|
+
return (string, options = {}) => {
|
|
77
|
+
const matchResult = string.match(args.matchPattern);
|
|
78
|
+
if (!matchResult) return null;
|
|
79
|
+
const matchedString = matchResult[0];
|
|
80
|
+
const parseResult = string.match(args.parsePattern);
|
|
81
|
+
if (!parseResult) return null;
|
|
82
|
+
let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
83
|
+
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
84
|
+
const rest = string.slice(matchedString.length);
|
|
85
|
+
return { value, rest };
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// ../../node_modules/date-fns/locale/pt-BR/_lib/formatDistance.js
|
|
90
|
+
var formatDistanceLocale = {
|
|
91
|
+
lessThanXSeconds: {
|
|
92
|
+
one: "menos de um segundo",
|
|
93
|
+
other: "menos de {{count}} segundos"
|
|
94
|
+
},
|
|
95
|
+
xSeconds: {
|
|
96
|
+
one: "1 segundo",
|
|
97
|
+
other: "{{count}} segundos"
|
|
98
|
+
},
|
|
99
|
+
halfAMinute: "meio minuto",
|
|
100
|
+
lessThanXMinutes: {
|
|
101
|
+
one: "menos de um minuto",
|
|
102
|
+
other: "menos de {{count}} minutos"
|
|
103
|
+
},
|
|
104
|
+
xMinutes: {
|
|
105
|
+
one: "1 minuto",
|
|
106
|
+
other: "{{count}} minutos"
|
|
107
|
+
},
|
|
108
|
+
aboutXHours: {
|
|
109
|
+
one: "cerca de 1 hora",
|
|
110
|
+
other: "cerca de {{count}} horas"
|
|
111
|
+
},
|
|
112
|
+
xHours: {
|
|
113
|
+
one: "1 hora",
|
|
114
|
+
other: "{{count}} horas"
|
|
115
|
+
},
|
|
116
|
+
xDays: {
|
|
117
|
+
one: "1 dia",
|
|
118
|
+
other: "{{count}} dias"
|
|
119
|
+
},
|
|
120
|
+
aboutXWeeks: {
|
|
121
|
+
one: "cerca de 1 semana",
|
|
122
|
+
other: "cerca de {{count}} semanas"
|
|
123
|
+
},
|
|
124
|
+
xWeeks: {
|
|
125
|
+
one: "1 semana",
|
|
126
|
+
other: "{{count}} semanas"
|
|
127
|
+
},
|
|
128
|
+
aboutXMonths: {
|
|
129
|
+
one: "cerca de 1 m\xEAs",
|
|
130
|
+
other: "cerca de {{count}} meses"
|
|
131
|
+
},
|
|
132
|
+
xMonths: {
|
|
133
|
+
one: "1 m\xEAs",
|
|
134
|
+
other: "{{count}} meses"
|
|
135
|
+
},
|
|
136
|
+
aboutXYears: {
|
|
137
|
+
one: "cerca de 1 ano",
|
|
138
|
+
other: "cerca de {{count}} anos"
|
|
139
|
+
},
|
|
140
|
+
xYears: {
|
|
141
|
+
one: "1 ano",
|
|
142
|
+
other: "{{count}} anos"
|
|
143
|
+
},
|
|
144
|
+
overXYears: {
|
|
145
|
+
one: "mais de 1 ano",
|
|
146
|
+
other: "mais de {{count}} anos"
|
|
147
|
+
},
|
|
148
|
+
almostXYears: {
|
|
149
|
+
one: "quase 1 ano",
|
|
150
|
+
other: "quase {{count}} anos"
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
var formatDistance = (token, count, options) => {
|
|
154
|
+
let result;
|
|
155
|
+
const tokenValue = formatDistanceLocale[token];
|
|
156
|
+
if (typeof tokenValue === "string") {
|
|
157
|
+
result = tokenValue;
|
|
158
|
+
} else if (count === 1) {
|
|
159
|
+
result = tokenValue.one;
|
|
160
|
+
} else {
|
|
161
|
+
result = tokenValue.other.replace("{{count}}", String(count));
|
|
162
|
+
}
|
|
163
|
+
if (options?.addSuffix) {
|
|
164
|
+
if (options.comparison && options.comparison > 0) {
|
|
165
|
+
return "em " + result;
|
|
166
|
+
} else {
|
|
167
|
+
return "h\xE1 " + result;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return result;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// ../../node_modules/date-fns/locale/pt-BR/_lib/formatLong.js
|
|
174
|
+
var dateFormats = {
|
|
175
|
+
full: "EEEE, d 'de' MMMM 'de' y",
|
|
176
|
+
long: "d 'de' MMMM 'de' y",
|
|
177
|
+
medium: "d MMM y",
|
|
178
|
+
short: "dd/MM/yyyy"
|
|
179
|
+
};
|
|
180
|
+
var timeFormats = {
|
|
181
|
+
full: "HH:mm:ss zzzz",
|
|
182
|
+
long: "HH:mm:ss z",
|
|
183
|
+
medium: "HH:mm:ss",
|
|
184
|
+
short: "HH:mm"
|
|
185
|
+
};
|
|
186
|
+
var dateTimeFormats = {
|
|
187
|
+
full: "{{date}} '\xE0s' {{time}}",
|
|
188
|
+
long: "{{date}} '\xE0s' {{time}}",
|
|
189
|
+
medium: "{{date}}, {{time}}",
|
|
190
|
+
short: "{{date}}, {{time}}"
|
|
191
|
+
};
|
|
192
|
+
var formatLong = {
|
|
193
|
+
date: buildFormatLongFn({
|
|
194
|
+
formats: dateFormats,
|
|
195
|
+
defaultWidth: "full"
|
|
196
|
+
}),
|
|
197
|
+
time: buildFormatLongFn({
|
|
198
|
+
formats: timeFormats,
|
|
199
|
+
defaultWidth: "full"
|
|
200
|
+
}),
|
|
201
|
+
dateTime: buildFormatLongFn({
|
|
202
|
+
formats: dateTimeFormats,
|
|
203
|
+
defaultWidth: "full"
|
|
204
|
+
})
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// ../../node_modules/date-fns/locale/pt-BR/_lib/formatRelative.js
|
|
208
|
+
var formatRelativeLocale = {
|
|
209
|
+
lastWeek: (date) => {
|
|
210
|
+
const weekday = date.getDay();
|
|
211
|
+
const last = weekday === 0 || weekday === 6 ? "\xFAltimo" : "\xFAltima";
|
|
212
|
+
return "'" + last + "' eeee '\xE0s' p";
|
|
213
|
+
},
|
|
214
|
+
yesterday: "'ontem \xE0s' p",
|
|
215
|
+
today: "'hoje \xE0s' p",
|
|
216
|
+
tomorrow: "'amanh\xE3 \xE0s' p",
|
|
217
|
+
nextWeek: "eeee '\xE0s' p",
|
|
218
|
+
other: "P"
|
|
219
|
+
};
|
|
220
|
+
var formatRelative = (token, date, _baseDate, _options) => {
|
|
221
|
+
const format = formatRelativeLocale[token];
|
|
222
|
+
if (typeof format === "function") {
|
|
223
|
+
return format(date);
|
|
224
|
+
}
|
|
225
|
+
return format;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
// ../../node_modules/date-fns/locale/pt-BR/_lib/localize.js
|
|
229
|
+
var eraValues = {
|
|
230
|
+
narrow: ["AC", "DC"],
|
|
231
|
+
abbreviated: ["AC", "DC"],
|
|
232
|
+
wide: ["antes de cristo", "depois de cristo"]
|
|
233
|
+
};
|
|
234
|
+
var quarterValues = {
|
|
235
|
+
narrow: ["1", "2", "3", "4"],
|
|
236
|
+
abbreviated: ["T1", "T2", "T3", "T4"],
|
|
237
|
+
wide: ["1\xBA trimestre", "2\xBA trimestre", "3\xBA trimestre", "4\xBA trimestre"]
|
|
238
|
+
};
|
|
239
|
+
var monthValues = {
|
|
240
|
+
narrow: ["j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
|
|
241
|
+
abbreviated: [
|
|
242
|
+
"jan",
|
|
243
|
+
"fev",
|
|
244
|
+
"mar",
|
|
245
|
+
"abr",
|
|
246
|
+
"mai",
|
|
247
|
+
"jun",
|
|
248
|
+
"jul",
|
|
249
|
+
"ago",
|
|
250
|
+
"set",
|
|
251
|
+
"out",
|
|
252
|
+
"nov",
|
|
253
|
+
"dez"
|
|
254
|
+
],
|
|
255
|
+
wide: [
|
|
256
|
+
"janeiro",
|
|
257
|
+
"fevereiro",
|
|
258
|
+
"mar\xE7o",
|
|
259
|
+
"abril",
|
|
260
|
+
"maio",
|
|
261
|
+
"junho",
|
|
262
|
+
"julho",
|
|
263
|
+
"agosto",
|
|
264
|
+
"setembro",
|
|
265
|
+
"outubro",
|
|
266
|
+
"novembro",
|
|
267
|
+
"dezembro"
|
|
268
|
+
]
|
|
269
|
+
};
|
|
270
|
+
var dayValues = {
|
|
271
|
+
narrow: ["D", "S", "T", "Q", "Q", "S", "S"],
|
|
272
|
+
short: ["dom", "seg", "ter", "qua", "qui", "sex", "sab"],
|
|
273
|
+
abbreviated: [
|
|
274
|
+
"domingo",
|
|
275
|
+
"segunda",
|
|
276
|
+
"ter\xE7a",
|
|
277
|
+
"quarta",
|
|
278
|
+
"quinta",
|
|
279
|
+
"sexta",
|
|
280
|
+
"s\xE1bado"
|
|
281
|
+
],
|
|
282
|
+
wide: [
|
|
283
|
+
"domingo",
|
|
284
|
+
"segunda-feira",
|
|
285
|
+
"ter\xE7a-feira",
|
|
286
|
+
"quarta-feira",
|
|
287
|
+
"quinta-feira",
|
|
288
|
+
"sexta-feira",
|
|
289
|
+
"s\xE1bado"
|
|
290
|
+
]
|
|
291
|
+
};
|
|
292
|
+
var dayPeriodValues = {
|
|
293
|
+
narrow: {
|
|
294
|
+
am: "a",
|
|
295
|
+
pm: "p",
|
|
296
|
+
midnight: "mn",
|
|
297
|
+
noon: "md",
|
|
298
|
+
morning: "manh\xE3",
|
|
299
|
+
afternoon: "tarde",
|
|
300
|
+
evening: "tarde",
|
|
301
|
+
night: "noite"
|
|
302
|
+
},
|
|
303
|
+
abbreviated: {
|
|
304
|
+
am: "AM",
|
|
305
|
+
pm: "PM",
|
|
306
|
+
midnight: "meia-noite",
|
|
307
|
+
noon: "meio-dia",
|
|
308
|
+
morning: "manh\xE3",
|
|
309
|
+
afternoon: "tarde",
|
|
310
|
+
evening: "tarde",
|
|
311
|
+
night: "noite"
|
|
312
|
+
},
|
|
313
|
+
wide: {
|
|
314
|
+
am: "a.m.",
|
|
315
|
+
pm: "p.m.",
|
|
316
|
+
midnight: "meia-noite",
|
|
317
|
+
noon: "meio-dia",
|
|
318
|
+
morning: "manh\xE3",
|
|
319
|
+
afternoon: "tarde",
|
|
320
|
+
evening: "tarde",
|
|
321
|
+
night: "noite"
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
var formattingDayPeriodValues = {
|
|
325
|
+
narrow: {
|
|
326
|
+
am: "a",
|
|
327
|
+
pm: "p",
|
|
328
|
+
midnight: "mn",
|
|
329
|
+
noon: "md",
|
|
330
|
+
morning: "da manh\xE3",
|
|
331
|
+
afternoon: "da tarde",
|
|
332
|
+
evening: "da tarde",
|
|
333
|
+
night: "da noite"
|
|
334
|
+
},
|
|
335
|
+
abbreviated: {
|
|
336
|
+
am: "AM",
|
|
337
|
+
pm: "PM",
|
|
338
|
+
midnight: "meia-noite",
|
|
339
|
+
noon: "meio-dia",
|
|
340
|
+
morning: "da manh\xE3",
|
|
341
|
+
afternoon: "da tarde",
|
|
342
|
+
evening: "da tarde",
|
|
343
|
+
night: "da noite"
|
|
344
|
+
},
|
|
345
|
+
wide: {
|
|
346
|
+
am: "a.m.",
|
|
347
|
+
pm: "p.m.",
|
|
348
|
+
midnight: "meia-noite",
|
|
349
|
+
noon: "meio-dia",
|
|
350
|
+
morning: "da manh\xE3",
|
|
351
|
+
afternoon: "da tarde",
|
|
352
|
+
evening: "da tarde",
|
|
353
|
+
night: "da noite"
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
var ordinalNumber = (dirtyNumber, options) => {
|
|
357
|
+
const number = Number(dirtyNumber);
|
|
358
|
+
if (options?.unit === "week") {
|
|
359
|
+
return number + "\xAA";
|
|
360
|
+
}
|
|
361
|
+
return number + "\xBA";
|
|
362
|
+
};
|
|
363
|
+
var localize = {
|
|
364
|
+
ordinalNumber,
|
|
365
|
+
era: buildLocalizeFn({
|
|
366
|
+
values: eraValues,
|
|
367
|
+
defaultWidth: "wide"
|
|
368
|
+
}),
|
|
369
|
+
quarter: buildLocalizeFn({
|
|
370
|
+
values: quarterValues,
|
|
371
|
+
defaultWidth: "wide",
|
|
372
|
+
argumentCallback: (quarter) => quarter - 1
|
|
373
|
+
}),
|
|
374
|
+
month: buildLocalizeFn({
|
|
375
|
+
values: monthValues,
|
|
376
|
+
defaultWidth: "wide"
|
|
377
|
+
}),
|
|
378
|
+
day: buildLocalizeFn({
|
|
379
|
+
values: dayValues,
|
|
380
|
+
defaultWidth: "wide"
|
|
381
|
+
}),
|
|
382
|
+
dayPeriod: buildLocalizeFn({
|
|
383
|
+
values: dayPeriodValues,
|
|
384
|
+
defaultWidth: "wide",
|
|
385
|
+
formattingValues: formattingDayPeriodValues,
|
|
386
|
+
defaultFormattingWidth: "wide"
|
|
387
|
+
})
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
// ../../node_modules/date-fns/locale/pt-BR/_lib/match.js
|
|
391
|
+
var matchOrdinalNumberPattern = /^(\d+)[ºªo]?/i;
|
|
392
|
+
var parseOrdinalNumberPattern = /\d+/i;
|
|
393
|
+
var matchEraPatterns = {
|
|
394
|
+
narrow: /^(ac|dc|a|d)/i,
|
|
395
|
+
abbreviated: /^(a\.?\s?c\.?|d\.?\s?c\.?)/i,
|
|
396
|
+
wide: /^(antes de cristo|depois de cristo)/i
|
|
397
|
+
};
|
|
398
|
+
var parseEraPatterns = {
|
|
399
|
+
any: [/^ac/i, /^dc/i],
|
|
400
|
+
wide: [/^antes de cristo/i, /^depois de cristo/i]
|
|
401
|
+
};
|
|
402
|
+
var matchQuarterPatterns = {
|
|
403
|
+
narrow: /^[1234]/i,
|
|
404
|
+
abbreviated: /^T[1234]/i,
|
|
405
|
+
wide: /^[1234](º)? trimestre/i
|
|
406
|
+
};
|
|
407
|
+
var parseQuarterPatterns = {
|
|
408
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
409
|
+
};
|
|
410
|
+
var matchMonthPatterns = {
|
|
411
|
+
narrow: /^[jfmajsond]/i,
|
|
412
|
+
abbreviated: /^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,
|
|
413
|
+
wide: /^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i
|
|
414
|
+
};
|
|
415
|
+
var parseMonthPatterns = {
|
|
416
|
+
narrow: [
|
|
417
|
+
/^j/i,
|
|
418
|
+
/^f/i,
|
|
419
|
+
/^m/i,
|
|
420
|
+
/^a/i,
|
|
421
|
+
/^m/i,
|
|
422
|
+
/^j/i,
|
|
423
|
+
/^j/i,
|
|
424
|
+
/^a/i,
|
|
425
|
+
/^s/i,
|
|
426
|
+
/^o/i,
|
|
427
|
+
/^n/i,
|
|
428
|
+
/^d/i
|
|
429
|
+
],
|
|
430
|
+
any: [
|
|
431
|
+
/^ja/i,
|
|
432
|
+
/^fev/i,
|
|
433
|
+
/^mar/i,
|
|
434
|
+
/^abr/i,
|
|
435
|
+
/^mai/i,
|
|
436
|
+
/^jun/i,
|
|
437
|
+
/^jul/i,
|
|
438
|
+
/^ago/i,
|
|
439
|
+
/^set/i,
|
|
440
|
+
/^out/i,
|
|
441
|
+
/^nov/i,
|
|
442
|
+
/^dez/i
|
|
443
|
+
]
|
|
444
|
+
};
|
|
445
|
+
var matchDayPatterns = {
|
|
446
|
+
narrow: /^(dom|[23456]ª?|s[aá]b)/i,
|
|
447
|
+
short: /^(dom|[23456]ª?|s[aá]b)/i,
|
|
448
|
+
abbreviated: /^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,
|
|
449
|
+
wide: /^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i
|
|
450
|
+
};
|
|
451
|
+
var parseDayPatterns = {
|
|
452
|
+
short: [/^d/i, /^2/i, /^3/i, /^4/i, /^5/i, /^6/i, /^s[aá]/i],
|
|
453
|
+
narrow: [/^d/i, /^2/i, /^3/i, /^4/i, /^5/i, /^6/i, /^s[aá]/i],
|
|
454
|
+
any: [/^d/i, /^seg/i, /^t/i, /^qua/i, /^qui/i, /^sex/i, /^s[aá]b/i]
|
|
455
|
+
};
|
|
456
|
+
var matchDayPeriodPatterns = {
|
|
457
|
+
narrow: /^(a|p|mn|md|(da) (manhã|tarde|noite))/i,
|
|
458
|
+
any: /^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i
|
|
459
|
+
};
|
|
460
|
+
var parseDayPeriodPatterns = {
|
|
461
|
+
any: {
|
|
462
|
+
am: /^a/i,
|
|
463
|
+
pm: /^p/i,
|
|
464
|
+
midnight: /^mn|^meia[-\s]noite/i,
|
|
465
|
+
noon: /^md|^meio[-\s]dia/i,
|
|
466
|
+
morning: /manhã/i,
|
|
467
|
+
afternoon: /tarde/i,
|
|
468
|
+
evening: /tarde/i,
|
|
469
|
+
night: /noite/i
|
|
470
|
+
}
|
|
471
|
+
};
|
|
472
|
+
var match = {
|
|
473
|
+
ordinalNumber: buildMatchPatternFn({
|
|
474
|
+
matchPattern: matchOrdinalNumberPattern,
|
|
475
|
+
parsePattern: parseOrdinalNumberPattern,
|
|
476
|
+
valueCallback: (value) => parseInt(value, 10)
|
|
477
|
+
}),
|
|
478
|
+
era: buildMatchFn({
|
|
479
|
+
matchPatterns: matchEraPatterns,
|
|
480
|
+
defaultMatchWidth: "wide",
|
|
481
|
+
parsePatterns: parseEraPatterns,
|
|
482
|
+
defaultParseWidth: "any"
|
|
483
|
+
}),
|
|
484
|
+
quarter: buildMatchFn({
|
|
485
|
+
matchPatterns: matchQuarterPatterns,
|
|
486
|
+
defaultMatchWidth: "wide",
|
|
487
|
+
parsePatterns: parseQuarterPatterns,
|
|
488
|
+
defaultParseWidth: "any",
|
|
489
|
+
valueCallback: (index) => index + 1
|
|
490
|
+
}),
|
|
491
|
+
month: buildMatchFn({
|
|
492
|
+
matchPatterns: matchMonthPatterns,
|
|
493
|
+
defaultMatchWidth: "wide",
|
|
494
|
+
parsePatterns: parseMonthPatterns,
|
|
495
|
+
defaultParseWidth: "any"
|
|
496
|
+
}),
|
|
497
|
+
day: buildMatchFn({
|
|
498
|
+
matchPatterns: matchDayPatterns,
|
|
499
|
+
defaultMatchWidth: "wide",
|
|
500
|
+
parsePatterns: parseDayPatterns,
|
|
501
|
+
defaultParseWidth: "any"
|
|
502
|
+
}),
|
|
503
|
+
dayPeriod: buildMatchFn({
|
|
504
|
+
matchPatterns: matchDayPeriodPatterns,
|
|
505
|
+
defaultMatchWidth: "any",
|
|
506
|
+
parsePatterns: parseDayPeriodPatterns,
|
|
507
|
+
defaultParseWidth: "any"
|
|
508
|
+
})
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
// ../../node_modules/date-fns/locale/pt-BR.js
|
|
512
|
+
var ptBR = {
|
|
513
|
+
code: "pt-BR",
|
|
514
|
+
formatDistance,
|
|
515
|
+
formatLong,
|
|
516
|
+
formatRelative,
|
|
517
|
+
localize,
|
|
518
|
+
match,
|
|
519
|
+
options: {
|
|
520
|
+
weekStartsOn: 0,
|
|
521
|
+
firstWeekContainsDate: 1
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
// src/components/calendar.tsx
|
|
526
|
+
import { cx as cx3 } from "@xjur-ui/util";
|
|
527
|
+
import {
|
|
528
|
+
DayPicker,
|
|
529
|
+
getDefaultClassNames
|
|
530
|
+
} from "react-day-picker";
|
|
531
|
+
|
|
532
|
+
// src/components/icon.tsx
|
|
533
|
+
import { cx } from "@xjur-ui/util";
|
|
534
|
+
import { jsx } from "react/jsx-runtime";
|
|
535
|
+
function Icon({ className, filled = false, name, ...props }) {
|
|
536
|
+
return /* @__PURE__ */ jsx(
|
|
537
|
+
"span",
|
|
538
|
+
{
|
|
539
|
+
...props,
|
|
540
|
+
className: cx(
|
|
541
|
+
"material-symbols-outlined",
|
|
542
|
+
"text-size-body-lg",
|
|
543
|
+
className
|
|
544
|
+
),
|
|
545
|
+
style: {
|
|
546
|
+
fontVariationSettings: `'FILL' ${filled ? 1 : 0}, 'wght' 600, 'GRAD' 0, 'opsz' 20`,
|
|
547
|
+
...props.style
|
|
548
|
+
},
|
|
549
|
+
children: name
|
|
550
|
+
}
|
|
551
|
+
);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
// src/components/button.tsx
|
|
555
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
556
|
+
import { cva, cx as cx2 } from "@xjur-ui/util";
|
|
557
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
558
|
+
var buttonVariants = cva(
|
|
559
|
+
[
|
|
560
|
+
"outline-none inline-flex items-center justify-center rounded-circle gap-small cursor-pointer disabled:opacity-38 disabled:pointer-events-none transition-colors"
|
|
561
|
+
],
|
|
562
|
+
{
|
|
563
|
+
variants: {
|
|
564
|
+
size: {
|
|
565
|
+
md: "py-small_1x-alt px-medium text-size-body-md",
|
|
566
|
+
sm: "py-small-1x px-small text-size-label-sm",
|
|
567
|
+
icon_md: "p-small text-size-body-md h-large-4x w-large-4x",
|
|
568
|
+
icon_sm: "p-small-1x text-size-label-sm h-large-2x w-large-2x"
|
|
569
|
+
},
|
|
570
|
+
variant: {
|
|
571
|
+
primary: "",
|
|
572
|
+
secondary: "",
|
|
573
|
+
tertiary: "",
|
|
574
|
+
destructive: "",
|
|
575
|
+
outlined: "bg-layer-2-idle border border-border-layer-2 hover:bg-layer-2-hover active:bg-layer-2-pressed"
|
|
576
|
+
},
|
|
577
|
+
appearance: {
|
|
578
|
+
solid: "",
|
|
579
|
+
ghost: "bg-transparent"
|
|
580
|
+
}
|
|
581
|
+
},
|
|
582
|
+
compoundVariants: [
|
|
583
|
+
{
|
|
584
|
+
variant: "primary",
|
|
585
|
+
appearance: "solid",
|
|
586
|
+
class: "bg-primary-idle text-neutral-label hover:bg-primary-hover active:bg-primary-pressed"
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
variant: "primary",
|
|
590
|
+
appearance: "ghost",
|
|
591
|
+
class: "text-primary-idle hover:bg-primary-alt-idle active:bg-primary-alt-pressed"
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
variant: "secondary",
|
|
595
|
+
appearance: "solid",
|
|
596
|
+
class: "bg-layer-1-hover text-neutral-dark hover:bg-layer-1-pressed active:bg-layer-1-active"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
variant: "secondary",
|
|
600
|
+
appearance: "ghost",
|
|
601
|
+
class: "hover:bg-layer-1-hover active:bg-layer-1-pressed"
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
variant: "tertiary",
|
|
605
|
+
appearance: "solid",
|
|
606
|
+
class: "bg-layer-2-hover text-neutral-dark hover:bg-layer-2-pressed active:bg-layer-2-active"
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
variant: "tertiary",
|
|
610
|
+
appearance: "ghost",
|
|
611
|
+
class: "hover:bg-layer-2-hover active:bg-layer-2-pressed"
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
variant: "destructive",
|
|
615
|
+
appearance: "solid",
|
|
616
|
+
class: "bg-danger-idle text-neutral-label hover:bg-danger-hover active:bg-danger-pressed"
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
variant: "destructive",
|
|
620
|
+
appearance: "ghost",
|
|
621
|
+
class: "text-danger-label-idle hover:bg-danger-alt-idle active:bg-danger-alt-pressed"
|
|
622
|
+
}
|
|
623
|
+
],
|
|
624
|
+
defaultVariants: {
|
|
625
|
+
size: "md",
|
|
626
|
+
variant: "primary",
|
|
627
|
+
appearance: "solid"
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
);
|
|
631
|
+
function Button({
|
|
632
|
+
asChild,
|
|
633
|
+
className,
|
|
634
|
+
variant = "primary",
|
|
635
|
+
size = "md",
|
|
636
|
+
appearance = "solid",
|
|
637
|
+
...props
|
|
638
|
+
}) {
|
|
639
|
+
const Component = asChild ? Slot : "button";
|
|
640
|
+
return /* @__PURE__ */ jsx2(
|
|
641
|
+
Component,
|
|
642
|
+
{
|
|
643
|
+
className: cx2(buttonVariants({ variant, appearance, size }), className),
|
|
644
|
+
...props
|
|
645
|
+
}
|
|
646
|
+
);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
// src/components/calendar.tsx
|
|
650
|
+
import {} from "react-day-picker";
|
|
651
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
652
|
+
function capitalize(str) {
|
|
653
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
654
|
+
}
|
|
655
|
+
function Calendar({
|
|
656
|
+
showOutsideDays = true,
|
|
657
|
+
locale = ptBR,
|
|
658
|
+
navLayout = "around",
|
|
659
|
+
handleClear,
|
|
660
|
+
handleToday,
|
|
661
|
+
...props
|
|
662
|
+
}) {
|
|
663
|
+
const defaultClassNames = getDefaultClassNames();
|
|
664
|
+
const classNames = {
|
|
665
|
+
root: cx3(
|
|
666
|
+
"bg-layer-2-idle shadow-elevation-2 rounded-[6px] p-small w-fit border border-border-layer-2 text-size-body-md text-neutral-dark font-inter",
|
|
667
|
+
defaultClassNames.root
|
|
668
|
+
),
|
|
669
|
+
day: cx3("rounded-circle hover:bg-layer-2-hover"),
|
|
670
|
+
caption_label: cx3(
|
|
671
|
+
"text-size-label-md text-neutral-dark font-medium",
|
|
672
|
+
defaultClassNames.caption_label
|
|
673
|
+
),
|
|
674
|
+
outside: cx3("text-neutral-placeholder", defaultClassNames.outside),
|
|
675
|
+
selected: cx3(
|
|
676
|
+
"text-size-body-md bg-primary-alt-active text-primary-label-active font-medium hover:bg-primary-alt-active"
|
|
677
|
+
),
|
|
678
|
+
disabled: cx3("opacity-60", defaultClassNames.disabled),
|
|
679
|
+
today: cx3(
|
|
680
|
+
"!text-primary-label-active font-medium",
|
|
681
|
+
defaultClassNames.today
|
|
682
|
+
),
|
|
683
|
+
range_start: cx3(
|
|
684
|
+
"text-size-body-md bg-primary-alt-active text-primary-label-active font-medium hover:bg-primary-alt-active"
|
|
685
|
+
),
|
|
686
|
+
range_end: cx3(
|
|
687
|
+
"text-size-body-md bg-primary-alt-active text-primary-label-active font-medium hover:bg-primary-alt-active"
|
|
688
|
+
),
|
|
689
|
+
range_middle: cx3("!bg-layer-2-hover !text-primary-label-active")
|
|
690
|
+
};
|
|
691
|
+
return /* @__PURE__ */ jsx3(
|
|
692
|
+
DayPicker,
|
|
693
|
+
{
|
|
694
|
+
classNames: { ...classNames, ...props.classNames },
|
|
695
|
+
components: {
|
|
696
|
+
Chevron: ({ orientation }) => {
|
|
697
|
+
const icon = orientation === "left" ? "chevron_left" : "chevron_right";
|
|
698
|
+
return /* @__PURE__ */ jsx3(
|
|
699
|
+
Icon,
|
|
700
|
+
{
|
|
701
|
+
className: "size-large text-icon-neutral-3",
|
|
702
|
+
name: icon
|
|
703
|
+
}
|
|
704
|
+
);
|
|
705
|
+
},
|
|
706
|
+
...props.components
|
|
707
|
+
},
|
|
708
|
+
footer: (handleClear || handleToday) && /* @__PURE__ */ jsxs("div", { className: "py-small border-border-layer-2 mt-small flex h-full w-full items-center justify-between border-t", children: [
|
|
709
|
+
handleToday && /* @__PURE__ */ jsx3(
|
|
710
|
+
Button,
|
|
711
|
+
{
|
|
712
|
+
appearance: "ghost",
|
|
713
|
+
variant: "secondary",
|
|
714
|
+
onClick: handleToday,
|
|
715
|
+
children: "Hoje"
|
|
716
|
+
}
|
|
717
|
+
),
|
|
718
|
+
handleClear && /* @__PURE__ */ jsx3(
|
|
719
|
+
Button,
|
|
720
|
+
{
|
|
721
|
+
appearance: "ghost",
|
|
722
|
+
variant: "secondary",
|
|
723
|
+
onClick: handleClear,
|
|
724
|
+
children: "Limpar"
|
|
725
|
+
}
|
|
726
|
+
)
|
|
727
|
+
] }),
|
|
728
|
+
formatters: {
|
|
729
|
+
formatWeekdayName: (date) => {
|
|
730
|
+
const weekday = date.toLocaleDateString("pt-BR", { weekday: "short" });
|
|
731
|
+
return weekday.charAt(0).toUpperCase() + weekday.slice(1).replace(".", "");
|
|
732
|
+
},
|
|
733
|
+
formatCaption(month) {
|
|
734
|
+
const monthName = month.toLocaleDateString("pt-BR", {
|
|
735
|
+
month: "long"
|
|
736
|
+
});
|
|
737
|
+
return `${capitalize(monthName)} ${month.getFullYear()}`;
|
|
738
|
+
},
|
|
739
|
+
...props.formatters
|
|
740
|
+
},
|
|
741
|
+
locale,
|
|
742
|
+
mode: props.mode ?? "single",
|
|
743
|
+
navLayout,
|
|
744
|
+
showOutsideDays,
|
|
745
|
+
...props
|
|
746
|
+
}
|
|
747
|
+
);
|
|
748
|
+
}
|
|
749
|
+
export {
|
|
750
|
+
Calendar
|
|
751
|
+
};
|