@feitio/react 0.0.0-stage → 0.2.0
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/LICENSE +21 -0
- package/README.md +35 -2
- package/dist/Anchor.d.ts +19 -0
- package/dist/AppShell.d.ts +24 -0
- package/dist/BackToTop.d.ts +8 -0
- package/dist/Block.d.ts +7 -0
- package/dist/Breadcrumbs.d.ts +12 -0
- package/dist/Button.d.ts +16 -0
- package/dist/Checkbox.d.ts +11 -0
- package/dist/CodeBlock.d.ts +10 -0
- package/dist/Details.d.ts +9 -0
- package/dist/Dialog.d.ts +21 -0
- package/dist/Divider.d.ts +7 -0
- package/dist/DoDont.d.ts +14 -0
- package/dist/Drawer.d.ts +13 -0
- package/dist/EmptyState.d.ts +11 -0
- package/dist/ErrorMessage.d.ts +8 -0
- package/dist/ErrorSummary.d.ts +11 -0
- package/dist/Example.d.ts +14 -0
- package/dist/FeitioProvider.d.ts +8 -0
- package/dist/Field.d.ts +15 -0
- package/dist/Fieldset.d.ts +8 -0
- package/dist/FilterField.d.ts +19 -0
- package/dist/Footer.d.ts +14 -0
- package/dist/Grid.d.ts +10 -0
- package/dist/Header.d.ts +22 -0
- package/dist/Heading.d.ts +8 -0
- package/dist/Hint.d.ts +7 -0
- package/dist/Icon.d.ts +9 -0
- package/dist/Inline.d.ts +9 -0
- package/dist/Kbd.d.ts +5 -0
- package/dist/Label.d.ts +8 -0
- package/dist/Link.d.ts +11 -0
- package/dist/LinkCard.d.ts +9 -0
- package/dist/Menu.d.ts +25 -0
- package/dist/Nav.d.ts +17 -0
- package/dist/Notice.d.ts +19 -0
- package/dist/Pagination.d.ts +20 -0
- package/dist/Radios.d.ts +13 -0
- package/dist/ScrollFade.d.ts +3 -0
- package/dist/Search.d.ts +17 -0
- package/dist/SegmentedControl.d.ts +9 -0
- package/dist/Select.d.ts +16 -0
- package/dist/SkipLink.d.ts +6 -0
- package/dist/Stack.d.ts +9 -0
- package/dist/StatusOverlay.d.ts +12 -0
- package/dist/SummaryList.d.ts +13 -0
- package/dist/Swatch.d.ts +5 -0
- package/dist/Switch.d.ts +12 -0
- package/dist/Table.d.ts +18 -0
- package/dist/Tag.d.ts +9 -0
- package/dist/TaskList.d.ts +13 -0
- package/dist/Text.d.ts +5 -0
- package/dist/TextInput.d.ts +10 -0
- package/dist/Textarea.d.ts +8 -0
- package/dist/TimeInput.d.ts +14 -0
- package/dist/VisuallyHidden.d.ts +5 -0
- package/dist/actions/notices.d.ts +16 -0
- package/dist/actions/status.d.ts +5 -0
- package/dist/actions/use-element-behavior.d.ts +6 -0
- package/dist/actions/use-page-behavior.d.ts +6 -0
- package/dist/actions/use-sprite.d.ts +2 -0
- package/dist/actions/wire.d.ts +10 -0
- package/dist/calculations/pagination.d.ts +10 -0
- package/dist/calculations/svg-parts.d.ts +9 -0
- package/dist/calculations/text.d.ts +4 -0
- package/dist/data/sprite.d.ts +4 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +2482 -0
- package/package.json +56 -4
- package/src/Anchor.tsx +47 -0
- package/src/AppShell.tsx +95 -0
- package/src/BackToTop.tsx +26 -0
- package/src/Block.tsx +11 -0
- package/src/Breadcrumbs.tsx +40 -0
- package/src/Button.tsx +40 -0
- package/src/Checkbox.tsx +34 -0
- package/src/CodeBlock.tsx +38 -0
- package/src/Details.tsx +22 -0
- package/src/Dialog.tsx +70 -0
- package/src/Divider.tsx +17 -0
- package/src/DoDont.tsx +46 -0
- package/src/Drawer.tsx +52 -0
- package/src/EmptyState.tsx +37 -0
- package/src/ErrorMessage.tsx +18 -0
- package/src/ErrorSummary.tsx +27 -0
- package/src/Example.tsx +45 -0
- package/src/FeitioProvider.tsx +13 -0
- package/src/Field.tsx +45 -0
- package/src/Fieldset.tsx +18 -0
- package/src/FilterField.tsx +61 -0
- package/src/Footer.tsx +37 -0
- package/src/Grid.tsx +19 -0
- package/src/Header.tsx +60 -0
- package/src/Heading.tsx +13 -0
- package/src/Hint.tsx +15 -0
- package/src/Icon.tsx +19 -0
- package/src/Inline.tsx +17 -0
- package/src/Kbd.tsx +6 -0
- package/src/Label.tsx +16 -0
- package/src/Link.tsx +33 -0
- package/src/LinkCard.tsx +22 -0
- package/src/Menu.tsx +73 -0
- package/src/Nav.tsx +36 -0
- package/src/Notice.tsx +73 -0
- package/src/Pagination.tsx +98 -0
- package/src/Radios.tsx +43 -0
- package/src/ScrollFade.tsx +10 -0
- package/src/Search.tsx +66 -0
- package/src/SegmentedControl.tsx +36 -0
- package/src/Select.tsx +50 -0
- package/src/SkipLink.tsx +16 -0
- package/src/Stack.tsx +17 -0
- package/src/StatusOverlay.tsx +46 -0
- package/src/SummaryList.tsx +27 -0
- package/src/Swatch.tsx +11 -0
- package/src/Switch.tsx +41 -0
- package/src/Table.tsx +74 -0
- package/src/Tag.tsx +21 -0
- package/src/TaskList.tsx +34 -0
- package/src/Text.tsx +6 -0
- package/src/TextInput.tsx +29 -0
- package/src/Textarea.tsx +25 -0
- package/src/TimeInput.tsx +59 -0
- package/src/VisuallyHidden.tsx +6 -0
- package/src/actions/notices.ts +30 -0
- package/src/actions/status.ts +13 -0
- package/src/actions/use-element-behavior.ts +23 -0
- package/src/actions/use-page-behavior.ts +17 -0
- package/src/actions/use-sprite.ts +8 -0
- package/src/actions/wire.ts +30 -0
- package/src/calculations/pagination.ts +15 -0
- package/src/calculations/svg-parts.ts +22 -0
- package/src/calculations/text.ts +9 -0
- package/src/data/sprite.ts +7 -0
- package/src/index.ts +59 -0
- package/src/text-modules.d.ts +5 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,2482 @@
|
|
|
1
|
+
// src/actions/use-sprite.ts
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
|
|
4
|
+
// src/data/sprite.ts
|
|
5
|
+
import { createContext } from "react";
|
|
6
|
+
var DEFAULT_SPRITE = "/feitio/icons/sprite.svg";
|
|
7
|
+
var SpriteContext = createContext(undefined);
|
|
8
|
+
|
|
9
|
+
// src/actions/use-sprite.ts
|
|
10
|
+
function useSprite(own) {
|
|
11
|
+
const shared = useContext(SpriteContext);
|
|
12
|
+
return own ?? shared ?? DEFAULT_SPRITE;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// src/Icon.tsx
|
|
16
|
+
import { jsx } from "react/jsx-runtime";
|
|
17
|
+
function Icon({ name, sprite }) {
|
|
18
|
+
const href = useSprite(sprite);
|
|
19
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
20
|
+
className: "feitio-icon",
|
|
21
|
+
"aria-hidden": "true",
|
|
22
|
+
children: /* @__PURE__ */ jsx("use", {
|
|
23
|
+
href: `${href}#feitio-${name}`
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// src/Anchor.tsx
|
|
29
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
30
|
+
function Anchor({ title, items, label, sprite }) {
|
|
31
|
+
return /* @__PURE__ */ jsxs("nav", {
|
|
32
|
+
className: "feitio-anchor",
|
|
33
|
+
"aria-label": label ?? title,
|
|
34
|
+
children: [
|
|
35
|
+
title && /* @__PURE__ */ jsx2("p", {
|
|
36
|
+
className: "title",
|
|
37
|
+
children: title
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ jsx2("ul", {
|
|
40
|
+
children: items.map((t) => /* @__PURE__ */ jsxs("li", {
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsxs("a", {
|
|
43
|
+
href: `#${t.id}`,
|
|
44
|
+
"aria-current": t.current ? "location" : undefined,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsx2(Icon, {
|
|
47
|
+
name: "chevron-right",
|
|
48
|
+
sprite
|
|
49
|
+
}),
|
|
50
|
+
t.text
|
|
51
|
+
]
|
|
52
|
+
}),
|
|
53
|
+
t.children && /* @__PURE__ */ jsx2("ul", {
|
|
54
|
+
children: t.children.map((c) => /* @__PURE__ */ jsx2("li", {
|
|
55
|
+
children: /* @__PURE__ */ jsxs("a", {
|
|
56
|
+
href: `#${c.id}`,
|
|
57
|
+
"aria-current": c.current ? "location" : undefined,
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ jsx2(Icon, {
|
|
60
|
+
name: "chevron-right",
|
|
61
|
+
sprite
|
|
62
|
+
}),
|
|
63
|
+
c.text
|
|
64
|
+
]
|
|
65
|
+
})
|
|
66
|
+
}, c.id))
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
}, t.id))
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
// src/AppShell.tsx
|
|
75
|
+
import { useRef } from "react";
|
|
76
|
+
|
|
77
|
+
// src/actions/use-element-behavior.ts
|
|
78
|
+
import { useEffect } from "react";
|
|
79
|
+
var wired = new WeakMap;
|
|
80
|
+
function useElementBehavior(ref, name, wire) {
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
const element = ref.current;
|
|
83
|
+
if (!element)
|
|
84
|
+
return;
|
|
85
|
+
const names = wired.get(element) ?? new Set;
|
|
86
|
+
if (names.has(name))
|
|
87
|
+
return;
|
|
88
|
+
names.add(name);
|
|
89
|
+
wired.set(element, names);
|
|
90
|
+
wire(element);
|
|
91
|
+
}, [ref, name, wire]);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// ../vanilla/src/dialog/calculations/confirm-word.ts
|
|
95
|
+
function typedTheWord(typed, word) {
|
|
96
|
+
return typed.trim().toUpperCase() === word.trim().toUpperCase() && word.trim() !== "";
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// ../vanilla/src/dialog/actions/wire-dialogs.ts
|
|
100
|
+
function wireDialogs(window2, root) {
|
|
101
|
+
const document = window2.document;
|
|
102
|
+
root.addEventListener("click", (event) => {
|
|
103
|
+
const opener = event.target.closest("[data-open-dialog]");
|
|
104
|
+
if (!opener)
|
|
105
|
+
return;
|
|
106
|
+
const dialog = document.getElementById(opener.dataset.openDialog ?? "");
|
|
107
|
+
if (!dialog || dialog.open)
|
|
108
|
+
return;
|
|
109
|
+
dialog.showModal();
|
|
110
|
+
dialog.querySelector("[data-type-to-confirm] input")?.focus();
|
|
111
|
+
dialog.addEventListener("close", () => {
|
|
112
|
+
const form = dialog.querySelector("[data-type-to-confirm]");
|
|
113
|
+
const input = form?.querySelector("input");
|
|
114
|
+
const danger = form?.querySelector('[data-variant="danger"]');
|
|
115
|
+
if (input)
|
|
116
|
+
input.value = "";
|
|
117
|
+
if (danger)
|
|
118
|
+
danger.disabled = true;
|
|
119
|
+
}, { once: true });
|
|
120
|
+
});
|
|
121
|
+
root.addEventListener("input", (event) => {
|
|
122
|
+
const input = event.target;
|
|
123
|
+
const form = input.closest("[data-type-to-confirm]");
|
|
124
|
+
if (!form)
|
|
125
|
+
return;
|
|
126
|
+
const danger = form.querySelector('[data-variant="danger"]');
|
|
127
|
+
if (danger)
|
|
128
|
+
danger.disabled = !typedTheWord(input.value, form.dataset.typeToConfirm ?? "");
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// ../vanilla/src/dialog/index.ts
|
|
133
|
+
function dialogs(window2, root = window2.document) {
|
|
134
|
+
wireDialogs(window2, root);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// ../vanilla/src/forms/calculations/form-values.ts
|
|
138
|
+
function togglePeriod(period) {
|
|
139
|
+
return period.trim().toUpperCase() === "AM" ? "PM" : "AM";
|
|
140
|
+
}
|
|
141
|
+
function plainText(text) {
|
|
142
|
+
return text.normalize("NFD").replace(/\p{Diacritic}/gu, "").toLowerCase();
|
|
143
|
+
}
|
|
144
|
+
function matchesFilter(itemWords, typed) {
|
|
145
|
+
const words = plainText(typed).split(/\s+/).filter(Boolean);
|
|
146
|
+
const target = plainText(itemWords);
|
|
147
|
+
return words.every((word) => target.includes(word));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// ../vanilla/src/forms/actions/wire-forms.ts
|
|
151
|
+
function wireForms(window2, root) {
|
|
152
|
+
root.addEventListener("change", (event) => {
|
|
153
|
+
const input = event.target;
|
|
154
|
+
const label = input.closest(".feitio-switch");
|
|
155
|
+
if (!label || input.type !== "checkbox")
|
|
156
|
+
return;
|
|
157
|
+
const state = label.querySelector(".state");
|
|
158
|
+
if (state)
|
|
159
|
+
state.textContent = input.checked ? label.dataset.on ?? "Ligado" : label.dataset.off ?? "Desligado";
|
|
160
|
+
});
|
|
161
|
+
root.addEventListener("click", (event) => {
|
|
162
|
+
const target = event.target;
|
|
163
|
+
const option = target.closest(".feitio-segmented button[aria-pressed]");
|
|
164
|
+
if (option && !option.closest("[data-playground] .controls")) {
|
|
165
|
+
for (const sibling of option.parentElement?.querySelectorAll("button[aria-pressed]") ?? [])
|
|
166
|
+
sibling.setAttribute("aria-pressed", String(sibling === option));
|
|
167
|
+
}
|
|
168
|
+
const period = target.closest(".feitio-time-field .period");
|
|
169
|
+
if (period && !period.disabled)
|
|
170
|
+
period.textContent = togglePeriod(period.textContent ?? "AM");
|
|
171
|
+
});
|
|
172
|
+
const timers = new WeakMap;
|
|
173
|
+
function filterNow(field, list) {
|
|
174
|
+
const document = window2.document;
|
|
175
|
+
const listId = list.id;
|
|
176
|
+
const items = [...list.querySelectorAll("[data-search]")];
|
|
177
|
+
list.dataset.filtering = "";
|
|
178
|
+
let shown = 0;
|
|
179
|
+
for (const item of items) {
|
|
180
|
+
const match = matchesFilter(item.dataset.search ?? item.textContent ?? "", field.value);
|
|
181
|
+
item.hidden = !match;
|
|
182
|
+
if (match)
|
|
183
|
+
shown += 1;
|
|
184
|
+
}
|
|
185
|
+
const count = document.querySelector(`[data-count="${listId}"]`);
|
|
186
|
+
if (count)
|
|
187
|
+
count.textContent = field.value.trim() ? `${shown} / ${items.length}` : "";
|
|
188
|
+
const empty = document.querySelector(`[data-empty="${listId}"]`);
|
|
189
|
+
if (empty)
|
|
190
|
+
empty.hidden = shown > 0;
|
|
191
|
+
}
|
|
192
|
+
function run(field, box) {
|
|
193
|
+
const list = window2.document.getElementById(field.dataset.filter ?? "");
|
|
194
|
+
if (field.dataset.async === undefined) {
|
|
195
|
+
if (box)
|
|
196
|
+
delete box.dataset.state;
|
|
197
|
+
if (list)
|
|
198
|
+
filterNow(field, list);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (box)
|
|
202
|
+
box.dataset.state = "busy";
|
|
203
|
+
const busy = window2.document.querySelector(`[data-count="${field.dataset.filter}"]`);
|
|
204
|
+
if (busy && field.dataset.busyLabel)
|
|
205
|
+
busy.textContent = field.dataset.busyLabel;
|
|
206
|
+
const query = field.value;
|
|
207
|
+
const done = () => {
|
|
208
|
+
if (field.value !== query)
|
|
209
|
+
return;
|
|
210
|
+
if (box)
|
|
211
|
+
delete box.dataset.state;
|
|
212
|
+
if (list)
|
|
213
|
+
filterNow(field, list);
|
|
214
|
+
};
|
|
215
|
+
field.dispatchEvent(new CustomEvent("feitio-filter", { bubbles: true, detail: { query, done } }));
|
|
216
|
+
}
|
|
217
|
+
root.addEventListener("input", (event) => {
|
|
218
|
+
const field = event.target;
|
|
219
|
+
if (!field.dataset?.filter)
|
|
220
|
+
return;
|
|
221
|
+
const box = field.closest(".feitio-filter");
|
|
222
|
+
const wait = Number(field.dataset.debounce ?? 0);
|
|
223
|
+
window2.clearTimeout(timers.get(field));
|
|
224
|
+
if (!(wait > 0)) {
|
|
225
|
+
run(field, box);
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (box) {
|
|
229
|
+
box.style.setProperty("--feitio-filter-debounce", `${wait}ms`);
|
|
230
|
+
delete box.dataset.state;
|
|
231
|
+
box.offsetWidth;
|
|
232
|
+
box.dataset.state = "waiting";
|
|
233
|
+
}
|
|
234
|
+
timers.set(field, window2.setTimeout(() => run(field, box), wait));
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// ../vanilla/src/forms/index.ts
|
|
239
|
+
function forms(window2, root = window2.document) {
|
|
240
|
+
wireForms(window2, root);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// ../vanilla/src/menu/calculations/menu-focus.ts
|
|
244
|
+
function nextMenuIndex(key, current, count) {
|
|
245
|
+
if (count === 0)
|
|
246
|
+
return;
|
|
247
|
+
switch (key) {
|
|
248
|
+
case "ArrowDown":
|
|
249
|
+
return current < 0 ? 0 : (current + 1) % count;
|
|
250
|
+
case "ArrowUp":
|
|
251
|
+
return current <= 0 ? count - 1 : current - 1;
|
|
252
|
+
case "Home":
|
|
253
|
+
return 0;
|
|
254
|
+
case "End":
|
|
255
|
+
return count - 1;
|
|
256
|
+
default:
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
function menuPosition(button, menu, viewport, gap) {
|
|
261
|
+
const fitsRight = button.left + menu.width <= viewport.width - gap;
|
|
262
|
+
const left = Math.max(gap, fitsRight ? button.left : button.right - menu.width);
|
|
263
|
+
const fitsBelow = button.bottom + gap + menu.height <= viewport.height - gap;
|
|
264
|
+
const top = fitsBelow ? button.bottom + gap : Math.max(gap, button.top - gap - menu.height);
|
|
265
|
+
return { left, top };
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// ../vanilla/src/menu/actions/wire-menus.ts
|
|
269
|
+
var wired2 = new WeakSet;
|
|
270
|
+
function wireMenus(window2, root) {
|
|
271
|
+
for (const list of root.querySelectorAll(".feitio-menu-list[popover]")) {
|
|
272
|
+
const button = root.querySelector(`[popovertarget="${list.id}"]`);
|
|
273
|
+
if (!button || wired2.has(list))
|
|
274
|
+
continue;
|
|
275
|
+
wired2.add(list);
|
|
276
|
+
const items = () => [...list.querySelectorAll("a, button")];
|
|
277
|
+
list.addEventListener("toggle", (event) => {
|
|
278
|
+
const open = event.newState === "open";
|
|
279
|
+
button.setAttribute("aria-expanded", String(open));
|
|
280
|
+
if (!open)
|
|
281
|
+
return;
|
|
282
|
+
const place = menuPosition(button.getBoundingClientRect(), list.getBoundingClientRect(), { width: window2.innerWidth, height: window2.innerHeight }, 8);
|
|
283
|
+
list.style.left = `${place.left}px`;
|
|
284
|
+
list.style.top = `${place.top}px`;
|
|
285
|
+
const current = items().find((item) => item.getAttribute("aria-current")) ?? items()[0];
|
|
286
|
+
current?.focus();
|
|
287
|
+
});
|
|
288
|
+
list.addEventListener("keydown", (event) => {
|
|
289
|
+
const all = items();
|
|
290
|
+
const next = nextMenuIndex(event.key, all.indexOf(window2.document.activeElement), all.length);
|
|
291
|
+
if (next === undefined)
|
|
292
|
+
return;
|
|
293
|
+
event.preventDefault();
|
|
294
|
+
all[next]?.focus();
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// ../vanilla/src/menu/index.ts
|
|
300
|
+
function menus(window2, root = window2.document) {
|
|
301
|
+
wireMenus(window2, root);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// ../vanilla/src/scroll/calculations/scroll-visibility.ts
|
|
305
|
+
function fadeVisible(scrollTop, viewHeight, scrollHeight) {
|
|
306
|
+
return scrollTop + viewHeight < scrollHeight - 8;
|
|
307
|
+
}
|
|
308
|
+
function backToTopVisible(scrollTop, viewHeight) {
|
|
309
|
+
return scrollTop > viewHeight * 0.5;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// ../vanilla/src/scroll/actions/wire-scrolls.ts
|
|
313
|
+
function wireScrolls(window2, root) {
|
|
314
|
+
const document = window2.document;
|
|
315
|
+
function scrollerOf(element) {
|
|
316
|
+
for (let parent = element.parentElement;parent; parent = parent.parentElement) {
|
|
317
|
+
const overflow = window2.getComputedStyle(parent).overflowY;
|
|
318
|
+
if (overflow === "auto" || overflow === "scroll")
|
|
319
|
+
return parent;
|
|
320
|
+
}
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
for (const element of root.querySelectorAll(".feitio-scroll-fade, .feitio-back-to-top")) {
|
|
324
|
+
if (element.dataset.wired !== undefined)
|
|
325
|
+
continue;
|
|
326
|
+
element.dataset.wired = "";
|
|
327
|
+
const box = scrollerOf(element);
|
|
328
|
+
const area = box ?? document.documentElement;
|
|
329
|
+
const fade = element.classList.contains("feitio-scroll-fade");
|
|
330
|
+
const update = () => {
|
|
331
|
+
const visible = fade ? fadeVisible(area.scrollTop, area.clientHeight, area.scrollHeight) : backToTopVisible(area.scrollTop, area.clientHeight);
|
|
332
|
+
element.toggleAttribute("data-visible", visible);
|
|
333
|
+
};
|
|
334
|
+
(box ?? window2).addEventListener("scroll", update, { passive: true });
|
|
335
|
+
window2.addEventListener("resize", update);
|
|
336
|
+
update();
|
|
337
|
+
if (!fade) {
|
|
338
|
+
element.addEventListener("click", (event) => {
|
|
339
|
+
event.preventDefault();
|
|
340
|
+
const still = window2.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
341
|
+
area.scrollTo({ top: 0, behavior: still ? "auto" : "smooth" });
|
|
342
|
+
const target = element.getAttribute("href");
|
|
343
|
+
if (target?.startsWith("#"))
|
|
344
|
+
document.querySelector(target)?.focus({ preventScroll: true });
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// ../vanilla/src/scroll/index.ts
|
|
351
|
+
function scrolls(window2, root = window2.document) {
|
|
352
|
+
wireScrolls(window2, root);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// ../vanilla/src/notice/data/notice.ts
|
|
356
|
+
var LEAVE_FALLBACK_MS = 600;
|
|
357
|
+
|
|
358
|
+
// ../vanilla/src/notice/actions/close-notice.ts
|
|
359
|
+
function closeNotice(host, notice) {
|
|
360
|
+
if (notice.hidden || notice.classList.contains("leaving"))
|
|
361
|
+
return;
|
|
362
|
+
host.clocks.get(notice)?.();
|
|
363
|
+
host.clocks.delete(notice);
|
|
364
|
+
notice.classList.add("leaving");
|
|
365
|
+
function done() {
|
|
366
|
+
notice.hidden = true;
|
|
367
|
+
notice.classList.remove("leaving");
|
|
368
|
+
}
|
|
369
|
+
notice.addEventListener("animationend", done, { once: true });
|
|
370
|
+
host.window.setTimeout(() => {
|
|
371
|
+
if (!notice.hidden)
|
|
372
|
+
done();
|
|
373
|
+
}, LEAVE_FALLBACK_MS);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// ../vanilla/src/notice/calculations/notice-timer.ts
|
|
377
|
+
function closesByItself(status, timeoutMs) {
|
|
378
|
+
return (status === "info" || status === "ok") && Number.isFinite(timeoutMs) && timeoutMs > 0;
|
|
379
|
+
}
|
|
380
|
+
function noticeStatus(attribute) {
|
|
381
|
+
return attribute === "ok" || attribute === "warn" || attribute === "error" ? attribute : "info";
|
|
382
|
+
}
|
|
383
|
+
function noticeProgress(usedMs, timeoutMs) {
|
|
384
|
+
if (timeoutMs <= 0)
|
|
385
|
+
return 1;
|
|
386
|
+
return Math.min(Math.max(usedMs / timeoutMs, 0), 1);
|
|
387
|
+
}
|
|
388
|
+
function countFrame(usedMs, elapsedMs, paused) {
|
|
389
|
+
return paused ? usedMs : usedMs + Math.max(elapsedMs, 0);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// ../vanilla/src/notice/actions/start-notice-timer.ts
|
|
393
|
+
function startNoticeTimer(host, notice) {
|
|
394
|
+
host.clocks.get(notice)?.();
|
|
395
|
+
const total = Number(notice.dataset.timeout);
|
|
396
|
+
if (!closesByItself(noticeStatus(notice.dataset.status), total))
|
|
397
|
+
return;
|
|
398
|
+
const { window: window2 } = host;
|
|
399
|
+
let used = 0;
|
|
400
|
+
let last = window2.performance.now();
|
|
401
|
+
let paused = notice.matches(":hover, :focus-within");
|
|
402
|
+
let frame = 0;
|
|
403
|
+
function pause() {
|
|
404
|
+
paused = true;
|
|
405
|
+
}
|
|
406
|
+
function resume() {
|
|
407
|
+
window2.setTimeout(() => {
|
|
408
|
+
if (notice.matches(":hover, :focus-within"))
|
|
409
|
+
return;
|
|
410
|
+
paused = false;
|
|
411
|
+
last = window2.performance.now();
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
const listeners = [
|
|
415
|
+
["mouseenter", pause],
|
|
416
|
+
["focusin", pause],
|
|
417
|
+
["mouseleave", resume],
|
|
418
|
+
["focusout", resume]
|
|
419
|
+
];
|
|
420
|
+
for (const [event, listener] of listeners)
|
|
421
|
+
notice.addEventListener(event, listener);
|
|
422
|
+
function tick(now) {
|
|
423
|
+
used = countFrame(used, now - last, paused);
|
|
424
|
+
last = now;
|
|
425
|
+
const progress = noticeProgress(used, total);
|
|
426
|
+
notice.style.setProperty("--notice-p", progress.toFixed(4));
|
|
427
|
+
if (progress >= 1)
|
|
428
|
+
closeNotice(host, notice);
|
|
429
|
+
else
|
|
430
|
+
frame = window2.requestAnimationFrame(tick);
|
|
431
|
+
}
|
|
432
|
+
host.clocks.set(notice, () => {
|
|
433
|
+
window2.cancelAnimationFrame(frame);
|
|
434
|
+
for (const [event, listener] of listeners)
|
|
435
|
+
notice.removeEventListener(event, listener);
|
|
436
|
+
});
|
|
437
|
+
frame = window2.requestAnimationFrame(tick);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// ../vanilla/src/notice/actions/show-notice.ts
|
|
441
|
+
function showNotice(host, notice) {
|
|
442
|
+
if (notice.hidden) {
|
|
443
|
+
notice.hidden = false;
|
|
444
|
+
notice.classList.remove("feitio-place");
|
|
445
|
+
notice.offsetWidth;
|
|
446
|
+
notice.classList.add("feitio-place");
|
|
447
|
+
}
|
|
448
|
+
notice.style.setProperty("--notice-p", "0");
|
|
449
|
+
startNoticeTimer(host, notice);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// ../vanilla/src/notice/actions/wire-notices.ts
|
|
453
|
+
var wired3 = new WeakSet;
|
|
454
|
+
function wireNotices(host, root) {
|
|
455
|
+
const own = "matches" in root && root.matches(".feitio-notice");
|
|
456
|
+
const notices = [
|
|
457
|
+
...own ? [root] : [],
|
|
458
|
+
...root.querySelectorAll(".feitio-notice")
|
|
459
|
+
];
|
|
460
|
+
const Observer = host.window.IntersectionObserver;
|
|
461
|
+
const seen = Observer ? new Observer((entries) => {
|
|
462
|
+
for (const entry of entries) {
|
|
463
|
+
if (!entry.isIntersecting)
|
|
464
|
+
continue;
|
|
465
|
+
seen?.unobserve(entry.target);
|
|
466
|
+
startNoticeTimer(host, entry.target);
|
|
467
|
+
}
|
|
468
|
+
}, { threshold: 0.9 }) : undefined;
|
|
469
|
+
for (const notice of notices) {
|
|
470
|
+
if (wired3.has(notice))
|
|
471
|
+
continue;
|
|
472
|
+
wired3.add(notice);
|
|
473
|
+
notice.querySelector(".close")?.addEventListener("click", () => closeNotice(host, notice));
|
|
474
|
+
if (!notice.dataset.timeout || notice.hidden)
|
|
475
|
+
continue;
|
|
476
|
+
if (seen)
|
|
477
|
+
seen.observe(notice);
|
|
478
|
+
else
|
|
479
|
+
startNoticeTimer(host, notice);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
// ../vanilla/src/notice/index.ts
|
|
484
|
+
function notices(window2, root = window2.document) {
|
|
485
|
+
const host = { window: window2, clocks: new WeakMap };
|
|
486
|
+
wireNotices(host, root);
|
|
487
|
+
return {
|
|
488
|
+
show: (notice) => showNotice(host, notice),
|
|
489
|
+
close: (notice) => closeNotice(host, notice),
|
|
490
|
+
wire: (more) => wireNotices(host, more)
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// src/actions/notices.ts
|
|
495
|
+
import { useCallback } from "react";
|
|
496
|
+
function noticeApi(window2) {
|
|
497
|
+
const page = window2;
|
|
498
|
+
page.feitioNotice ??= notices(window2);
|
|
499
|
+
return page.feitioNotice;
|
|
500
|
+
}
|
|
501
|
+
function useNotices() {
|
|
502
|
+
const show = useCallback((notice) => noticeApi(window).show(notice), []);
|
|
503
|
+
const close = useCallback((notice) => noticeApi(window).close(notice), []);
|
|
504
|
+
return { show, close };
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
// src/actions/wire.ts
|
|
508
|
+
function wireForms2(window2) {
|
|
509
|
+
forms(window2);
|
|
510
|
+
}
|
|
511
|
+
function wireDialogs2(window2) {
|
|
512
|
+
dialogs(window2);
|
|
513
|
+
}
|
|
514
|
+
function wireMenu(element) {
|
|
515
|
+
menus(window, element);
|
|
516
|
+
}
|
|
517
|
+
function wireNotice(element) {
|
|
518
|
+
noticeApi(window).wire(element);
|
|
519
|
+
}
|
|
520
|
+
function wireScroll(element) {
|
|
521
|
+
scrolls(window, element.parentElement ?? element);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// src/Nav.tsx
|
|
525
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
526
|
+
function Nav({ groups, label, sprite }) {
|
|
527
|
+
return /* @__PURE__ */ jsx3("nav", {
|
|
528
|
+
className: "feitio-nav",
|
|
529
|
+
"aria-label": label,
|
|
530
|
+
children: groups.map((g, n) => /* @__PURE__ */ jsxs2("div", {
|
|
531
|
+
className: "group",
|
|
532
|
+
children: [
|
|
533
|
+
g.title && /* @__PURE__ */ jsx3("p", {
|
|
534
|
+
className: "group-title",
|
|
535
|
+
children: g.title
|
|
536
|
+
}),
|
|
537
|
+
/* @__PURE__ */ jsx3("ul", {
|
|
538
|
+
children: g.items.map((i) => /* @__PURE__ */ jsx3("li", {
|
|
539
|
+
children: /* @__PURE__ */ jsxs2("a", {
|
|
540
|
+
href: i.href,
|
|
541
|
+
"aria-current": i.current ? "page" : undefined,
|
|
542
|
+
children: [
|
|
543
|
+
i.icon && /* @__PURE__ */ jsx3(Icon, {
|
|
544
|
+
name: i.icon,
|
|
545
|
+
sprite
|
|
546
|
+
}),
|
|
547
|
+
i.text
|
|
548
|
+
]
|
|
549
|
+
})
|
|
550
|
+
}, i.href))
|
|
551
|
+
})
|
|
552
|
+
]
|
|
553
|
+
}, g.title ?? n))
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// src/AppShell.tsx
|
|
558
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
559
|
+
function AppShell({
|
|
560
|
+
id,
|
|
561
|
+
brand,
|
|
562
|
+
nav,
|
|
563
|
+
user,
|
|
564
|
+
signOut,
|
|
565
|
+
menuLabel = "Menu",
|
|
566
|
+
closeLabel = "Fechar",
|
|
567
|
+
topLabel = "Topo",
|
|
568
|
+
sprite,
|
|
569
|
+
children
|
|
570
|
+
}) {
|
|
571
|
+
const fade = useRef(null);
|
|
572
|
+
useElementBehavior(fade, "scroll", wireScroll);
|
|
573
|
+
return /* @__PURE__ */ jsxs3("div", {
|
|
574
|
+
className: "feitio-app",
|
|
575
|
+
children: [
|
|
576
|
+
/* @__PURE__ */ jsxs3("header", {
|
|
577
|
+
className: "feitio-app-header",
|
|
578
|
+
"data-hide-on-scroll": "",
|
|
579
|
+
children: [
|
|
580
|
+
/* @__PURE__ */ jsx4("a", {
|
|
581
|
+
className: "brand",
|
|
582
|
+
href: `#${id}-content`,
|
|
583
|
+
children: brand
|
|
584
|
+
}),
|
|
585
|
+
/* @__PURE__ */ jsxs3("button", {
|
|
586
|
+
type: "button",
|
|
587
|
+
className: "feitio-button menu",
|
|
588
|
+
"data-size": "small",
|
|
589
|
+
popoverTarget: id,
|
|
590
|
+
"aria-controls": id,
|
|
591
|
+
children: [
|
|
592
|
+
menuLabel,
|
|
593
|
+
/* @__PURE__ */ jsx4(Icon, {
|
|
594
|
+
name: "menu",
|
|
595
|
+
sprite
|
|
596
|
+
})
|
|
597
|
+
]
|
|
598
|
+
})
|
|
599
|
+
]
|
|
600
|
+
}),
|
|
601
|
+
/* @__PURE__ */ jsxs3("nav", {
|
|
602
|
+
className: "feitio-drawer feitio-app-nav",
|
|
603
|
+
id,
|
|
604
|
+
popover: "",
|
|
605
|
+
"aria-label": menuLabel,
|
|
606
|
+
children: [
|
|
607
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
608
|
+
className: "drawer-header",
|
|
609
|
+
children: [
|
|
610
|
+
/* @__PURE__ */ jsx4("h2", {
|
|
611
|
+
children: menuLabel
|
|
612
|
+
}),
|
|
613
|
+
/* @__PURE__ */ jsxs3("button", {
|
|
614
|
+
type: "button",
|
|
615
|
+
className: "feitio-button close",
|
|
616
|
+
"data-size": "small",
|
|
617
|
+
popoverTarget: id,
|
|
618
|
+
popoverTargetAction: "hide",
|
|
619
|
+
children: [
|
|
620
|
+
/* @__PURE__ */ jsx4(Icon, {
|
|
621
|
+
name: "close",
|
|
622
|
+
sprite
|
|
623
|
+
}),
|
|
624
|
+
closeLabel
|
|
625
|
+
]
|
|
626
|
+
})
|
|
627
|
+
]
|
|
628
|
+
}),
|
|
629
|
+
/* @__PURE__ */ jsx4("div", {
|
|
630
|
+
className: "drawer-body",
|
|
631
|
+
children: /* @__PURE__ */ jsx4(Nav, {
|
|
632
|
+
groups: nav,
|
|
633
|
+
sprite
|
|
634
|
+
})
|
|
635
|
+
}),
|
|
636
|
+
(user || signOut) && /* @__PURE__ */ jsxs3("div", {
|
|
637
|
+
className: "drawer-footer nav-footer",
|
|
638
|
+
children: [
|
|
639
|
+
user && /* @__PURE__ */ jsx4("span", {
|
|
640
|
+
className: "who",
|
|
641
|
+
children: user
|
|
642
|
+
}),
|
|
643
|
+
signOut && /* @__PURE__ */ jsx4("a", {
|
|
644
|
+
className: "feitio-link",
|
|
645
|
+
href: signOut.href,
|
|
646
|
+
children: signOut.text
|
|
647
|
+
})
|
|
648
|
+
]
|
|
649
|
+
})
|
|
650
|
+
]
|
|
651
|
+
}),
|
|
652
|
+
/* @__PURE__ */ jsxs3("div", {
|
|
653
|
+
className: "feitio-app-main",
|
|
654
|
+
id: `${id}-content`,
|
|
655
|
+
tabIndex: -1,
|
|
656
|
+
children: [
|
|
657
|
+
children,
|
|
658
|
+
/* @__PURE__ */ jsx4("span", {
|
|
659
|
+
className: "feitio-scroll-fade",
|
|
660
|
+
"aria-hidden": "true",
|
|
661
|
+
ref: fade
|
|
662
|
+
}),
|
|
663
|
+
/* @__PURE__ */ jsxs3("a", {
|
|
664
|
+
className: "feitio-button feitio-back-to-top",
|
|
665
|
+
"data-size": "small",
|
|
666
|
+
href: `#${id}-content`,
|
|
667
|
+
children: [
|
|
668
|
+
/* @__PURE__ */ jsx4(Icon, {
|
|
669
|
+
name: "chevron-down",
|
|
670
|
+
sprite
|
|
671
|
+
}),
|
|
672
|
+
topLabel
|
|
673
|
+
]
|
|
674
|
+
})
|
|
675
|
+
]
|
|
676
|
+
})
|
|
677
|
+
]
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
// ../vanilla/src/status/actions/set-status.ts
|
|
681
|
+
function setStatus(host, state, label = "") {
|
|
682
|
+
const words = host.querySelector(".feitio-status .label");
|
|
683
|
+
if (state === null) {
|
|
684
|
+
delete host.dataset.state;
|
|
685
|
+
if (words)
|
|
686
|
+
words.textContent = "";
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
host.dataset.state = state;
|
|
690
|
+
if (words)
|
|
691
|
+
words.textContent = label;
|
|
692
|
+
}
|
|
693
|
+
// src/actions/status.ts
|
|
694
|
+
function status(host, state, label = "") {
|
|
695
|
+
setStatus(host, state, label);
|
|
696
|
+
}
|
|
697
|
+
// src/BackToTop.tsx
|
|
698
|
+
import { useRef as useRef2 } from "react";
|
|
699
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
700
|
+
function BackToTop({
|
|
701
|
+
href = "#content",
|
|
702
|
+
label = "Topo",
|
|
703
|
+
sprite
|
|
704
|
+
}) {
|
|
705
|
+
const ref = useRef2(null);
|
|
706
|
+
useElementBehavior(ref, "scroll", wireScroll);
|
|
707
|
+
return /* @__PURE__ */ jsxs4("a", {
|
|
708
|
+
ref,
|
|
709
|
+
className: "feitio-button feitio-back-to-top",
|
|
710
|
+
"data-size": "small",
|
|
711
|
+
href,
|
|
712
|
+
children: [
|
|
713
|
+
/* @__PURE__ */ jsx5(Icon, {
|
|
714
|
+
name: "chevron-down",
|
|
715
|
+
sprite
|
|
716
|
+
}),
|
|
717
|
+
label
|
|
718
|
+
]
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
// src/Block.tsx
|
|
722
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
723
|
+
function Block({ as: Tag = "div", children }) {
|
|
724
|
+
return /* @__PURE__ */ jsx6(Tag, {
|
|
725
|
+
className: "feitio-block",
|
|
726
|
+
children
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
// src/Breadcrumbs.tsx
|
|
730
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
731
|
+
function Breadcrumbs({
|
|
732
|
+
items,
|
|
733
|
+
current,
|
|
734
|
+
label = "Você está em",
|
|
735
|
+
sprite
|
|
736
|
+
}) {
|
|
737
|
+
return /* @__PURE__ */ jsx7("nav", {
|
|
738
|
+
className: "feitio-breadcrumbs",
|
|
739
|
+
"aria-label": label,
|
|
740
|
+
children: /* @__PURE__ */ jsxs5("ol", {
|
|
741
|
+
children: [
|
|
742
|
+
items.map((i, n) => /* @__PURE__ */ jsxs5("li", {
|
|
743
|
+
children: [
|
|
744
|
+
n > 0 && /* @__PURE__ */ jsx7("span", {
|
|
745
|
+
className: "sep",
|
|
746
|
+
"aria-hidden": "true",
|
|
747
|
+
children: /* @__PURE__ */ jsx7(Icon, {
|
|
748
|
+
name: "chevron-right",
|
|
749
|
+
sprite
|
|
750
|
+
})
|
|
751
|
+
}),
|
|
752
|
+
/* @__PURE__ */ jsx7("a", {
|
|
753
|
+
href: i.href,
|
|
754
|
+
children: i.text
|
|
755
|
+
})
|
|
756
|
+
]
|
|
757
|
+
}, i.href)),
|
|
758
|
+
/* @__PURE__ */ jsxs5("li", {
|
|
759
|
+
children: [
|
|
760
|
+
/* @__PURE__ */ jsx7("span", {
|
|
761
|
+
className: "sep",
|
|
762
|
+
"aria-hidden": "true",
|
|
763
|
+
children: /* @__PURE__ */ jsx7(Icon, {
|
|
764
|
+
name: "chevron-right",
|
|
765
|
+
sprite
|
|
766
|
+
})
|
|
767
|
+
}),
|
|
768
|
+
/* @__PURE__ */ jsx7("span", {
|
|
769
|
+
"aria-current": "page",
|
|
770
|
+
children: current
|
|
771
|
+
})
|
|
772
|
+
]
|
|
773
|
+
})
|
|
774
|
+
]
|
|
775
|
+
})
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
// src/calculations/text.ts
|
|
779
|
+
function classNames(...names) {
|
|
780
|
+
return names.filter(Boolean).join(" ");
|
|
781
|
+
}
|
|
782
|
+
function yearsText(since, year) {
|
|
783
|
+
return since === year ? String(since) : `${since}–${year}`;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
// src/Button.tsx
|
|
787
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
788
|
+
function Button(props) {
|
|
789
|
+
const { variant, size, className, children } = props;
|
|
790
|
+
const classes = classNames("feitio-button", className);
|
|
791
|
+
if (props.href !== undefined) {
|
|
792
|
+
const { variant: _v, size: _s, className: _c, children: _ch, ...rest } = props;
|
|
793
|
+
return /* @__PURE__ */ jsx8("a", {
|
|
794
|
+
...rest,
|
|
795
|
+
className: classes,
|
|
796
|
+
"data-variant": variant,
|
|
797
|
+
"data-size": size,
|
|
798
|
+
children
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
const { variant: _v, size: _s, className: _c, children: _ch, type = "button", ...rest } = props;
|
|
802
|
+
return /* @__PURE__ */ jsx8("button", {
|
|
803
|
+
...rest,
|
|
804
|
+
className: classes,
|
|
805
|
+
type,
|
|
806
|
+
"data-variant": variant,
|
|
807
|
+
"data-size": size,
|
|
808
|
+
children
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
// src/Checkbox.tsx
|
|
812
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
813
|
+
function Checkbox({
|
|
814
|
+
label,
|
|
815
|
+
name,
|
|
816
|
+
value,
|
|
817
|
+
checked,
|
|
818
|
+
disabled,
|
|
819
|
+
onChange
|
|
820
|
+
}) {
|
|
821
|
+
return /* @__PURE__ */ jsxs6("label", {
|
|
822
|
+
className: "feitio-choice",
|
|
823
|
+
children: [
|
|
824
|
+
/* @__PURE__ */ jsx9("input", {
|
|
825
|
+
type: "checkbox",
|
|
826
|
+
name,
|
|
827
|
+
value,
|
|
828
|
+
defaultChecked: checked,
|
|
829
|
+
disabled,
|
|
830
|
+
onChange: onChange && ((event) => onChange(event.target.checked, event))
|
|
831
|
+
}),
|
|
832
|
+
label
|
|
833
|
+
]
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
// src/CodeBlock.tsx
|
|
837
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
838
|
+
function CodeBlock({
|
|
839
|
+
code,
|
|
840
|
+
label = "HTML",
|
|
841
|
+
syntax = "html",
|
|
842
|
+
copyLabel = "Copiar",
|
|
843
|
+
copiedLabel = "Copiado"
|
|
844
|
+
}) {
|
|
845
|
+
return /* @__PURE__ */ jsxs7("div", {
|
|
846
|
+
className: "feitio-code",
|
|
847
|
+
"data-lang": syntax,
|
|
848
|
+
children: [
|
|
849
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
850
|
+
className: "bar",
|
|
851
|
+
children: [
|
|
852
|
+
/* @__PURE__ */ jsx10("span", {
|
|
853
|
+
children: label
|
|
854
|
+
}),
|
|
855
|
+
/* @__PURE__ */ jsx10("button", {
|
|
856
|
+
type: "button",
|
|
857
|
+
className: "feitio-button copy",
|
|
858
|
+
"data-size": "small",
|
|
859
|
+
"data-done-label": copiedLabel,
|
|
860
|
+
children: copyLabel
|
|
861
|
+
})
|
|
862
|
+
]
|
|
863
|
+
}),
|
|
864
|
+
/* @__PURE__ */ jsx10("pre", {
|
|
865
|
+
tabIndex: 0,
|
|
866
|
+
children: /* @__PURE__ */ jsx10("code", {
|
|
867
|
+
children: code
|
|
868
|
+
})
|
|
869
|
+
})
|
|
870
|
+
]
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
// src/Details.tsx
|
|
874
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
875
|
+
function Details({ summary, open, sprite, children }) {
|
|
876
|
+
return /* @__PURE__ */ jsxs8("details", {
|
|
877
|
+
className: "feitio-details",
|
|
878
|
+
open,
|
|
879
|
+
children: [
|
|
880
|
+
/* @__PURE__ */ jsxs8("summary", {
|
|
881
|
+
children: [
|
|
882
|
+
/* @__PURE__ */ jsx11(Icon, {
|
|
883
|
+
name: "chevron-right",
|
|
884
|
+
sprite
|
|
885
|
+
}),
|
|
886
|
+
summary
|
|
887
|
+
]
|
|
888
|
+
}),
|
|
889
|
+
/* @__PURE__ */ jsx11("div", {
|
|
890
|
+
className: "content",
|
|
891
|
+
children
|
|
892
|
+
})
|
|
893
|
+
]
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
// src/actions/use-page-behavior.ts
|
|
897
|
+
import { useEffect as useEffect2 } from "react";
|
|
898
|
+
function usePageBehavior(flag, wire) {
|
|
899
|
+
useEffect2(() => {
|
|
900
|
+
const page = window;
|
|
901
|
+
if (page[flag])
|
|
902
|
+
return;
|
|
903
|
+
page[flag] = true;
|
|
904
|
+
wire(window);
|
|
905
|
+
}, [flag, wire]);
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
// src/Dialog.tsx
|
|
909
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
910
|
+
function Dialog({
|
|
911
|
+
id,
|
|
912
|
+
title,
|
|
913
|
+
action,
|
|
914
|
+
cancel = "Cancelar",
|
|
915
|
+
danger = false,
|
|
916
|
+
confirmWord,
|
|
917
|
+
onClose,
|
|
918
|
+
children
|
|
919
|
+
}) {
|
|
920
|
+
usePageBehavior("feitioDialogs", wireDialogs2);
|
|
921
|
+
return /* @__PURE__ */ jsx12("dialog", {
|
|
922
|
+
className: "feitio-dialog",
|
|
923
|
+
id,
|
|
924
|
+
"aria-labelledby": `${id}-t`,
|
|
925
|
+
"aria-describedby": `${id}-d`,
|
|
926
|
+
onClose: onClose && ((event) => onClose(event.currentTarget.returnValue)),
|
|
927
|
+
children: /* @__PURE__ */ jsxs9("form", {
|
|
928
|
+
method: "dialog",
|
|
929
|
+
"data-type-to-confirm": confirmWord?.word,
|
|
930
|
+
children: [
|
|
931
|
+
/* @__PURE__ */ jsx12("h2", {
|
|
932
|
+
id: `${id}-t`,
|
|
933
|
+
children: title
|
|
934
|
+
}),
|
|
935
|
+
/* @__PURE__ */ jsx12("div", {
|
|
936
|
+
id: `${id}-d`,
|
|
937
|
+
children
|
|
938
|
+
}),
|
|
939
|
+
confirmWord && /* @__PURE__ */ jsxs9("div", {
|
|
940
|
+
className: "feitio-field",
|
|
941
|
+
children: [
|
|
942
|
+
/* @__PURE__ */ jsx12("label", {
|
|
943
|
+
className: "feitio-label",
|
|
944
|
+
htmlFor: `${id}-word`,
|
|
945
|
+
children: confirmWord.label
|
|
946
|
+
}),
|
|
947
|
+
/* @__PURE__ */ jsx12("input", {
|
|
948
|
+
className: "feitio-input",
|
|
949
|
+
id: `${id}-word`,
|
|
950
|
+
autoComplete: "off"
|
|
951
|
+
})
|
|
952
|
+
]
|
|
953
|
+
}),
|
|
954
|
+
/* @__PURE__ */ jsxs9("div", {
|
|
955
|
+
className: "actions",
|
|
956
|
+
children: [
|
|
957
|
+
/* @__PURE__ */ jsx12("button", {
|
|
958
|
+
type: "submit",
|
|
959
|
+
className: "feitio-button",
|
|
960
|
+
"data-variant": danger ? "danger" : "primary",
|
|
961
|
+
value: "yes",
|
|
962
|
+
disabled: Boolean(confirmWord),
|
|
963
|
+
children: action
|
|
964
|
+
}),
|
|
965
|
+
/* @__PURE__ */ jsx12("button", {
|
|
966
|
+
type: "submit",
|
|
967
|
+
className: "feitio-button",
|
|
968
|
+
value: "cancel",
|
|
969
|
+
autoFocus: !confirmWord,
|
|
970
|
+
children: cancel
|
|
971
|
+
})
|
|
972
|
+
]
|
|
973
|
+
})
|
|
974
|
+
]
|
|
975
|
+
})
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
// src/Divider.tsx
|
|
979
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
980
|
+
function Divider({ tone, orientation = "horizontal" }) {
|
|
981
|
+
return /* @__PURE__ */ jsx13("hr", {
|
|
982
|
+
className: "feitio-divider",
|
|
983
|
+
"data-tone": tone,
|
|
984
|
+
"aria-orientation": orientation === "vertical" ? "vertical" : undefined
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
// src/DoDont.tsx
|
|
988
|
+
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
989
|
+
function DoDont({
|
|
990
|
+
doWhy,
|
|
991
|
+
dontWhy,
|
|
992
|
+
doLabel = "Faça assim",
|
|
993
|
+
dontLabel = "Não faça",
|
|
994
|
+
sprite,
|
|
995
|
+
do: right,
|
|
996
|
+
dont: wrong
|
|
997
|
+
}) {
|
|
998
|
+
return /* @__PURE__ */ jsxs10("div", {
|
|
999
|
+
className: "pair feitio-dodont",
|
|
1000
|
+
children: [
|
|
1001
|
+
/* @__PURE__ */ jsxs10("div", {
|
|
1002
|
+
className: "do",
|
|
1003
|
+
children: [
|
|
1004
|
+
/* @__PURE__ */ jsxs10("p", {
|
|
1005
|
+
className: "verdict",
|
|
1006
|
+
children: [
|
|
1007
|
+
/* @__PURE__ */ jsx14(Icon, {
|
|
1008
|
+
name: "check",
|
|
1009
|
+
sprite
|
|
1010
|
+
}),
|
|
1011
|
+
doLabel
|
|
1012
|
+
]
|
|
1013
|
+
}),
|
|
1014
|
+
/* @__PURE__ */ jsx14("div", {
|
|
1015
|
+
className: "demo",
|
|
1016
|
+
children: right
|
|
1017
|
+
}),
|
|
1018
|
+
/* @__PURE__ */ jsx14("p", {
|
|
1019
|
+
className: "why",
|
|
1020
|
+
children: doWhy
|
|
1021
|
+
})
|
|
1022
|
+
]
|
|
1023
|
+
}),
|
|
1024
|
+
/* @__PURE__ */ jsxs10("div", {
|
|
1025
|
+
className: "dont",
|
|
1026
|
+
children: [
|
|
1027
|
+
/* @__PURE__ */ jsxs10("p", {
|
|
1028
|
+
className: "verdict",
|
|
1029
|
+
children: [
|
|
1030
|
+
/* @__PURE__ */ jsx14(Icon, {
|
|
1031
|
+
name: "close",
|
|
1032
|
+
sprite
|
|
1033
|
+
}),
|
|
1034
|
+
dontLabel
|
|
1035
|
+
]
|
|
1036
|
+
}),
|
|
1037
|
+
/* @__PURE__ */ jsx14("div", {
|
|
1038
|
+
className: "demo",
|
|
1039
|
+
children: wrong
|
|
1040
|
+
}),
|
|
1041
|
+
/* @__PURE__ */ jsx14("p", {
|
|
1042
|
+
className: "why",
|
|
1043
|
+
children: dontWhy
|
|
1044
|
+
})
|
|
1045
|
+
]
|
|
1046
|
+
})
|
|
1047
|
+
]
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
// src/Drawer.tsx
|
|
1051
|
+
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1052
|
+
function Drawer({
|
|
1053
|
+
id,
|
|
1054
|
+
title,
|
|
1055
|
+
side = "end",
|
|
1056
|
+
label,
|
|
1057
|
+
closeLabel = "Fechar",
|
|
1058
|
+
sprite,
|
|
1059
|
+
footer,
|
|
1060
|
+
children
|
|
1061
|
+
}) {
|
|
1062
|
+
return /* @__PURE__ */ jsxs11("div", {
|
|
1063
|
+
className: "feitio-drawer",
|
|
1064
|
+
id,
|
|
1065
|
+
popover: "",
|
|
1066
|
+
"data-side": side === "end" ? undefined : side,
|
|
1067
|
+
role: "dialog",
|
|
1068
|
+
"aria-label": label ?? title,
|
|
1069
|
+
children: [
|
|
1070
|
+
/* @__PURE__ */ jsxs11("div", {
|
|
1071
|
+
className: "drawer-header",
|
|
1072
|
+
children: [
|
|
1073
|
+
title && /* @__PURE__ */ jsx15("h2", {
|
|
1074
|
+
children: title
|
|
1075
|
+
}),
|
|
1076
|
+
/* @__PURE__ */ jsxs11("button", {
|
|
1077
|
+
type: "button",
|
|
1078
|
+
className: "feitio-button close",
|
|
1079
|
+
"data-size": "small",
|
|
1080
|
+
popoverTarget: id,
|
|
1081
|
+
popoverTargetAction: "hide",
|
|
1082
|
+
children: [
|
|
1083
|
+
/* @__PURE__ */ jsx15(Icon, {
|
|
1084
|
+
name: "close",
|
|
1085
|
+
sprite
|
|
1086
|
+
}),
|
|
1087
|
+
closeLabel
|
|
1088
|
+
]
|
|
1089
|
+
})
|
|
1090
|
+
]
|
|
1091
|
+
}),
|
|
1092
|
+
/* @__PURE__ */ jsx15("div", {
|
|
1093
|
+
className: "drawer-body",
|
|
1094
|
+
children
|
|
1095
|
+
}),
|
|
1096
|
+
footer !== undefined && footer !== null && /* @__PURE__ */ jsx15("div", {
|
|
1097
|
+
className: "drawer-footer",
|
|
1098
|
+
children: footer
|
|
1099
|
+
})
|
|
1100
|
+
]
|
|
1101
|
+
});
|
|
1102
|
+
}
|
|
1103
|
+
// ../core/illustrations/empty-basket.svg
|
|
1104
|
+
var empty_basket_default = `<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" viewBox="0 0 120 100" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round">
|
|
1105
|
+
<path d="M14 40c30-2.6 62 1.4 92-1.8"/>
|
|
1106
|
+
<path d="M18 41.5c3 16 6.2 32 10.4 46.6"/>
|
|
1107
|
+
<path d="M25.6 88.6c22.4-1.8 43.6.6 66.2-1.6"/>
|
|
1108
|
+
<path d="M101.6 41.6c-2.8 15.4-6 30.8-10.4 46.4"/>
|
|
1109
|
+
<path d="M32 52c1.8 10 3.2 20 4.6 29.4M50 52.6c.4 9.8.2 19.6.6 29.2M68.4 52c-.6 9.8-1.2 19.6-1.8 29.6M86 51.6c-1.6 9.6-3 19.4-4.8 29.2"/>
|
|
1110
|
+
<path d="M36 39c2.4-14 13-24.4 24.6-24.6C72.8 14.2 83.4 25 85 38.6"/>
|
|
1111
|
+
<path class="feitio-hot" d="M60.6 6.4c-.2 2.4.2 4.8-.1 7.2M44 11.2c1.4 1.8 2.6 3.6 4 5.6M77.2 11c-1.4 1.8-2.6 3.8-4 5.8"/>
|
|
1112
|
+
</svg>
|
|
1113
|
+
`;
|
|
1114
|
+
|
|
1115
|
+
// ../core/illustrations/torn-paper.svg
|
|
1116
|
+
var torn_paper_default = `<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" viewBox="0 0 120 100" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round">
|
|
1117
|
+
<path d="M22 82c24-1.6 50 .8 76-1.2"/>
|
|
1118
|
+
<path d="M40 81c-1-14 0-30-1.4-45.4"/>
|
|
1119
|
+
<path d="M36.6 36.4c14.8-1.6 29.4.6 45-.9"/>
|
|
1120
|
+
<path d="M80.2 34.4c.9 14.6-.2 30.6.7 46.8"/>
|
|
1121
|
+
<path d="M46 46c9.6-.6 19.6.4 29-.2M46 56c9.4-.4 19 .2 28.4-.4"/>
|
|
1122
|
+
<path class="feitio-hot" d="M86 20c4.8 5.6 9.6 11 14.4 16.8M100 19c-5 6-9.4 11.4-14.6 17.6"/>
|
|
1123
|
+
<path d="M30 28c-3 2.2-5.8 4.6-8.6 7.2M26 18c-1.2 2.6-2 5.4-3 8"/>
|
|
1124
|
+
</svg>
|
|
1125
|
+
`;
|
|
1126
|
+
|
|
1127
|
+
// src/calculations/svg-parts.ts
|
|
1128
|
+
function reactAttributeName(name) {
|
|
1129
|
+
if (name.startsWith("aria-") || name.startsWith("data-"))
|
|
1130
|
+
return name;
|
|
1131
|
+
if (name === "class")
|
|
1132
|
+
return "className";
|
|
1133
|
+
return name.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
1134
|
+
}
|
|
1135
|
+
function svgParts(svg) {
|
|
1136
|
+
const match = /<svg\b([^>]*)>([\s\S]*)<\/svg>/.exec(svg);
|
|
1137
|
+
if (!match)
|
|
1138
|
+
return { attributes: {}, inner: "" };
|
|
1139
|
+
const attributes = {};
|
|
1140
|
+
for (const [, name, value] of (match[1] ?? "").matchAll(/([\w:-]+)="([^"]*)"/g))
|
|
1141
|
+
if (name !== undefined)
|
|
1142
|
+
attributes[reactAttributeName(name)] = value ?? "";
|
|
1143
|
+
return { attributes, inner: (match[2] ?? "").trim() };
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
// src/EmptyState.tsx
|
|
1147
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1148
|
+
var art = { basket: svgParts(empty_basket_default), torn: svgParts(torn_paper_default) };
|
|
1149
|
+
function EmptyState({
|
|
1150
|
+
title,
|
|
1151
|
+
text,
|
|
1152
|
+
illustration = "basket",
|
|
1153
|
+
size,
|
|
1154
|
+
children
|
|
1155
|
+
}) {
|
|
1156
|
+
const drawing = illustration === "none" ? undefined : art[illustration];
|
|
1157
|
+
return /* @__PURE__ */ jsxs12("div", {
|
|
1158
|
+
className: "feitio-empty",
|
|
1159
|
+
"data-size": size,
|
|
1160
|
+
children: [
|
|
1161
|
+
drawing && /* @__PURE__ */ jsx16("svg", {
|
|
1162
|
+
...drawing.attributes,
|
|
1163
|
+
dangerouslySetInnerHTML: { __html: drawing.inner }
|
|
1164
|
+
}),
|
|
1165
|
+
/* @__PURE__ */ jsx16("h3", {
|
|
1166
|
+
children: title
|
|
1167
|
+
}),
|
|
1168
|
+
text && /* @__PURE__ */ jsx16("p", {
|
|
1169
|
+
children: text
|
|
1170
|
+
}),
|
|
1171
|
+
children
|
|
1172
|
+
]
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
// src/ErrorMessage.tsx
|
|
1176
|
+
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1177
|
+
function ErrorMessage({ id, sprite, children }) {
|
|
1178
|
+
return /* @__PURE__ */ jsxs13("span", {
|
|
1179
|
+
className: "feitio-error-message",
|
|
1180
|
+
id,
|
|
1181
|
+
children: [
|
|
1182
|
+
/* @__PURE__ */ jsx17(Icon, {
|
|
1183
|
+
name: "close",
|
|
1184
|
+
sprite
|
|
1185
|
+
}),
|
|
1186
|
+
children
|
|
1187
|
+
]
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1190
|
+
// src/ErrorSummary.tsx
|
|
1191
|
+
import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1192
|
+
function ErrorSummary({ title, errors, sprite }) {
|
|
1193
|
+
return /* @__PURE__ */ jsxs14("div", {
|
|
1194
|
+
className: "feitio-error-summary",
|
|
1195
|
+
role: "alert",
|
|
1196
|
+
tabIndex: -1,
|
|
1197
|
+
children: [
|
|
1198
|
+
/* @__PURE__ */ jsxs14("h3", {
|
|
1199
|
+
children: [
|
|
1200
|
+
/* @__PURE__ */ jsx18(Icon, {
|
|
1201
|
+
name: "close",
|
|
1202
|
+
sprite
|
|
1203
|
+
}),
|
|
1204
|
+
title
|
|
1205
|
+
]
|
|
1206
|
+
}),
|
|
1207
|
+
/* @__PURE__ */ jsx18("ul", {
|
|
1208
|
+
children: errors.map((e) => /* @__PURE__ */ jsx18("li", {
|
|
1209
|
+
children: /* @__PURE__ */ jsx18("a", {
|
|
1210
|
+
href: e.href,
|
|
1211
|
+
children: e.text
|
|
1212
|
+
})
|
|
1213
|
+
}, e.href))
|
|
1214
|
+
})
|
|
1215
|
+
]
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
// src/Example.tsx
|
|
1219
|
+
import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1220
|
+
function Example({
|
|
1221
|
+
id,
|
|
1222
|
+
title,
|
|
1223
|
+
description,
|
|
1224
|
+
code,
|
|
1225
|
+
showLabel = "Mostrar código",
|
|
1226
|
+
copyLabel,
|
|
1227
|
+
copiedLabel,
|
|
1228
|
+
sprite,
|
|
1229
|
+
children
|
|
1230
|
+
}) {
|
|
1231
|
+
return /* @__PURE__ */ jsxs15("div", {
|
|
1232
|
+
className: "feitio-example",
|
|
1233
|
+
children: [
|
|
1234
|
+
/* @__PURE__ */ jsx19("div", {
|
|
1235
|
+
className: "live",
|
|
1236
|
+
children
|
|
1237
|
+
}),
|
|
1238
|
+
/* @__PURE__ */ jsxs15("div", {
|
|
1239
|
+
className: "about",
|
|
1240
|
+
children: [
|
|
1241
|
+
/* @__PURE__ */ jsx19("h3", {
|
|
1242
|
+
id,
|
|
1243
|
+
children: title
|
|
1244
|
+
}),
|
|
1245
|
+
/* @__PURE__ */ jsx19("p", {
|
|
1246
|
+
children: description
|
|
1247
|
+
}),
|
|
1248
|
+
/* @__PURE__ */ jsxs15("details", {
|
|
1249
|
+
children: [
|
|
1250
|
+
/* @__PURE__ */ jsxs15("summary", {
|
|
1251
|
+
children: [
|
|
1252
|
+
/* @__PURE__ */ jsx19(Icon, {
|
|
1253
|
+
name: "chevron-right",
|
|
1254
|
+
sprite
|
|
1255
|
+
}),
|
|
1256
|
+
showLabel
|
|
1257
|
+
]
|
|
1258
|
+
}),
|
|
1259
|
+
/* @__PURE__ */ jsx19(CodeBlock, {
|
|
1260
|
+
code,
|
|
1261
|
+
copyLabel,
|
|
1262
|
+
copiedLabel
|
|
1263
|
+
})
|
|
1264
|
+
]
|
|
1265
|
+
})
|
|
1266
|
+
]
|
|
1267
|
+
})
|
|
1268
|
+
]
|
|
1269
|
+
});
|
|
1270
|
+
}
|
|
1271
|
+
// src/FeitioProvider.tsx
|
|
1272
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1273
|
+
function FeitioProvider({ sprite, children }) {
|
|
1274
|
+
return /* @__PURE__ */ jsx20(SpriteContext, {
|
|
1275
|
+
value: sprite,
|
|
1276
|
+
children
|
|
1277
|
+
});
|
|
1278
|
+
}
|
|
1279
|
+
// src/Field.tsx
|
|
1280
|
+
import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1281
|
+
function Field({
|
|
1282
|
+
label,
|
|
1283
|
+
for: target,
|
|
1284
|
+
hint,
|
|
1285
|
+
error,
|
|
1286
|
+
sprite,
|
|
1287
|
+
children
|
|
1288
|
+
}) {
|
|
1289
|
+
return /* @__PURE__ */ jsxs16("div", {
|
|
1290
|
+
className: "feitio-field",
|
|
1291
|
+
children: [
|
|
1292
|
+
/* @__PURE__ */ jsx21("label", {
|
|
1293
|
+
className: "feitio-label",
|
|
1294
|
+
htmlFor: target,
|
|
1295
|
+
children: label
|
|
1296
|
+
}),
|
|
1297
|
+
hint && /* @__PURE__ */ jsx21("span", {
|
|
1298
|
+
className: "feitio-hint",
|
|
1299
|
+
id: `${target}-hint`,
|
|
1300
|
+
children: hint
|
|
1301
|
+
}),
|
|
1302
|
+
children,
|
|
1303
|
+
error && /* @__PURE__ */ jsxs16("span", {
|
|
1304
|
+
className: "feitio-error-message",
|
|
1305
|
+
id: `${target}-error`,
|
|
1306
|
+
children: [
|
|
1307
|
+
/* @__PURE__ */ jsx21(Icon, {
|
|
1308
|
+
name: "close",
|
|
1309
|
+
sprite
|
|
1310
|
+
}),
|
|
1311
|
+
error
|
|
1312
|
+
]
|
|
1313
|
+
})
|
|
1314
|
+
]
|
|
1315
|
+
});
|
|
1316
|
+
}
|
|
1317
|
+
// src/Fieldset.tsx
|
|
1318
|
+
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1319
|
+
function Fieldset({ legend, hint, children }) {
|
|
1320
|
+
return /* @__PURE__ */ jsxs17("fieldset", {
|
|
1321
|
+
className: "feitio-fieldset",
|
|
1322
|
+
children: [
|
|
1323
|
+
/* @__PURE__ */ jsx22("legend", {
|
|
1324
|
+
className: "feitio-label",
|
|
1325
|
+
children: legend
|
|
1326
|
+
}),
|
|
1327
|
+
hint && /* @__PURE__ */ jsx22("span", {
|
|
1328
|
+
className: "feitio-hint",
|
|
1329
|
+
children: hint
|
|
1330
|
+
}),
|
|
1331
|
+
children
|
|
1332
|
+
]
|
|
1333
|
+
});
|
|
1334
|
+
}
|
|
1335
|
+
// src/FilterField.tsx
|
|
1336
|
+
import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1337
|
+
function FilterField({
|
|
1338
|
+
id,
|
|
1339
|
+
list,
|
|
1340
|
+
label,
|
|
1341
|
+
placeholder,
|
|
1342
|
+
debounce,
|
|
1343
|
+
async: isAsync,
|
|
1344
|
+
busyLabel = "Buscando…"
|
|
1345
|
+
}) {
|
|
1346
|
+
usePageBehavior("feitioForms", wireForms2);
|
|
1347
|
+
return /* @__PURE__ */ jsxs18("div", {
|
|
1348
|
+
className: "feitio-filter",
|
|
1349
|
+
children: [
|
|
1350
|
+
/* @__PURE__ */ jsx23("label", {
|
|
1351
|
+
className: "feitio-visually-hidden",
|
|
1352
|
+
htmlFor: id,
|
|
1353
|
+
children: label
|
|
1354
|
+
}),
|
|
1355
|
+
/* @__PURE__ */ jsxs18("span", {
|
|
1356
|
+
className: "box",
|
|
1357
|
+
children: [
|
|
1358
|
+
/* @__PURE__ */ jsx23("input", {
|
|
1359
|
+
className: "feitio-input",
|
|
1360
|
+
id,
|
|
1361
|
+
type: "search",
|
|
1362
|
+
autoComplete: "off",
|
|
1363
|
+
placeholder,
|
|
1364
|
+
"data-filter": list,
|
|
1365
|
+
"data-debounce": debounce,
|
|
1366
|
+
"data-async": isAsync ? "" : undefined,
|
|
1367
|
+
"data-busy-label": isAsync ? busyLabel : undefined
|
|
1368
|
+
}),
|
|
1369
|
+
/* @__PURE__ */ jsx23("span", {
|
|
1370
|
+
className: "wait",
|
|
1371
|
+
"aria-hidden": "true"
|
|
1372
|
+
}),
|
|
1373
|
+
/* @__PURE__ */ jsx23("svg", {
|
|
1374
|
+
className: "busy",
|
|
1375
|
+
viewBox: "0 0 24 24",
|
|
1376
|
+
"aria-hidden": "true",
|
|
1377
|
+
children: /* @__PURE__ */ jsx23("path", {
|
|
1378
|
+
pathLength: 1,
|
|
1379
|
+
d: "M12 3.4C16.9 3.2 20.7 7.1 20.6 12C20.5 16.7 16.7 20.6 12 20.6C7.2 20.6 3.4 16.8 3.4 12.1C3.4 7.6 6.9 3.9 11.4 3.5"
|
|
1380
|
+
})
|
|
1381
|
+
})
|
|
1382
|
+
]
|
|
1383
|
+
}),
|
|
1384
|
+
/* @__PURE__ */ jsx23("span", {
|
|
1385
|
+
className: "count",
|
|
1386
|
+
"data-count": list,
|
|
1387
|
+
"aria-live": "polite"
|
|
1388
|
+
})
|
|
1389
|
+
]
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
// src/Footer.tsx
|
|
1393
|
+
import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1394
|
+
function Footer({ name, since, links, note, logo }) {
|
|
1395
|
+
return /* @__PURE__ */ jsx24("footer", {
|
|
1396
|
+
className: "feitio-footer",
|
|
1397
|
+
children: /* @__PURE__ */ jsxs19("div", {
|
|
1398
|
+
className: "inner",
|
|
1399
|
+
children: [
|
|
1400
|
+
/* @__PURE__ */ jsxs19("span", {
|
|
1401
|
+
className: "who",
|
|
1402
|
+
children: [
|
|
1403
|
+
logo,
|
|
1404
|
+
/* @__PURE__ */ jsx24("strong", {
|
|
1405
|
+
children: name
|
|
1406
|
+
}),
|
|
1407
|
+
/* @__PURE__ */ jsxs19("span", {
|
|
1408
|
+
children: [
|
|
1409
|
+
"© ",
|
|
1410
|
+
/* @__PURE__ */ jsx24("span", {
|
|
1411
|
+
"data-since": since,
|
|
1412
|
+
children: yearsText(since, new Date().getFullYear())
|
|
1413
|
+
})
|
|
1414
|
+
]
|
|
1415
|
+
})
|
|
1416
|
+
]
|
|
1417
|
+
}),
|
|
1418
|
+
note && /* @__PURE__ */ jsx24("span", {
|
|
1419
|
+
dangerouslySetInnerHTML: { __html: note }
|
|
1420
|
+
}),
|
|
1421
|
+
/* @__PURE__ */ jsx24("ul", {
|
|
1422
|
+
children: links.map((l) => /* @__PURE__ */ jsx24("li", {
|
|
1423
|
+
children: /* @__PURE__ */ jsx24("a", {
|
|
1424
|
+
href: l.href,
|
|
1425
|
+
children: l.text
|
|
1426
|
+
})
|
|
1427
|
+
}, l.href))
|
|
1428
|
+
})
|
|
1429
|
+
]
|
|
1430
|
+
})
|
|
1431
|
+
});
|
|
1432
|
+
}
|
|
1433
|
+
// src/Grid.tsx
|
|
1434
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1435
|
+
function Grid({ gap = 4, min, as: Tag = "div", children }) {
|
|
1436
|
+
const style = min ? { "--feitio-grid-min": min } : undefined;
|
|
1437
|
+
return /* @__PURE__ */ jsx25(Tag, {
|
|
1438
|
+
className: "feitio-grid",
|
|
1439
|
+
"data-gap": gap,
|
|
1440
|
+
style,
|
|
1441
|
+
children
|
|
1442
|
+
});
|
|
1443
|
+
}
|
|
1444
|
+
// src/Header.tsx
|
|
1445
|
+
import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1446
|
+
function Header({
|
|
1447
|
+
brand,
|
|
1448
|
+
brandHref,
|
|
1449
|
+
areas,
|
|
1450
|
+
label,
|
|
1451
|
+
menu,
|
|
1452
|
+
sprite,
|
|
1453
|
+
logo,
|
|
1454
|
+
children
|
|
1455
|
+
}) {
|
|
1456
|
+
return /* @__PURE__ */ jsx26("div", {
|
|
1457
|
+
className: "feitio-header-wrap",
|
|
1458
|
+
children: /* @__PURE__ */ jsxs20("header", {
|
|
1459
|
+
className: "feitio-header",
|
|
1460
|
+
children: [
|
|
1461
|
+
/* @__PURE__ */ jsxs20("a", {
|
|
1462
|
+
className: "brand",
|
|
1463
|
+
href: brandHref,
|
|
1464
|
+
children: [
|
|
1465
|
+
logo,
|
|
1466
|
+
brand
|
|
1467
|
+
]
|
|
1468
|
+
}),
|
|
1469
|
+
/* @__PURE__ */ jsx26("nav", {
|
|
1470
|
+
className: "areas",
|
|
1471
|
+
"aria-label": label,
|
|
1472
|
+
children: areas.map((a) => /* @__PURE__ */ jsx26("a", {
|
|
1473
|
+
href: a.href,
|
|
1474
|
+
"aria-current": a.current ? "true" : undefined,
|
|
1475
|
+
children: a.text
|
|
1476
|
+
}, a.href))
|
|
1477
|
+
}),
|
|
1478
|
+
/* @__PURE__ */ jsxs20("div", {
|
|
1479
|
+
className: "tools",
|
|
1480
|
+
children: [
|
|
1481
|
+
children,
|
|
1482
|
+
menu && /* @__PURE__ */ jsxs20("button", {
|
|
1483
|
+
type: "button",
|
|
1484
|
+
className: "feitio-button menu",
|
|
1485
|
+
"data-size": "small",
|
|
1486
|
+
popoverTarget: menu.target,
|
|
1487
|
+
"aria-controls": menu.target,
|
|
1488
|
+
children: [
|
|
1489
|
+
menu.label,
|
|
1490
|
+
/* @__PURE__ */ jsx26(Icon, {
|
|
1491
|
+
name: "menu",
|
|
1492
|
+
sprite
|
|
1493
|
+
})
|
|
1494
|
+
]
|
|
1495
|
+
})
|
|
1496
|
+
]
|
|
1497
|
+
})
|
|
1498
|
+
]
|
|
1499
|
+
})
|
|
1500
|
+
});
|
|
1501
|
+
}
|
|
1502
|
+
// src/Heading.tsx
|
|
1503
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1504
|
+
function Heading({ level = 2, id, children }) {
|
|
1505
|
+
const Tag = `h${level}`;
|
|
1506
|
+
return /* @__PURE__ */ jsx27(Tag, {
|
|
1507
|
+
id,
|
|
1508
|
+
children
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
// src/Hint.tsx
|
|
1512
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1513
|
+
function Hint({ id, children }) {
|
|
1514
|
+
return /* @__PURE__ */ jsx28("span", {
|
|
1515
|
+
className: "feitio-hint",
|
|
1516
|
+
id,
|
|
1517
|
+
children
|
|
1518
|
+
});
|
|
1519
|
+
}
|
|
1520
|
+
// src/Inline.tsx
|
|
1521
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1522
|
+
function Inline({ gap = 3, justify, as: Tag = "div", children }) {
|
|
1523
|
+
return /* @__PURE__ */ jsx29(Tag, {
|
|
1524
|
+
className: "feitio-inline",
|
|
1525
|
+
"data-gap": gap,
|
|
1526
|
+
"data-justify": justify,
|
|
1527
|
+
children
|
|
1528
|
+
});
|
|
1529
|
+
}
|
|
1530
|
+
// src/Kbd.tsx
|
|
1531
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1532
|
+
function Kbd({ children }) {
|
|
1533
|
+
return /* @__PURE__ */ jsx30("kbd", {
|
|
1534
|
+
className: "feitio-kbd",
|
|
1535
|
+
children
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
// src/Label.tsx
|
|
1539
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1540
|
+
function Label({ htmlFor, children }) {
|
|
1541
|
+
return /* @__PURE__ */ jsx31("label", {
|
|
1542
|
+
className: "feitio-label",
|
|
1543
|
+
htmlFor,
|
|
1544
|
+
children
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
// src/Link.tsx
|
|
1548
|
+
import { jsx as jsx32, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1549
|
+
function Link({
|
|
1550
|
+
href,
|
|
1551
|
+
newTab = false,
|
|
1552
|
+
newTabLabel = "(abre em nova aba)",
|
|
1553
|
+
sprite,
|
|
1554
|
+
children
|
|
1555
|
+
}) {
|
|
1556
|
+
return /* @__PURE__ */ jsxs21("a", {
|
|
1557
|
+
className: "feitio-link",
|
|
1558
|
+
href,
|
|
1559
|
+
target: newTab ? "_blank" : undefined,
|
|
1560
|
+
rel: newTab ? "noopener" : undefined,
|
|
1561
|
+
children: [
|
|
1562
|
+
children,
|
|
1563
|
+
newTab && /* @__PURE__ */ jsx32(Icon, {
|
|
1564
|
+
name: "new-tab",
|
|
1565
|
+
sprite
|
|
1566
|
+
}),
|
|
1567
|
+
newTab && /* @__PURE__ */ jsxs21("span", {
|
|
1568
|
+
className: "feitio-visually-hidden",
|
|
1569
|
+
children: [
|
|
1570
|
+
" ",
|
|
1571
|
+
newTabLabel
|
|
1572
|
+
]
|
|
1573
|
+
})
|
|
1574
|
+
]
|
|
1575
|
+
});
|
|
1576
|
+
}
|
|
1577
|
+
// src/LinkCard.tsx
|
|
1578
|
+
import { jsx as jsx33, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1579
|
+
function LinkCard({ href, title, sprite, children }) {
|
|
1580
|
+
return /* @__PURE__ */ jsxs22("a", {
|
|
1581
|
+
className: "feitio-link-card",
|
|
1582
|
+
href,
|
|
1583
|
+
children: [
|
|
1584
|
+
/* @__PURE__ */ jsxs22("strong", {
|
|
1585
|
+
children: [
|
|
1586
|
+
title,
|
|
1587
|
+
/* @__PURE__ */ jsx33(Icon, {
|
|
1588
|
+
name: "chevron-right",
|
|
1589
|
+
sprite
|
|
1590
|
+
})
|
|
1591
|
+
]
|
|
1592
|
+
}),
|
|
1593
|
+
/* @__PURE__ */ jsx33("span", {
|
|
1594
|
+
children
|
|
1595
|
+
})
|
|
1596
|
+
]
|
|
1597
|
+
});
|
|
1598
|
+
}
|
|
1599
|
+
// src/Menu.tsx
|
|
1600
|
+
import { useRef as useRef3 } from "react";
|
|
1601
|
+
import { jsx as jsx34, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1602
|
+
function Menu({ label, hint, items, id, size, sprite }) {
|
|
1603
|
+
const ref = useRef3(null);
|
|
1604
|
+
useElementBehavior(ref, "menu", wireMenu);
|
|
1605
|
+
return /* @__PURE__ */ jsxs23("span", {
|
|
1606
|
+
className: "feitio-menu",
|
|
1607
|
+
ref,
|
|
1608
|
+
children: [
|
|
1609
|
+
/* @__PURE__ */ jsxs23("button", {
|
|
1610
|
+
type: "button",
|
|
1611
|
+
className: "feitio-button",
|
|
1612
|
+
"data-size": size,
|
|
1613
|
+
popoverTarget: `${id}-list`,
|
|
1614
|
+
"aria-haspopup": "true",
|
|
1615
|
+
"aria-expanded": "false",
|
|
1616
|
+
children: [
|
|
1617
|
+
label,
|
|
1618
|
+
hint && /* @__PURE__ */ jsx34("span", {
|
|
1619
|
+
className: "feitio-visually-hidden",
|
|
1620
|
+
children: hint
|
|
1621
|
+
}),
|
|
1622
|
+
/* @__PURE__ */ jsx34(Icon, {
|
|
1623
|
+
name: "chevron-down",
|
|
1624
|
+
sprite
|
|
1625
|
+
})
|
|
1626
|
+
]
|
|
1627
|
+
}),
|
|
1628
|
+
/* @__PURE__ */ jsx34("ul", {
|
|
1629
|
+
className: "feitio-menu-list",
|
|
1630
|
+
id: `${id}-list`,
|
|
1631
|
+
popover: "",
|
|
1632
|
+
children: items.map((item) => item.href ? /* @__PURE__ */ jsx34("li", {
|
|
1633
|
+
children: /* @__PURE__ */ jsxs23("a", {
|
|
1634
|
+
href: item.href,
|
|
1635
|
+
lang: item.lang,
|
|
1636
|
+
hrefLang: item.hreflang,
|
|
1637
|
+
"aria-current": item.current ? "true" : undefined,
|
|
1638
|
+
children: [
|
|
1639
|
+
item.current && /* @__PURE__ */ jsx34(Icon, {
|
|
1640
|
+
name: "check",
|
|
1641
|
+
sprite
|
|
1642
|
+
}),
|
|
1643
|
+
/* @__PURE__ */ jsx34("span", {
|
|
1644
|
+
children: item.text
|
|
1645
|
+
})
|
|
1646
|
+
]
|
|
1647
|
+
})
|
|
1648
|
+
}, item.text) : /* @__PURE__ */ jsx34("li", {
|
|
1649
|
+
children: /* @__PURE__ */ jsx34("button", {
|
|
1650
|
+
type: "button",
|
|
1651
|
+
onClick: item.onSelect,
|
|
1652
|
+
children: item.text
|
|
1653
|
+
})
|
|
1654
|
+
}, item.text))
|
|
1655
|
+
})
|
|
1656
|
+
]
|
|
1657
|
+
});
|
|
1658
|
+
}
|
|
1659
|
+
// src/Notice.tsx
|
|
1660
|
+
import { useImperativeHandle, useRef as useRef4 } from "react";
|
|
1661
|
+
import { jsx as jsx35, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1662
|
+
var icons = { ok: "check", warn: "warn", error: "close", info: "info" };
|
|
1663
|
+
var ring = "M12 3.2C17.2 3 21 7 20.8 12.2C20.6 17.2 16.8 20.9 11.8 20.8C6.9 20.7 3.1 16.8 3.2 11.8C3.3 7 6.9 3.4 12.6 3.5";
|
|
1664
|
+
function Notice({
|
|
1665
|
+
status,
|
|
1666
|
+
title,
|
|
1667
|
+
close = false,
|
|
1668
|
+
timeout,
|
|
1669
|
+
id,
|
|
1670
|
+
hidden,
|
|
1671
|
+
role,
|
|
1672
|
+
closeLabel = "Fechar o aviso",
|
|
1673
|
+
sprite,
|
|
1674
|
+
ref,
|
|
1675
|
+
children
|
|
1676
|
+
}) {
|
|
1677
|
+
const own = useRef4(null);
|
|
1678
|
+
useImperativeHandle(ref, () => own.current, []);
|
|
1679
|
+
useElementBehavior(own, "notice", wireNotice);
|
|
1680
|
+
const hasTools = close || Boolean(timeout);
|
|
1681
|
+
const text = children !== undefined && children !== null && children !== false;
|
|
1682
|
+
return /* @__PURE__ */ jsxs24("div", {
|
|
1683
|
+
className: "feitio-notice",
|
|
1684
|
+
"data-status": status,
|
|
1685
|
+
id,
|
|
1686
|
+
role,
|
|
1687
|
+
"data-timeout": timeout,
|
|
1688
|
+
hidden,
|
|
1689
|
+
ref: own,
|
|
1690
|
+
children: [
|
|
1691
|
+
/* @__PURE__ */ jsx35(Icon, {
|
|
1692
|
+
name: icons[status ?? "info"],
|
|
1693
|
+
sprite
|
|
1694
|
+
}),
|
|
1695
|
+
/* @__PURE__ */ jsx35("strong", {
|
|
1696
|
+
children: title
|
|
1697
|
+
}),
|
|
1698
|
+
text && /* @__PURE__ */ jsx35("p", {
|
|
1699
|
+
children
|
|
1700
|
+
}),
|
|
1701
|
+
hasTools && /* @__PURE__ */ jsx35("span", {
|
|
1702
|
+
className: "tools",
|
|
1703
|
+
children: /* @__PURE__ */ jsxs24("button", {
|
|
1704
|
+
type: "button",
|
|
1705
|
+
className: "close",
|
|
1706
|
+
"aria-label": closeLabel,
|
|
1707
|
+
children: [
|
|
1708
|
+
Boolean(timeout) && /* @__PURE__ */ jsx35("svg", {
|
|
1709
|
+
className: "ring",
|
|
1710
|
+
viewBox: "0 0 24 24",
|
|
1711
|
+
"aria-hidden": "true",
|
|
1712
|
+
children: /* @__PURE__ */ jsx35("path", {
|
|
1713
|
+
pathLength: 100,
|
|
1714
|
+
d: ring
|
|
1715
|
+
})
|
|
1716
|
+
}),
|
|
1717
|
+
/* @__PURE__ */ jsx35(Icon, {
|
|
1718
|
+
name: "close",
|
|
1719
|
+
sprite
|
|
1720
|
+
})
|
|
1721
|
+
]
|
|
1722
|
+
})
|
|
1723
|
+
})
|
|
1724
|
+
]
|
|
1725
|
+
});
|
|
1726
|
+
}
|
|
1727
|
+
// src/calculations/pagination.ts
|
|
1728
|
+
function paginationEntries(current, total) {
|
|
1729
|
+
const around = [current - 1, current, current + 1].filter((p) => p >= 1 && p <= total);
|
|
1730
|
+
const pages = [...new Set([1, ...around, total])].sort((a, b) => a - b);
|
|
1731
|
+
const entries = [];
|
|
1732
|
+
pages.forEach((page, i) => {
|
|
1733
|
+
const before = pages[i - 1];
|
|
1734
|
+
if (before !== undefined && page - before > 1)
|
|
1735
|
+
entries.push({ kind: "gap", after: before });
|
|
1736
|
+
entries.push({ kind: "page", page });
|
|
1737
|
+
});
|
|
1738
|
+
return entries;
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
// src/Pagination.tsx
|
|
1742
|
+
import { jsx as jsx36, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1743
|
+
function defaultPageLabel(page) {
|
|
1744
|
+
return `Página ${page}`;
|
|
1745
|
+
}
|
|
1746
|
+
function Pagination({
|
|
1747
|
+
label,
|
|
1748
|
+
current,
|
|
1749
|
+
total,
|
|
1750
|
+
href,
|
|
1751
|
+
count,
|
|
1752
|
+
perPage,
|
|
1753
|
+
previousLabel = "Anterior",
|
|
1754
|
+
nextLabel = "Próxima",
|
|
1755
|
+
pageLabel = defaultPageLabel,
|
|
1756
|
+
sprite
|
|
1757
|
+
}) {
|
|
1758
|
+
return /* @__PURE__ */ jsxs25("nav", {
|
|
1759
|
+
className: "feitio-pagination",
|
|
1760
|
+
"aria-label": label,
|
|
1761
|
+
children: [
|
|
1762
|
+
/* @__PURE__ */ jsxs25("ul", {
|
|
1763
|
+
children: [
|
|
1764
|
+
current > 1 && /* @__PURE__ */ jsx36("li", {
|
|
1765
|
+
children: /* @__PURE__ */ jsxs25("a", {
|
|
1766
|
+
className: "step prev",
|
|
1767
|
+
href: href(current - 1),
|
|
1768
|
+
rel: "prev",
|
|
1769
|
+
children: [
|
|
1770
|
+
/* @__PURE__ */ jsx36(Icon, {
|
|
1771
|
+
name: "chevron-right",
|
|
1772
|
+
sprite
|
|
1773
|
+
}),
|
|
1774
|
+
previousLabel
|
|
1775
|
+
]
|
|
1776
|
+
})
|
|
1777
|
+
}),
|
|
1778
|
+
paginationEntries(current, total).map((entry) => entry.kind === "gap" ? /* @__PURE__ */ jsx36("li", {
|
|
1779
|
+
children: /* @__PURE__ */ jsx36("span", {
|
|
1780
|
+
className: "gap",
|
|
1781
|
+
"aria-hidden": "true",
|
|
1782
|
+
children: "…"
|
|
1783
|
+
})
|
|
1784
|
+
}, `gap-${entry.after}`) : /* @__PURE__ */ jsx36("li", {
|
|
1785
|
+
children: entry.page === current ? /* @__PURE__ */ jsx36("span", {
|
|
1786
|
+
"aria-current": "page",
|
|
1787
|
+
children: entry.page
|
|
1788
|
+
}) : /* @__PURE__ */ jsx36("a", {
|
|
1789
|
+
href: href(entry.page),
|
|
1790
|
+
"aria-label": pageLabel(entry.page),
|
|
1791
|
+
children: entry.page
|
|
1792
|
+
})
|
|
1793
|
+
}, entry.page)),
|
|
1794
|
+
current < total && /* @__PURE__ */ jsx36("li", {
|
|
1795
|
+
children: /* @__PURE__ */ jsxs25("a", {
|
|
1796
|
+
className: "step",
|
|
1797
|
+
href: href(current + 1),
|
|
1798
|
+
rel: "next",
|
|
1799
|
+
children: [
|
|
1800
|
+
nextLabel,
|
|
1801
|
+
/* @__PURE__ */ jsx36(Icon, {
|
|
1802
|
+
name: "chevron-right",
|
|
1803
|
+
sprite
|
|
1804
|
+
})
|
|
1805
|
+
]
|
|
1806
|
+
})
|
|
1807
|
+
})
|
|
1808
|
+
]
|
|
1809
|
+
}),
|
|
1810
|
+
(count || perPage) && /* @__PURE__ */ jsxs25("div", {
|
|
1811
|
+
className: "meta",
|
|
1812
|
+
children: [
|
|
1813
|
+
count && /* @__PURE__ */ jsx36("p", {
|
|
1814
|
+
className: "count",
|
|
1815
|
+
children: count
|
|
1816
|
+
}),
|
|
1817
|
+
perPage && /* @__PURE__ */ jsxs25("div", {
|
|
1818
|
+
className: "per-page",
|
|
1819
|
+
role: "group",
|
|
1820
|
+
"aria-label": perPage.label,
|
|
1821
|
+
children: [
|
|
1822
|
+
/* @__PURE__ */ jsx36("span", {
|
|
1823
|
+
children: perPage.label
|
|
1824
|
+
}),
|
|
1825
|
+
perPage.options.map((n) => n === perPage.current ? /* @__PURE__ */ jsx36("span", {
|
|
1826
|
+
"aria-current": "true",
|
|
1827
|
+
children: n
|
|
1828
|
+
}, n) : /* @__PURE__ */ jsx36("a", {
|
|
1829
|
+
href: perPage.href(n),
|
|
1830
|
+
children: n
|
|
1831
|
+
}, n))
|
|
1832
|
+
]
|
|
1833
|
+
})
|
|
1834
|
+
]
|
|
1835
|
+
})
|
|
1836
|
+
]
|
|
1837
|
+
});
|
|
1838
|
+
}
|
|
1839
|
+
// src/Radios.tsx
|
|
1840
|
+
import { jsx as jsx37, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
1841
|
+
function Radios({
|
|
1842
|
+
legend,
|
|
1843
|
+
name,
|
|
1844
|
+
options,
|
|
1845
|
+
value,
|
|
1846
|
+
disabled,
|
|
1847
|
+
layout = "stack",
|
|
1848
|
+
onChange
|
|
1849
|
+
}) {
|
|
1850
|
+
return /* @__PURE__ */ jsxs26("fieldset", {
|
|
1851
|
+
className: "feitio-fieldset",
|
|
1852
|
+
disabled,
|
|
1853
|
+
children: [
|
|
1854
|
+
/* @__PURE__ */ jsx37("legend", {
|
|
1855
|
+
className: "feitio-label",
|
|
1856
|
+
children: legend
|
|
1857
|
+
}),
|
|
1858
|
+
/* @__PURE__ */ jsx37("div", {
|
|
1859
|
+
className: "feitio-choices",
|
|
1860
|
+
"data-layout": layout === "inline" ? "inline" : undefined,
|
|
1861
|
+
children: options.map((o) => /* @__PURE__ */ jsxs26("label", {
|
|
1862
|
+
className: "feitio-choice",
|
|
1863
|
+
children: [
|
|
1864
|
+
/* @__PURE__ */ jsx37("input", {
|
|
1865
|
+
type: "radio",
|
|
1866
|
+
name,
|
|
1867
|
+
value: o,
|
|
1868
|
+
defaultChecked: o === value,
|
|
1869
|
+
onChange: onChange && (() => onChange(o))
|
|
1870
|
+
}),
|
|
1871
|
+
o
|
|
1872
|
+
]
|
|
1873
|
+
}, o))
|
|
1874
|
+
})
|
|
1875
|
+
]
|
|
1876
|
+
});
|
|
1877
|
+
}
|
|
1878
|
+
// src/ScrollFade.tsx
|
|
1879
|
+
import { useRef as useRef5 } from "react";
|
|
1880
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
1881
|
+
function ScrollFade() {
|
|
1882
|
+
const ref = useRef5(null);
|
|
1883
|
+
useElementBehavior(ref, "scroll", wireScroll);
|
|
1884
|
+
return /* @__PURE__ */ jsx38("span", {
|
|
1885
|
+
className: "feitio-scroll-fade",
|
|
1886
|
+
"aria-hidden": "true",
|
|
1887
|
+
ref
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
// src/Search.tsx
|
|
1891
|
+
import { jsx as jsx39, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1892
|
+
function Search({
|
|
1893
|
+
id,
|
|
1894
|
+
title,
|
|
1895
|
+
placeholder,
|
|
1896
|
+
closeLabel = "Fechar",
|
|
1897
|
+
keys,
|
|
1898
|
+
sprite,
|
|
1899
|
+
children
|
|
1900
|
+
}) {
|
|
1901
|
+
return /* @__PURE__ */ jsx39("dialog", {
|
|
1902
|
+
className: "feitio-dialog search-dialog",
|
|
1903
|
+
id,
|
|
1904
|
+
"aria-labelledby": `${id}-t`,
|
|
1905
|
+
children: /* @__PURE__ */ jsxs27("form", {
|
|
1906
|
+
method: "dialog",
|
|
1907
|
+
children: [
|
|
1908
|
+
/* @__PURE__ */ jsx39("h2", {
|
|
1909
|
+
id: `${id}-t`,
|
|
1910
|
+
className: "feitio-visually-hidden",
|
|
1911
|
+
children: title
|
|
1912
|
+
}),
|
|
1913
|
+
/* @__PURE__ */ jsxs27("div", {
|
|
1914
|
+
className: "search-head",
|
|
1915
|
+
children: [
|
|
1916
|
+
/* @__PURE__ */ jsx39(Icon, {
|
|
1917
|
+
name: "search",
|
|
1918
|
+
sprite
|
|
1919
|
+
}),
|
|
1920
|
+
/* @__PURE__ */ jsx39("label", {
|
|
1921
|
+
className: "feitio-visually-hidden",
|
|
1922
|
+
htmlFor: `${id}-field`,
|
|
1923
|
+
children: title
|
|
1924
|
+
}),
|
|
1925
|
+
/* @__PURE__ */ jsx39("input", {
|
|
1926
|
+
className: "search-field",
|
|
1927
|
+
id: `${id}-field`,
|
|
1928
|
+
type: "search",
|
|
1929
|
+
autoComplete: "off",
|
|
1930
|
+
placeholder
|
|
1931
|
+
}),
|
|
1932
|
+
/* @__PURE__ */ jsxs27("button", {
|
|
1933
|
+
type: "submit",
|
|
1934
|
+
className: "feitio-button close",
|
|
1935
|
+
"data-size": "small",
|
|
1936
|
+
value: "close",
|
|
1937
|
+
children: [
|
|
1938
|
+
/* @__PURE__ */ jsx39(Icon, {
|
|
1939
|
+
name: "close",
|
|
1940
|
+
sprite
|
|
1941
|
+
}),
|
|
1942
|
+
closeLabel
|
|
1943
|
+
]
|
|
1944
|
+
})
|
|
1945
|
+
]
|
|
1946
|
+
}),
|
|
1947
|
+
/* @__PURE__ */ jsx39("ul", {
|
|
1948
|
+
className: "results",
|
|
1949
|
+
children
|
|
1950
|
+
}),
|
|
1951
|
+
keys && /* @__PURE__ */ jsxs27("p", {
|
|
1952
|
+
className: "foot",
|
|
1953
|
+
children: [
|
|
1954
|
+
/* @__PURE__ */ jsxs27("span", {
|
|
1955
|
+
children: [
|
|
1956
|
+
/* @__PURE__ */ jsx39("kbd", {
|
|
1957
|
+
className: "feitio-kbd",
|
|
1958
|
+
children: "↵"
|
|
1959
|
+
}),
|
|
1960
|
+
" ",
|
|
1961
|
+
keys.open
|
|
1962
|
+
]
|
|
1963
|
+
}),
|
|
1964
|
+
/* @__PURE__ */ jsxs27("span", {
|
|
1965
|
+
children: [
|
|
1966
|
+
/* @__PURE__ */ jsx39("kbd", {
|
|
1967
|
+
className: "feitio-kbd",
|
|
1968
|
+
children: "↑"
|
|
1969
|
+
}),
|
|
1970
|
+
/* @__PURE__ */ jsx39("kbd", {
|
|
1971
|
+
className: "feitio-kbd",
|
|
1972
|
+
children: "↓"
|
|
1973
|
+
}),
|
|
1974
|
+
" ",
|
|
1975
|
+
keys.choose
|
|
1976
|
+
]
|
|
1977
|
+
}),
|
|
1978
|
+
/* @__PURE__ */ jsxs27("span", {
|
|
1979
|
+
children: [
|
|
1980
|
+
/* @__PURE__ */ jsx39("kbd", {
|
|
1981
|
+
className: "feitio-kbd",
|
|
1982
|
+
children: "Esc"
|
|
1983
|
+
}),
|
|
1984
|
+
" ",
|
|
1985
|
+
keys.close
|
|
1986
|
+
]
|
|
1987
|
+
})
|
|
1988
|
+
]
|
|
1989
|
+
})
|
|
1990
|
+
]
|
|
1991
|
+
})
|
|
1992
|
+
});
|
|
1993
|
+
}
|
|
1994
|
+
// src/SegmentedControl.tsx
|
|
1995
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
1996
|
+
function SegmentedControl({
|
|
1997
|
+
label,
|
|
1998
|
+
options,
|
|
1999
|
+
value,
|
|
2000
|
+
onChange
|
|
2001
|
+
}) {
|
|
2002
|
+
usePageBehavior("feitioForms", wireForms2);
|
|
2003
|
+
const current = value ?? options[0];
|
|
2004
|
+
return /* @__PURE__ */ jsx40("div", {
|
|
2005
|
+
className: "feitio-segmented",
|
|
2006
|
+
role: "group",
|
|
2007
|
+
"aria-label": label,
|
|
2008
|
+
children: options.map((o) => /* @__PURE__ */ jsx40("button", {
|
|
2009
|
+
type: "button",
|
|
2010
|
+
"aria-pressed": o === current ? "true" : "false",
|
|
2011
|
+
onClick: onChange && (() => onChange(o)),
|
|
2012
|
+
children: o
|
|
2013
|
+
}, o))
|
|
2014
|
+
});
|
|
2015
|
+
}
|
|
2016
|
+
// src/Select.tsx
|
|
2017
|
+
import { jsx as jsx41, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2018
|
+
function Select({
|
|
2019
|
+
id,
|
|
2020
|
+
options,
|
|
2021
|
+
value,
|
|
2022
|
+
empty,
|
|
2023
|
+
disabled,
|
|
2024
|
+
invalid,
|
|
2025
|
+
describedBy,
|
|
2026
|
+
name,
|
|
2027
|
+
sprite,
|
|
2028
|
+
onChange
|
|
2029
|
+
}) {
|
|
2030
|
+
return /* @__PURE__ */ jsxs28("span", {
|
|
2031
|
+
className: "feitio-select",
|
|
2032
|
+
children: [
|
|
2033
|
+
/* @__PURE__ */ jsxs28("select", {
|
|
2034
|
+
id,
|
|
2035
|
+
name,
|
|
2036
|
+
disabled,
|
|
2037
|
+
"aria-invalid": invalid ? "true" : undefined,
|
|
2038
|
+
"aria-describedby": describedBy,
|
|
2039
|
+
defaultValue: value,
|
|
2040
|
+
onChange: onChange && ((event) => onChange(event.target.value)),
|
|
2041
|
+
children: [
|
|
2042
|
+
empty && /* @__PURE__ */ jsx41("option", {
|
|
2043
|
+
value: "",
|
|
2044
|
+
children: empty
|
|
2045
|
+
}),
|
|
2046
|
+
options.map((o) => /* @__PURE__ */ jsx41("option", {
|
|
2047
|
+
children: o
|
|
2048
|
+
}, o))
|
|
2049
|
+
]
|
|
2050
|
+
}),
|
|
2051
|
+
/* @__PURE__ */ jsx41(Icon, {
|
|
2052
|
+
name: "chevron-down",
|
|
2053
|
+
sprite
|
|
2054
|
+
})
|
|
2055
|
+
]
|
|
2056
|
+
});
|
|
2057
|
+
}
|
|
2058
|
+
// src/SkipLink.tsx
|
|
2059
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
2060
|
+
function SkipLink({
|
|
2061
|
+
href = "#content",
|
|
2062
|
+
children
|
|
2063
|
+
}) {
|
|
2064
|
+
return /* @__PURE__ */ jsx42("a", {
|
|
2065
|
+
className: "feitio-skip-link",
|
|
2066
|
+
href,
|
|
2067
|
+
children
|
|
2068
|
+
});
|
|
2069
|
+
}
|
|
2070
|
+
// src/Stack.tsx
|
|
2071
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
2072
|
+
function Stack({ gap = 4, align, as: Tag = "div", children }) {
|
|
2073
|
+
return /* @__PURE__ */ jsx43(Tag, {
|
|
2074
|
+
className: "feitio-stack",
|
|
2075
|
+
"data-gap": gap,
|
|
2076
|
+
"data-align": align,
|
|
2077
|
+
children
|
|
2078
|
+
});
|
|
2079
|
+
}
|
|
2080
|
+
// src/StatusOverlay.tsx
|
|
2081
|
+
import { jsx as jsx44, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2082
|
+
function StatusOverlay({
|
|
2083
|
+
state,
|
|
2084
|
+
label = "",
|
|
2085
|
+
as: Tag = "div",
|
|
2086
|
+
ref,
|
|
2087
|
+
children
|
|
2088
|
+
}) {
|
|
2089
|
+
return /* @__PURE__ */ jsxs29(Tag, {
|
|
2090
|
+
className: "feitio-status-host",
|
|
2091
|
+
"data-state": state,
|
|
2092
|
+
ref,
|
|
2093
|
+
children: [
|
|
2094
|
+
children,
|
|
2095
|
+
/* @__PURE__ */ jsxs29("div", {
|
|
2096
|
+
className: "feitio-status",
|
|
2097
|
+
role: "status",
|
|
2098
|
+
children: [
|
|
2099
|
+
/* @__PURE__ */ jsxs29("svg", {
|
|
2100
|
+
viewBox: "0 0 48 48",
|
|
2101
|
+
"aria-hidden": "true",
|
|
2102
|
+
children: [
|
|
2103
|
+
/* @__PURE__ */ jsxs29("g", {
|
|
2104
|
+
className: "loading",
|
|
2105
|
+
children: [
|
|
2106
|
+
/* @__PURE__ */ jsx44("path", {
|
|
2107
|
+
pathLength: 1,
|
|
2108
|
+
d: "M24 7 C34 6.5 41.5 14 41 24 C40.6 33 33 41 24 41.2"
|
|
2109
|
+
}),
|
|
2110
|
+
/* @__PURE__ */ jsx44("path", {
|
|
2111
|
+
pathLength: 1,
|
|
2112
|
+
d: "M25.5 41 C14.5 41.6 6.8 33.5 7.2 23.6 C7.6 14 14.6 7.4 23 6.4"
|
|
2113
|
+
})
|
|
2114
|
+
]
|
|
2115
|
+
}),
|
|
2116
|
+
/* @__PURE__ */ jsxs29("g", {
|
|
2117
|
+
className: "ok",
|
|
2118
|
+
children: [
|
|
2119
|
+
/* @__PURE__ */ jsx44("path", {
|
|
2120
|
+
pathLength: 1,
|
|
2121
|
+
d: "M13 25 L21 33.5"
|
|
2122
|
+
}),
|
|
2123
|
+
/* @__PURE__ */ jsx44("path", {
|
|
2124
|
+
pathLength: 1,
|
|
2125
|
+
d: "M19.5 34 L36 14.5"
|
|
2126
|
+
})
|
|
2127
|
+
]
|
|
2128
|
+
}),
|
|
2129
|
+
/* @__PURE__ */ jsxs29("g", {
|
|
2130
|
+
className: "error",
|
|
2131
|
+
children: [
|
|
2132
|
+
/* @__PURE__ */ jsx44("path", {
|
|
2133
|
+
pathLength: 1,
|
|
2134
|
+
d: "M15 15 L33.5 33"
|
|
2135
|
+
}),
|
|
2136
|
+
/* @__PURE__ */ jsx44("path", {
|
|
2137
|
+
pathLength: 1,
|
|
2138
|
+
d: "M33 14.5 L15.5 33.5"
|
|
2139
|
+
})
|
|
2140
|
+
]
|
|
2141
|
+
})
|
|
2142
|
+
]
|
|
2143
|
+
}),
|
|
2144
|
+
/* @__PURE__ */ jsx44("span", {
|
|
2145
|
+
className: "label",
|
|
2146
|
+
children: label
|
|
2147
|
+
})
|
|
2148
|
+
]
|
|
2149
|
+
})
|
|
2150
|
+
]
|
|
2151
|
+
});
|
|
2152
|
+
}
|
|
2153
|
+
// src/SummaryList.tsx
|
|
2154
|
+
import { jsx as jsx45, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2155
|
+
function SummaryList({ rows }) {
|
|
2156
|
+
return /* @__PURE__ */ jsx45("dl", {
|
|
2157
|
+
className: "feitio-summary-list",
|
|
2158
|
+
children: rows.map((r) => /* @__PURE__ */ jsxs30("div", {
|
|
2159
|
+
children: [
|
|
2160
|
+
/* @__PURE__ */ jsx45("dt", {
|
|
2161
|
+
children: r.key
|
|
2162
|
+
}),
|
|
2163
|
+
/* @__PURE__ */ jsx45("dd", {
|
|
2164
|
+
children: r.value
|
|
2165
|
+
}),
|
|
2166
|
+
r.change && /* @__PURE__ */ jsx45("dd", {
|
|
2167
|
+
className: "change",
|
|
2168
|
+
children: /* @__PURE__ */ jsxs30("a", {
|
|
2169
|
+
className: "feitio-link",
|
|
2170
|
+
href: r.change.href,
|
|
2171
|
+
children: [
|
|
2172
|
+
r.change.label,
|
|
2173
|
+
/* @__PURE__ */ jsxs30("span", {
|
|
2174
|
+
className: "feitio-visually-hidden",
|
|
2175
|
+
children: [
|
|
2176
|
+
" ",
|
|
2177
|
+
r.key
|
|
2178
|
+
]
|
|
2179
|
+
})
|
|
2180
|
+
]
|
|
2181
|
+
})
|
|
2182
|
+
})
|
|
2183
|
+
]
|
|
2184
|
+
}, r.key))
|
|
2185
|
+
});
|
|
2186
|
+
}
|
|
2187
|
+
// src/Swatch.tsx
|
|
2188
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
2189
|
+
function Swatch({ role }) {
|
|
2190
|
+
return /* @__PURE__ */ jsx46("span", {
|
|
2191
|
+
className: "feitio-swatch",
|
|
2192
|
+
style: { "--swatch": `var(--feitio-color-${role})` }
|
|
2193
|
+
});
|
|
2194
|
+
}
|
|
2195
|
+
// src/Switch.tsx
|
|
2196
|
+
import { jsx as jsx47, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2197
|
+
function Switch({
|
|
2198
|
+
label,
|
|
2199
|
+
on = false,
|
|
2200
|
+
disabled,
|
|
2201
|
+
onLabel = "Ligado",
|
|
2202
|
+
offLabel = "Desligado",
|
|
2203
|
+
name,
|
|
2204
|
+
onChange
|
|
2205
|
+
}) {
|
|
2206
|
+
usePageBehavior("feitioForms", wireForms2);
|
|
2207
|
+
return /* @__PURE__ */ jsxs31("label", {
|
|
2208
|
+
className: "feitio-switch",
|
|
2209
|
+
"data-on": onLabel,
|
|
2210
|
+
"data-off": offLabel,
|
|
2211
|
+
children: [
|
|
2212
|
+
/* @__PURE__ */ jsx47("input", {
|
|
2213
|
+
type: "checkbox",
|
|
2214
|
+
role: "switch",
|
|
2215
|
+
name,
|
|
2216
|
+
defaultChecked: on,
|
|
2217
|
+
disabled,
|
|
2218
|
+
onChange: onChange && ((event) => onChange(event.target.checked))
|
|
2219
|
+
}),
|
|
2220
|
+
label,
|
|
2221
|
+
/* @__PURE__ */ jsx47("span", {
|
|
2222
|
+
className: "state",
|
|
2223
|
+
children: on ? onLabel : offLabel
|
|
2224
|
+
})
|
|
2225
|
+
]
|
|
2226
|
+
});
|
|
2227
|
+
}
|
|
2228
|
+
// src/Table.tsx
|
|
2229
|
+
import { jsx as jsx48, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2230
|
+
function Table({ id, caption, columns, rows, compact }) {
|
|
2231
|
+
const cap = `${id}-cap`;
|
|
2232
|
+
return /* @__PURE__ */ jsx48("div", {
|
|
2233
|
+
"data-density": compact ? "compact" : undefined,
|
|
2234
|
+
style: { inlineSize: "100%" },
|
|
2235
|
+
children: /* @__PURE__ */ jsx48("div", {
|
|
2236
|
+
className: "feitio-table-scroll",
|
|
2237
|
+
tabIndex: 0,
|
|
2238
|
+
role: "region",
|
|
2239
|
+
"aria-labelledby": caption ? cap : undefined,
|
|
2240
|
+
"aria-label": caption ? undefined : columns[0]?.label,
|
|
2241
|
+
children: /* @__PURE__ */ jsxs32("table", {
|
|
2242
|
+
className: "feitio-table",
|
|
2243
|
+
children: [
|
|
2244
|
+
caption && /* @__PURE__ */ jsx48("caption", {
|
|
2245
|
+
id: cap,
|
|
2246
|
+
children: caption
|
|
2247
|
+
}),
|
|
2248
|
+
/* @__PURE__ */ jsx48("thead", {
|
|
2249
|
+
children: /* @__PURE__ */ jsx48("tr", {
|
|
2250
|
+
children: columns.map((c) => /* @__PURE__ */ jsx48("th", {
|
|
2251
|
+
scope: "col",
|
|
2252
|
+
"data-align": c.align,
|
|
2253
|
+
children: c.hidden ? /* @__PURE__ */ jsx48("span", {
|
|
2254
|
+
className: "feitio-visually-hidden",
|
|
2255
|
+
children: c.label
|
|
2256
|
+
}) : c.label
|
|
2257
|
+
}, c.label))
|
|
2258
|
+
})
|
|
2259
|
+
}),
|
|
2260
|
+
/* @__PURE__ */ jsx48("tbody", {
|
|
2261
|
+
children: rows.map((r, n) => /* @__PURE__ */ jsx48("tr", {
|
|
2262
|
+
children: r.map((cell, i) => i === 0 ? /* @__PURE__ */ jsx48("td", {
|
|
2263
|
+
className: "title",
|
|
2264
|
+
children: cell
|
|
2265
|
+
}, i) : columns[i]?.hidden ? /* @__PURE__ */ jsx48("td", {
|
|
2266
|
+
className: "actions",
|
|
2267
|
+
children: cell
|
|
2268
|
+
}, i) : /* @__PURE__ */ jsx48("td", {
|
|
2269
|
+
"data-align": columns[i]?.align,
|
|
2270
|
+
"data-label": columns[i]?.label,
|
|
2271
|
+
children: cell
|
|
2272
|
+
}, i))
|
|
2273
|
+
}, n))
|
|
2274
|
+
})
|
|
2275
|
+
]
|
|
2276
|
+
})
|
|
2277
|
+
})
|
|
2278
|
+
});
|
|
2279
|
+
}
|
|
2280
|
+
// src/Tag.tsx
|
|
2281
|
+
import { jsx as jsx49, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2282
|
+
var icons2 = { ok: "check", warn: "warn", error: "close", info: "info" };
|
|
2283
|
+
function Tag({ status, size, sprite, children }) {
|
|
2284
|
+
return /* @__PURE__ */ jsxs33("span", {
|
|
2285
|
+
className: "feitio-tag",
|
|
2286
|
+
"data-status": status,
|
|
2287
|
+
"data-size": size,
|
|
2288
|
+
children: [
|
|
2289
|
+
size !== "small" && /* @__PURE__ */ jsx49(Icon, {
|
|
2290
|
+
name: icons2[status ?? "info"],
|
|
2291
|
+
sprite
|
|
2292
|
+
}),
|
|
2293
|
+
children
|
|
2294
|
+
]
|
|
2295
|
+
});
|
|
2296
|
+
}
|
|
2297
|
+
// src/TaskList.tsx
|
|
2298
|
+
import { jsx as jsx50, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2299
|
+
function TaskList({ items, sprite }) {
|
|
2300
|
+
return /* @__PURE__ */ jsx50("ul", {
|
|
2301
|
+
className: "feitio-task-list",
|
|
2302
|
+
children: items.map((i) => /* @__PURE__ */ jsxs34("li", {
|
|
2303
|
+
children: [
|
|
2304
|
+
/* @__PURE__ */ jsxs34("span", {
|
|
2305
|
+
className: "name",
|
|
2306
|
+
children: [
|
|
2307
|
+
/* @__PURE__ */ jsx50("a", {
|
|
2308
|
+
className: "feitio-link",
|
|
2309
|
+
href: i.href,
|
|
2310
|
+
children: i.name
|
|
2311
|
+
}),
|
|
2312
|
+
i.detail && /* @__PURE__ */ jsx50("small", {
|
|
2313
|
+
children: i.detail
|
|
2314
|
+
})
|
|
2315
|
+
]
|
|
2316
|
+
}),
|
|
2317
|
+
/* @__PURE__ */ jsx50(Tag, {
|
|
2318
|
+
status: i.status,
|
|
2319
|
+
sprite,
|
|
2320
|
+
children: i.word
|
|
2321
|
+
})
|
|
2322
|
+
]
|
|
2323
|
+
}, i.href))
|
|
2324
|
+
});
|
|
2325
|
+
}
|
|
2326
|
+
// src/Text.tsx
|
|
2327
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
2328
|
+
function Text({ children }) {
|
|
2329
|
+
return /* @__PURE__ */ jsx51("p", {
|
|
2330
|
+
className: "feitio-text",
|
|
2331
|
+
children
|
|
2332
|
+
});
|
|
2333
|
+
}
|
|
2334
|
+
// src/Textarea.tsx
|
|
2335
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
2336
|
+
function Textarea({
|
|
2337
|
+
invalid,
|
|
2338
|
+
describedBy,
|
|
2339
|
+
className,
|
|
2340
|
+
...rest
|
|
2341
|
+
}) {
|
|
2342
|
+
return /* @__PURE__ */ jsx52("textarea", {
|
|
2343
|
+
...rest,
|
|
2344
|
+
className: classNames("feitio-textarea", className),
|
|
2345
|
+
"aria-invalid": invalid ? "true" : undefined,
|
|
2346
|
+
"aria-describedby": describedBy
|
|
2347
|
+
});
|
|
2348
|
+
}
|
|
2349
|
+
// src/TextInput.tsx
|
|
2350
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
2351
|
+
function TextInput({
|
|
2352
|
+
invalid,
|
|
2353
|
+
describedBy,
|
|
2354
|
+
width,
|
|
2355
|
+
className,
|
|
2356
|
+
...rest
|
|
2357
|
+
}) {
|
|
2358
|
+
return /* @__PURE__ */ jsx53("input", {
|
|
2359
|
+
...rest,
|
|
2360
|
+
className: classNames("feitio-input", className),
|
|
2361
|
+
"aria-invalid": invalid ? "true" : undefined,
|
|
2362
|
+
"aria-describedby": describedBy,
|
|
2363
|
+
"data-width": width
|
|
2364
|
+
});
|
|
2365
|
+
}
|
|
2366
|
+
// src/TimeInput.tsx
|
|
2367
|
+
import { jsx as jsx54, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
2368
|
+
function TimeInput({
|
|
2369
|
+
hour = "09",
|
|
2370
|
+
minute = "00",
|
|
2371
|
+
cycle = "24",
|
|
2372
|
+
period = "AM",
|
|
2373
|
+
hourLabel = "Hora",
|
|
2374
|
+
minuteLabel = "Minuto",
|
|
2375
|
+
periodLabel = "AM ou PM",
|
|
2376
|
+
invalid,
|
|
2377
|
+
disabled
|
|
2378
|
+
}) {
|
|
2379
|
+
usePageBehavior("feitioForms", wireForms2);
|
|
2380
|
+
return /* @__PURE__ */ jsxs35("div", {
|
|
2381
|
+
className: "feitio-time-field",
|
|
2382
|
+
"data-hour-cycle": cycle,
|
|
2383
|
+
children: [
|
|
2384
|
+
/* @__PURE__ */ jsx54("input", {
|
|
2385
|
+
className: "seg",
|
|
2386
|
+
inputMode: "numeric",
|
|
2387
|
+
maxLength: 2,
|
|
2388
|
+
defaultValue: hour,
|
|
2389
|
+
"aria-label": hourLabel,
|
|
2390
|
+
"aria-invalid": invalid ? "true" : undefined,
|
|
2391
|
+
disabled
|
|
2392
|
+
}),
|
|
2393
|
+
/* @__PURE__ */ jsx54("span", {
|
|
2394
|
+
className: "sep",
|
|
2395
|
+
"aria-hidden": "true",
|
|
2396
|
+
children: ":"
|
|
2397
|
+
}),
|
|
2398
|
+
/* @__PURE__ */ jsx54("input", {
|
|
2399
|
+
className: "seg",
|
|
2400
|
+
inputMode: "numeric",
|
|
2401
|
+
maxLength: 2,
|
|
2402
|
+
defaultValue: minute,
|
|
2403
|
+
"aria-label": minuteLabel,
|
|
2404
|
+
disabled
|
|
2405
|
+
}),
|
|
2406
|
+
cycle === "12" && /* @__PURE__ */ jsx54("button", {
|
|
2407
|
+
type: "button",
|
|
2408
|
+
className: "period",
|
|
2409
|
+
"aria-label": periodLabel,
|
|
2410
|
+
disabled,
|
|
2411
|
+
children: period
|
|
2412
|
+
})
|
|
2413
|
+
]
|
|
2414
|
+
});
|
|
2415
|
+
}
|
|
2416
|
+
// src/VisuallyHidden.tsx
|
|
2417
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
2418
|
+
function VisuallyHidden({ children }) {
|
|
2419
|
+
return /* @__PURE__ */ jsx55("span", {
|
|
2420
|
+
className: "feitio-visually-hidden",
|
|
2421
|
+
children
|
|
2422
|
+
});
|
|
2423
|
+
}
|
|
2424
|
+
export {
|
|
2425
|
+
Anchor,
|
|
2426
|
+
AppShell,
|
|
2427
|
+
BackToTop,
|
|
2428
|
+
Block,
|
|
2429
|
+
Breadcrumbs,
|
|
2430
|
+
Button,
|
|
2431
|
+
Checkbox,
|
|
2432
|
+
CodeBlock,
|
|
2433
|
+
Details,
|
|
2434
|
+
Dialog,
|
|
2435
|
+
Divider,
|
|
2436
|
+
DoDont,
|
|
2437
|
+
Drawer,
|
|
2438
|
+
EmptyState,
|
|
2439
|
+
ErrorMessage,
|
|
2440
|
+
ErrorSummary,
|
|
2441
|
+
Example,
|
|
2442
|
+
FeitioProvider,
|
|
2443
|
+
Field,
|
|
2444
|
+
Fieldset,
|
|
2445
|
+
FilterField,
|
|
2446
|
+
Footer,
|
|
2447
|
+
Grid,
|
|
2448
|
+
Header,
|
|
2449
|
+
Heading,
|
|
2450
|
+
Hint,
|
|
2451
|
+
Icon,
|
|
2452
|
+
Inline,
|
|
2453
|
+
Kbd,
|
|
2454
|
+
Label,
|
|
2455
|
+
Link,
|
|
2456
|
+
LinkCard,
|
|
2457
|
+
Menu,
|
|
2458
|
+
Nav,
|
|
2459
|
+
Notice,
|
|
2460
|
+
Pagination,
|
|
2461
|
+
Radios,
|
|
2462
|
+
ScrollFade,
|
|
2463
|
+
Search,
|
|
2464
|
+
SegmentedControl,
|
|
2465
|
+
Select,
|
|
2466
|
+
SkipLink,
|
|
2467
|
+
Stack,
|
|
2468
|
+
StatusOverlay,
|
|
2469
|
+
SummaryList,
|
|
2470
|
+
Swatch,
|
|
2471
|
+
Switch,
|
|
2472
|
+
Table,
|
|
2473
|
+
Tag,
|
|
2474
|
+
TaskList,
|
|
2475
|
+
Text,
|
|
2476
|
+
TextInput,
|
|
2477
|
+
Textarea,
|
|
2478
|
+
TimeInput,
|
|
2479
|
+
VisuallyHidden,
|
|
2480
|
+
status,
|
|
2481
|
+
useNotices
|
|
2482
|
+
};
|