@g4rcez/components 3.0.0-0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/SKILL.md +266 -0
- package/dist/ai/docs/Alert.md +167 -0
- package/dist/ai/docs/AnimatedList.md +205 -0
- package/dist/ai/docs/Autocomplete.md +225 -0
- package/dist/ai/docs/Button.md +182 -0
- package/dist/ai/docs/Calendar.md +219 -0
- package/dist/ai/docs/Card.md +174 -0
- package/dist/ai/docs/Checkbox.md +199 -0
- package/dist/ai/docs/CommandPalette.md +293 -0
- package/dist/ai/docs/DatePicker.md +171 -0
- package/dist/ai/docs/Dropdown.md +223 -0
- package/dist/ai/docs/Empty.md +163 -0
- package/dist/ai/docs/Expand.md +143 -0
- package/dist/ai/docs/FileUpload.md +225 -0
- package/dist/ai/docs/Form.md +107 -0
- package/dist/ai/docs/FormReset.md +117 -0
- package/dist/ai/docs/Heading.md +88 -0
- package/dist/ai/docs/Input.md +237 -0
- package/dist/ai/docs/InputField.md +170 -0
- package/dist/ai/docs/List.md +205 -0
- package/dist/ai/docs/Menu.md +166 -0
- package/dist/ai/docs/Modal.md +280 -0
- package/dist/ai/docs/MultiSelect.md +196 -0
- package/dist/ai/docs/Notifications.md +231 -0
- package/dist/ai/docs/PageCalendar.md +271 -0
- package/dist/ai/docs/Polymorph.md +159 -0
- package/dist/ai/docs/Progress.md +145 -0
- package/dist/ai/docs/Radiobox.md +128 -0
- package/dist/ai/docs/RenderOnView.md +138 -0
- package/dist/ai/docs/Resizable.md +159 -0
- package/dist/ai/docs/Select.md +284 -0
- package/dist/ai/docs/Shortcut.md +105 -0
- package/dist/ai/docs/Skeleton.md +166 -0
- package/dist/ai/docs/Slider.md +144 -0
- package/dist/ai/docs/Slot.md +173 -0
- package/dist/ai/docs/Spinner.md +118 -0
- package/dist/ai/docs/Stats.md +137 -0
- package/dist/ai/docs/Step.md +159 -0
- package/dist/ai/docs/Switch.md +167 -0
- package/dist/ai/docs/Table.md +298 -0
- package/dist/ai/docs/Tabs.md +191 -0
- package/dist/ai/docs/Tag.md +224 -0
- package/dist/ai/docs/TaskList.md +144 -0
- package/dist/ai/docs/Textarea.md +167 -0
- package/dist/ai/docs/Timeline.md +210 -0
- package/dist/ai/docs/Toolbar.md +132 -0
- package/dist/ai/docs/Tooltip.md +231 -0
- package/dist/ai/docs/TransferList.md +142 -0
- package/dist/ai/docs/Typography.md +187 -0
- package/dist/ai/docs/Wizard.md +213 -0
- package/dist/ai/docs/index.md +183 -0
- package/dist/components/core/button.d.ts +2 -8
- package/dist/components/core/button.d.ts.map +1 -1
- package/dist/components/core/polymorph.d.ts.map +1 -1
- package/dist/components/core/slot.d.ts +1 -1
- package/dist/components/core/slot.d.ts.map +1 -1
- package/dist/components/core/tag.d.ts +2 -2
- package/dist/components/core/tag.d.ts.map +1 -1
- package/dist/components/core/typography.d.ts.map +1 -1
- package/dist/components/display/alert.d.ts.map +1 -1
- package/dist/components/display/calendar.d.ts.map +1 -1
- package/dist/components/display/card.d.ts.map +1 -1
- package/dist/components/display/list.d.ts.map +1 -1
- package/dist/components/display/notifications.d.ts +2 -0
- package/dist/components/display/notifications.d.ts.map +1 -1
- package/dist/components/display/progress.d.ts.map +1 -1
- package/dist/components/display/skeleton.d.ts.map +1 -1
- package/dist/components/display/step.d.ts.map +1 -1
- package/dist/components/display/tabs.d.ts.map +1 -1
- package/dist/components/floating/command-palette.d.ts +1 -0
- package/dist/components/floating/command-palette.d.ts.map +1 -1
- package/dist/components/floating/dropdown.d.ts +1 -0
- package/dist/components/floating/dropdown.d.ts.map +1 -1
- package/dist/components/floating/menu.d.ts +2 -2
- package/dist/components/floating/menu.d.ts.map +1 -1
- package/dist/components/floating/modal.d.ts +20 -53
- package/dist/components/floating/modal.d.ts.map +1 -1
- package/dist/components/floating/tooltip.d.ts.map +1 -1
- package/dist/components/floating/wizard.d.ts +1 -1
- package/dist/components/floating/wizard.d.ts.map +1 -1
- package/dist/components/form/autocomplete.d.ts.map +1 -1
- package/dist/components/form/date-picker.d.ts.map +1 -1
- package/dist/components/form/free-text.d.ts.map +1 -1
- package/dist/components/form/input-field.d.ts +3 -2
- package/dist/components/form/input-field.d.ts.map +1 -1
- package/dist/components/form/multi-select.d.ts.map +1 -1
- package/dist/components/form/select.d.ts.map +1 -1
- package/dist/components/form/slider.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/page-calendar/calendar-header.d.ts +16 -0
- package/dist/components/page-calendar/calendar-header.d.ts.map +1 -0
- package/dist/components/page-calendar/day-view.d.ts +12 -0
- package/dist/components/page-calendar/day-view.d.ts.map +1 -0
- package/dist/components/page-calendar/event-pill.d.ts +9 -0
- package/dist/components/page-calendar/event-pill.d.ts.map +1 -0
- package/dist/components/page-calendar/index.d.ts +4 -0
- package/dist/components/page-calendar/index.d.ts.map +1 -0
- package/dist/components/page-calendar/month-view.d.ts +11 -0
- package/dist/components/page-calendar/month-view.d.ts.map +1 -0
- package/dist/components/page-calendar/page-calendar.d.ts +18 -0
- package/dist/components/page-calendar/page-calendar.d.ts.map +1 -0
- package/dist/components/page-calendar/page-calendar.types.d.ts +18 -0
- package/dist/components/page-calendar/page-calendar.types.d.ts.map +1 -0
- package/dist/components/page-calendar/page-calendar.utils.d.ts +18 -0
- package/dist/components/page-calendar/page-calendar.utils.d.ts.map +1 -0
- package/dist/components/page-calendar/week-view.d.ts +11 -0
- package/dist/components/page-calendar/week-view.d.ts.map +1 -0
- package/dist/components/table/index.d.ts.map +1 -1
- package/dist/components/table/inner-table.d.ts.map +1 -1
- package/dist/components/table/metadata.d.ts.map +1 -1
- package/dist/components/table/row.d.ts.map +1 -1
- package/dist/components/table/table-lib.d.ts.map +1 -1
- package/dist/components/table/thead.d.ts.map +1 -1
- package/dist/config/context.d.ts.map +1 -1
- package/dist/config/default-translations.d.ts +21 -4
- package/dist/config/default-translations.d.ts.map +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/hooks/use-components-provider.d.ts.map +1 -1
- package/dist/hooks/use-form.d.ts +11 -11
- package/dist/hooks/use-form.d.ts.map +1 -1
- package/dist/hooks/use-input-id.d.ts.map +1 -1
- package/dist/hooks/use-preferences.d.ts.map +1 -1
- package/dist/hooks/use-previous.d.ts.map +1 -1
- package/dist/hooks/use-reactive.d.ts.map +1 -1
- package/dist/hooks/use-resize-observer.d.ts.map +1 -1
- package/dist/hooks/use-stable-ref.d.ts.map +1 -1
- package/dist/hooks/use-swipe.d.ts.map +1 -1
- package/dist/hooks/use-translations.d.ts +21 -4
- package/dist/hooks/use-translations.d.ts.map +1 -1
- package/dist/index.css +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13862 -12512
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +24 -17
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/dom.d.ts +1 -0
- package/dist/lib/dom.d.ts.map +1 -1
- package/dist/lib/fns.d.ts.map +1 -1
- package/dist/preset/plugin.tailwind.d.ts +9 -0
- package/dist/preset/plugin.tailwind.d.ts.map +1 -0
- package/dist/preset/plugin.tailwind.js +27 -0
- package/dist/preset/preset.tailwind.d.ts +8 -0
- package/dist/preset/preset.tailwind.d.ts.map +1 -0
- package/dist/preset/preset.tailwind.js +54 -0
- package/dist/preset/src/styles/common.d.ts +2 -14
- package/dist/preset/src/styles/common.d.ts.map +1 -1
- package/dist/preset/src/styles/common.js +1 -0
- package/dist/preset/src/styles/dark.d.ts.map +1 -1
- package/dist/preset/src/styles/dark.js +119 -114
- package/dist/preset/src/styles/light.d.ts.map +1 -1
- package/dist/preset/src/styles/light.js +111 -106
- package/dist/preset/src/styles/theme.types.d.ts +17 -8
- package/dist/preset/src/styles/theme.types.d.ts.map +1 -1
- package/dist/styles/common.d.ts +2 -14
- package/dist/styles/common.d.ts.map +1 -1
- package/dist/styles/dark.d.ts.map +1 -1
- package/dist/styles/light.d.ts.map +1 -1
- package/dist/styles/theme.types.d.ts +17 -8
- package/dist/styles/theme.types.d.ts.map +1 -1
- package/package.json +299 -301
- package/dist/components/core/button.jsx +0 -86
- package/dist/components/core/heading.jsx +0 -4
- package/dist/components/core/polymorph.jsx +0 -5
- package/dist/components/core/render-on-view.jsx +0 -31
- package/dist/components/core/resizable.jsx +0 -51
- package/dist/components/core/slot.jsx +0 -163
- package/dist/components/core/tag.jsx +0 -51
- package/dist/components/core/typography.jsx +0 -26
- package/dist/components/display/alert.jsx +0 -56
- package/dist/components/display/calendar.jsx +0 -301
- package/dist/components/display/card.jsx +0 -43
- package/dist/components/display/empty.jsx +0 -11
- package/dist/components/display/list.jsx +0 -81
- package/dist/components/display/notifications.jsx +0 -98
- package/dist/components/display/progress.jsx +0 -13
- package/dist/components/display/shortcut.jsx +0 -23
- package/dist/components/display/skeleton.jsx +0 -14
- package/dist/components/display/spinner.jsx +0 -7
- package/dist/components/display/stats.jsx +0 -20
- package/dist/components/display/step.jsx +0 -131
- package/dist/components/display/tabs.jsx +0 -100
- package/dist/components/display/timeline.jsx +0 -25
- package/dist/components/floating/command-palette.jsx +0 -172
- package/dist/components/floating/dropdown.jsx +0 -53
- package/dist/components/floating/expand.jsx +0 -44
- package/dist/components/floating/menu.jsx +0 -147
- package/dist/components/floating/modal.jsx +0 -241
- package/dist/components/floating/toolbar.jsx +0 -5
- package/dist/components/floating/tooltip.jsx +0 -64
- package/dist/components/floating/wizard.jsx +0 -164
- package/dist/components/form/autocomplete.jsx +0 -275
- package/dist/components/form/checkbox.jsx +0 -12
- package/dist/components/form/date-picker.jsx +0 -115
- package/dist/components/form/file-upload.jsx +0 -133
- package/dist/components/form/form.jsx +0 -10
- package/dist/components/form/formReset.jsx +0 -17
- package/dist/components/form/free-text.jsx +0 -41
- package/dist/components/form/input-field.jsx +0 -54
- package/dist/components/form/input.jsx +0 -36
- package/dist/components/form/multi-select.jsx +0 -328
- package/dist/components/form/radiobox.jsx +0 -6
- package/dist/components/form/select.jsx +0 -42
- package/dist/components/form/slider.jsx +0 -45
- package/dist/components/form/switch.jsx +0 -46
- package/dist/components/form/task-list.jsx +0 -26
- package/dist/components/form/textarea.jsx +0 -12
- package/dist/components/form/transfer-list.jsx +0 -39
- package/dist/components/index.js +0 -43
- package/dist/components/table/filter.jsx +0 -141
- package/dist/components/table/group.jsx +0 -68
- package/dist/components/table/index.jsx +0 -60
- package/dist/components/table/inner-table.jsx +0 -104
- package/dist/components/table/metadata.jsx +0 -37
- package/dist/components/table/pagination.jsx +0 -73
- package/dist/components/table/row.jsx +0 -58
- package/dist/components/table/sort.jsx +0 -105
- package/dist/components/table/table-lib.js +0 -84
- package/dist/components/table/table.context.jsx +0 -4
- package/dist/components/table/thead.jsx +0 -103
- package/dist/config/context.js +0 -12
- package/dist/config/default-translations.jsx +0 -66
- package/dist/config/default-tweaks.js +0 -4
- package/dist/constants.js +0 -2
- package/dist/hooks/use-click-outside.js +0 -17
- package/dist/hooks/use-color-parser.js +0 -9
- package/dist/hooks/use-components-provider.jsx +0 -16
- package/dist/hooks/use-debounce.js +0 -12
- package/dist/hooks/use-floating-ref.js +0 -6
- package/dist/hooks/use-form.js +0 -549
- package/dist/hooks/use-hover.js +0 -18
- package/dist/hooks/use-input-id.js +0 -5
- package/dist/hooks/use-is-coarse-device.js +0 -12
- package/dist/hooks/use-locale.js +0 -10
- package/dist/hooks/use-media-query.js +0 -25
- package/dist/hooks/use-on-event.js +0 -7
- package/dist/hooks/use-parent.js +0 -21
- package/dist/hooks/use-preferences.js +0 -23
- package/dist/hooks/use-previous.js +0 -8
- package/dist/hooks/use-reactive.js +0 -8
- package/dist/hooks/use-remove-scroll.js +0 -61
- package/dist/hooks/use-resize-observer.js +0 -17
- package/dist/hooks/use-stable-ref.js +0 -8
- package/dist/hooks/use-swipe.js +0 -16
- package/dist/hooks/use-translations.js +0 -9
- package/dist/hooks/use-tweaks.js +0 -9
- package/dist/hooks/use-window-size.js +0 -14
- package/dist/lib/combi-keys.js +0 -60
- package/dist/lib/dict.js +0 -39
- package/dist/lib/dom.js +0 -44
- package/dist/lib/fns.js +0 -46
- package/dist/lib/fzf.js +0 -117
- package/dist/lib/keyboard-area.js +0 -14
- package/dist/preset/tailwindcssv4.d.ts +0 -3
- package/dist/preset/tailwindcssv4.d.ts.map +0 -1
- package/dist/preset/tailwindcssv4.js +0 -75
- package/dist/styles/common.js +0 -28
- package/dist/styles/dark.js +0 -209
- package/dist/styles/design-tokens.js +0 -69
- package/dist/styles/light.js +0 -209
- package/dist/styles/theme.js +0 -4
- package/dist/styles/theme.types.js +0 -1
- package/dist/types.js +0 -1
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef } from "react";
|
|
2
|
-
import { Is, onlyNumbers } from "sidekicker";
|
|
3
|
-
import { hasVerticalScroll } from "../lib/dom";
|
|
4
|
-
import { isMobile, isSsr } from "../lib/fns";
|
|
5
|
-
import { useIsCoarseDevice } from "./use-is-coarse-device";
|
|
6
|
-
export const useRemoveScroll = (remove, removeStyle = "overflow-hidden") => {
|
|
7
|
-
const ref = useRef(null);
|
|
8
|
-
const isCoarseDevice = useIsCoarseDevice();
|
|
9
|
-
const prev = useRef(isSsr() ? "" : document.documentElement.style.overflowY);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
if (ref.current === null && !remove)
|
|
12
|
-
return;
|
|
13
|
-
if (removeStyle === "block-only")
|
|
14
|
-
return;
|
|
15
|
-
if (removeStyle === "overflow-hidden") {
|
|
16
|
-
if (remove) {
|
|
17
|
-
prev.current = document.documentElement.style.overflowY;
|
|
18
|
-
document.documentElement.style.overflowY = "hidden";
|
|
19
|
-
if (isCoarseDevice || isMobile())
|
|
20
|
-
return;
|
|
21
|
-
document.documentElement.style.padding = hasVerticalScroll(document.documentElement) ? "0 15px 0 0" : "";
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
document.documentElement.style.padding = "";
|
|
25
|
-
document.documentElement.style.overflowY = prev.current;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}, [remove, isCoarseDevice, removeStyle]);
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
if (!remove)
|
|
31
|
-
return;
|
|
32
|
-
const controller = new AbortController();
|
|
33
|
-
const html = document.documentElement;
|
|
34
|
-
const removeScroll = (e) => {
|
|
35
|
-
const el = ref.current;
|
|
36
|
-
if (el) {
|
|
37
|
-
if (el.contains(e.target)) {
|
|
38
|
-
const rect = el.getBoundingClientRect();
|
|
39
|
-
const realHeight = el.style.height ? Number(onlyNumbers(el.style.height)) : null;
|
|
40
|
-
const scrollable = Is.number(realHeight) ? realHeight : rect.height;
|
|
41
|
-
const hasScroll = el.scrollHeight <= scrollable;
|
|
42
|
-
if (scrollable === el.scrollHeight)
|
|
43
|
-
return remove ? e.preventDefault() : undefined;
|
|
44
|
-
if (hasScroll)
|
|
45
|
-
return;
|
|
46
|
-
return remove ? e.preventDefault() : undefined;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
if (e.currentTarget === document.documentElement) {
|
|
50
|
-
return remove ? e.preventDefault() : undefined;
|
|
51
|
-
}
|
|
52
|
-
return remove ? e.preventDefault() : undefined;
|
|
53
|
-
};
|
|
54
|
-
html.addEventListener("wheel", removeScroll, { signal: controller.signal, passive: false });
|
|
55
|
-
html.addEventListener("scroll", removeScroll, { signal: controller.signal, passive: false });
|
|
56
|
-
return () => {
|
|
57
|
-
controller.abort();
|
|
58
|
-
};
|
|
59
|
-
}, [remove]);
|
|
60
|
-
return ref;
|
|
61
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect, useRef } from "react";
|
|
3
|
-
export const useResizeObserver = (element, onResize) => {
|
|
4
|
-
const onResizeRef = useRef(onResize);
|
|
5
|
-
onResizeRef.current = onResize;
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
if (!element)
|
|
8
|
-
return;
|
|
9
|
-
const observer = new ResizeObserver((entries) => {
|
|
10
|
-
if (entries[0]) {
|
|
11
|
-
onResizeRef.current(entries[0]);
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
observer.observe(element);
|
|
15
|
-
return () => observer.disconnect();
|
|
16
|
-
}, [element]);
|
|
17
|
-
};
|
package/dist/hooks/use-swipe.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useRef } from "react";
|
|
2
|
-
export function useSwipe(onSwipe, threshold) {
|
|
3
|
-
const touchStartX = useRef(null);
|
|
4
|
-
const onTouchStart = (e) => (touchStartX.current = e.touches[0].clientX);
|
|
5
|
-
const onTouchEnd = (e) => {
|
|
6
|
-
if (touchStartX.current === null)
|
|
7
|
-
return;
|
|
8
|
-
const touchEndX = e.changedTouches[0].clientX;
|
|
9
|
-
const diff = touchEndX - touchStartX.current;
|
|
10
|
-
if (Math.abs(diff) > threshold) {
|
|
11
|
-
onSwipe(e, diff > 0 ? "right" : "left");
|
|
12
|
-
}
|
|
13
|
-
touchStartX.current = null;
|
|
14
|
-
};
|
|
15
|
-
return { onTouchStart, onTouchEnd };
|
|
16
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { useContext } from "react";
|
|
2
|
-
import { Context } from "../config/context";
|
|
3
|
-
import { defaultTranslations } from "../config/default-translations";
|
|
4
|
-
export const useTranslations = () => {
|
|
5
|
-
const ctx = useContext(Context);
|
|
6
|
-
if (!ctx)
|
|
7
|
-
return defaultTranslations;
|
|
8
|
-
return ctx.map;
|
|
9
|
-
};
|
package/dist/hooks/use-tweaks.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { useContext } from "react";
|
|
2
|
-
import { Context } from "../config/context";
|
|
3
|
-
import { defaultTweaks } from "../config/default-tweaks";
|
|
4
|
-
export const useTweaks = () => {
|
|
5
|
-
const ctx = useContext(Context);
|
|
6
|
-
if (!ctx)
|
|
7
|
-
return defaultTweaks;
|
|
8
|
-
return ctx.tweaks;
|
|
9
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
export const useWindowSize = () => {
|
|
4
|
-
const [size, setSize] = useState({ width: 0, height: 0 });
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
if (typeof window === "undefined")
|
|
7
|
-
return;
|
|
8
|
-
const update = () => setSize({ width: window.innerWidth, height: window.innerHeight });
|
|
9
|
-
update();
|
|
10
|
-
window.addEventListener("resize", update, { passive: true });
|
|
11
|
-
return () => window.removeEventListener("resize", update);
|
|
12
|
-
}, []);
|
|
13
|
-
return size;
|
|
14
|
-
};
|
package/dist/lib/combi-keys.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
export const osxRegex = /Mac|iPod|iPhone|iPad/;
|
|
2
|
-
export const isMac = () => osxRegex.test(navigator.userAgent);
|
|
3
|
-
const parseCombination = (combination) => combination.split("+").map((k) => {
|
|
4
|
-
const key = k.trim();
|
|
5
|
-
if (key === "Mod")
|
|
6
|
-
return isMac() ? "Meta" : "Control";
|
|
7
|
-
if (key === "Hyper")
|
|
8
|
-
return isMac() ? "Meta+Shift+Alt" : "Control+Shift+Alt";
|
|
9
|
-
return key;
|
|
10
|
-
});
|
|
11
|
-
const combine = (keys) => keys.map((x) => x.trim()).join("+");
|
|
12
|
-
export class CombiKeys {
|
|
13
|
-
combinations = [];
|
|
14
|
-
constructor(combi = []) {
|
|
15
|
-
this.combinations = this.combinations.concat(combi);
|
|
16
|
-
this.combinations.forEach((x) => {
|
|
17
|
-
this.add(x.key, x.fn);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
add(combi, fn) {
|
|
21
|
-
const key = combine(parseCombination(combi));
|
|
22
|
-
if (this.combinations.find((x) => x.key === key))
|
|
23
|
-
return;
|
|
24
|
-
this.combinations.push({ fn, key });
|
|
25
|
-
return this;
|
|
26
|
-
}
|
|
27
|
-
register() {
|
|
28
|
-
const controller = new AbortController();
|
|
29
|
-
const handler = (event) => {
|
|
30
|
-
const element = event.target;
|
|
31
|
-
if (element.tagName === "INPUT" || element.tagName === "TEXTAREA") {
|
|
32
|
-
const bypass = element.getAttribute("data-combikeysbypass");
|
|
33
|
-
if (bypass !== "true")
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const activeKeys = new Set();
|
|
37
|
-
if (event.metaKey)
|
|
38
|
-
activeKeys.add("Meta");
|
|
39
|
-
if (event.ctrlKey)
|
|
40
|
-
activeKeys.add("Control");
|
|
41
|
-
if (event.altKey)
|
|
42
|
-
activeKeys.add("Alt");
|
|
43
|
-
if (event.key.charCodeAt(0) > 127) {
|
|
44
|
-
const char = event.code.replace(/^Digit/, "").replace(/^Key/, "");
|
|
45
|
-
activeKeys.add(event.shiftKey ? char.toUpperCase() : char.toLowerCase());
|
|
46
|
-
}
|
|
47
|
-
else
|
|
48
|
-
activeKeys.add(event.shiftKey ? event.key.toUpperCase() : event.key);
|
|
49
|
-
const action = combine(Array.from(activeKeys));
|
|
50
|
-
this.combinations.forEach((bind) => {
|
|
51
|
-
if (bind.key === action) {
|
|
52
|
-
event.preventDefault();
|
|
53
|
-
return void bind.fn(event);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
window.addEventListener("keydown", handler, { signal: controller.signal });
|
|
58
|
-
return () => controller.abort();
|
|
59
|
-
}
|
|
60
|
-
}
|
package/dist/lib/dict.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export class Dict extends Map {
|
|
2
|
-
list = [];
|
|
3
|
-
constructor(init) {
|
|
4
|
-
super(init);
|
|
5
|
-
this.list = [];
|
|
6
|
-
if (Array.isArray(init))
|
|
7
|
-
this.list = init;
|
|
8
|
-
if (init instanceof Dict)
|
|
9
|
-
this.list = Array.from(init.entries());
|
|
10
|
-
}
|
|
11
|
-
set(key, value) {
|
|
12
|
-
super.set(key, value);
|
|
13
|
-
this.list = (this.list ?? []).concat([[key, value]]);
|
|
14
|
-
return this;
|
|
15
|
-
}
|
|
16
|
-
remove(key) {
|
|
17
|
-
super.delete(key);
|
|
18
|
-
this.list = Array.from(this.entries()) ?? [];
|
|
19
|
-
return this;
|
|
20
|
-
}
|
|
21
|
-
map(callback) {
|
|
22
|
-
return this.list.map((x, i) => callback(x[1], i));
|
|
23
|
-
}
|
|
24
|
-
clone(fn) {
|
|
25
|
-
const clone = new Dict(this);
|
|
26
|
-
if (fn)
|
|
27
|
-
return fn(clone);
|
|
28
|
-
return clone;
|
|
29
|
-
}
|
|
30
|
-
static from(items, selector) {
|
|
31
|
-
return new Dict(items.map((x) => [selector(x), x]));
|
|
32
|
-
}
|
|
33
|
-
static unique(items, selector) {
|
|
34
|
-
return Array.from(Dict.from(items, selector).values());
|
|
35
|
-
}
|
|
36
|
-
toArray() {
|
|
37
|
-
return Array.from(this.values());
|
|
38
|
-
}
|
|
39
|
-
}
|
package/dist/lib/dom.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { clsx } from "clsx";
|
|
2
|
-
import { Is } from "sidekicker";
|
|
3
|
-
import { twMerge } from "tailwind-merge";
|
|
4
|
-
export const mergeRefs = (...refs) => (value) => {
|
|
5
|
-
refs.forEach((ref) => {
|
|
6
|
-
if (typeof ref === "function") {
|
|
7
|
-
ref(value);
|
|
8
|
-
}
|
|
9
|
-
else if (ref !== null) {
|
|
10
|
-
ref.current = value;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
export const isReactComponent = (a) => {
|
|
15
|
-
if (a.$$typeof === Symbol.for("react.forward_ref")) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
if (a.$$typeof === Symbol.for("react.fragment")) {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
return a.$$typeof === Symbol.for("react.element");
|
|
22
|
-
};
|
|
23
|
-
export const isReactFC = (a) => Is.function(a);
|
|
24
|
-
export const css = (...styles) => twMerge(clsx(styles));
|
|
25
|
-
export const dispatchInput = (input) => {
|
|
26
|
-
const event = new Event("input", { bubbles: true, composed: true });
|
|
27
|
-
input?.dispatchEvent(event);
|
|
28
|
-
return Object.assign({}, event, { target: input, currentTarget: input });
|
|
29
|
-
};
|
|
30
|
-
export const initializeInputDataset = (input) => {
|
|
31
|
-
const focus = () => input.setAttribute("data-initialized", "true");
|
|
32
|
-
input.addEventListener("focus", focus);
|
|
33
|
-
return () => input.removeEventListener("focus", focus);
|
|
34
|
-
};
|
|
35
|
-
export const hasVerticalScroll = (htmlElement) => htmlElement.scrollHeight > htmlElement.clientHeight;
|
|
36
|
-
export const getRemainingSize = (element, windowSize) => {
|
|
37
|
-
const rect = element.getBoundingClientRect();
|
|
38
|
-
return Math.abs(windowSize - rect.bottom);
|
|
39
|
-
};
|
|
40
|
-
export const getCoords = (elem, docEl) => {
|
|
41
|
-
const box = elem.getBoundingClientRect();
|
|
42
|
-
const parent = docEl.getBoundingClientRect();
|
|
43
|
-
return { top: Math.round(box.top - parent.top), left: Math.round(box.left - parent.left) };
|
|
44
|
-
};
|
package/dist/lib/fns.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export const uuid = () => {
|
|
2
|
-
const timestamp = Date.now();
|
|
3
|
-
const bytes = new Uint8Array(16);
|
|
4
|
-
bytes[0] = (timestamp / Math.pow(2, 40)) & 0xff;
|
|
5
|
-
bytes[1] = (timestamp / Math.pow(2, 32)) & 0xff;
|
|
6
|
-
bytes[2] = (timestamp / Math.pow(2, 24)) & 0xff;
|
|
7
|
-
bytes[3] = (timestamp / Math.pow(2, 16)) & 0xff;
|
|
8
|
-
bytes[4] = (timestamp / Math.pow(2, 8)) & 0xff;
|
|
9
|
-
bytes[5] = timestamp & 0xff;
|
|
10
|
-
const randomBytes = new Uint8Array(10);
|
|
11
|
-
crypto.getRandomValues(randomBytes);
|
|
12
|
-
bytes.set(randomBytes, 6);
|
|
13
|
-
bytes[6] = (bytes[6] & 0x0f) | 0x70;
|
|
14
|
-
bytes[8] = (bytes[8] & 0x3f) | 0x80;
|
|
15
|
-
const hex = Array.from(bytes)
|
|
16
|
-
.map(b => b.toString(16).padStart(2, '0'))
|
|
17
|
-
.join('');
|
|
18
|
-
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
19
|
-
};
|
|
20
|
-
const travel = (path, regexp, obj) => path
|
|
21
|
-
.split(regexp)
|
|
22
|
-
.filter(Boolean)
|
|
23
|
-
.reduce((res, key) => (res !== null && res !== undefined ? res[key] : res), obj);
|
|
24
|
-
const regexPaths = { basic: /[,[\]]+?/, extend: /[,[\].]+?/ };
|
|
25
|
-
export const path = (obj, path) => {
|
|
26
|
-
const result = travel(path, regexPaths.basic, obj) || travel(path, regexPaths.extend, obj);
|
|
27
|
-
return result === undefined || result === obj ? undefined : result;
|
|
28
|
-
};
|
|
29
|
-
export const isSsr = () => typeof window === "undefined";
|
|
30
|
-
export const safeRegex = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
31
|
-
export const splitInto = (array, size) => {
|
|
32
|
-
const newArray = [];
|
|
33
|
-
for (let i = 0; i < size; i++) {
|
|
34
|
-
const init = i * size;
|
|
35
|
-
const result = array.slice(init, init + size);
|
|
36
|
-
if (result.length > 0)
|
|
37
|
-
newArray.push(result);
|
|
38
|
-
}
|
|
39
|
-
return newArray;
|
|
40
|
-
};
|
|
41
|
-
export const negate = (b) => !b;
|
|
42
|
-
export const noop = () => { };
|
|
43
|
-
export const isMobile = () => {
|
|
44
|
-
const userAgent = navigator.userAgent || navigator.vendor || window.opera;
|
|
45
|
-
return /android|iphone|ipad|ipod|opera mini|iemobile|wpdesktop/i.test(userAgent);
|
|
46
|
-
};
|
package/dist/lib/fzf.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { Is } from "sidekicker";
|
|
2
|
-
export const fuzzyMatch = (text, search) => {
|
|
3
|
-
text = String(text).toLocaleLowerCase();
|
|
4
|
-
search = String(search).toLocaleLowerCase();
|
|
5
|
-
const firstChar = search[0];
|
|
6
|
-
const firstCharIndexes = text
|
|
7
|
-
.split("")
|
|
8
|
-
.map((char, index) => (char === firstChar ? index : false))
|
|
9
|
-
.filter((index) => index !== false);
|
|
10
|
-
if (firstCharIndexes.length === 0) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
const matchedIndexes = [];
|
|
14
|
-
firstCharIndexes.forEach((startingIndex) => {
|
|
15
|
-
let index = startingIndex + 1;
|
|
16
|
-
const indexes = [startingIndex];
|
|
17
|
-
for (let i = 1; i < search.length; i++) {
|
|
18
|
-
const letter = search[i];
|
|
19
|
-
index = text.indexOf(letter, index);
|
|
20
|
-
if (index === -1) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
indexes.push(index);
|
|
24
|
-
index++;
|
|
25
|
-
}
|
|
26
|
-
matchedIndexes.push(indexes);
|
|
27
|
-
});
|
|
28
|
-
if (matchedIndexes.length === 0) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
const bestMatch = matchedIndexes.sort((a, b) => {
|
|
32
|
-
if (a.length === 1) {
|
|
33
|
-
return a[0] - b[0];
|
|
34
|
-
}
|
|
35
|
-
const aSpread = a[a.length - 1] - a[0];
|
|
36
|
-
const bSpread = b[b.length - 1] - b[0];
|
|
37
|
-
return aSpread - bSpread;
|
|
38
|
-
})[0];
|
|
39
|
-
if (text === search) {
|
|
40
|
-
return 1;
|
|
41
|
-
}
|
|
42
|
-
else if (bestMatch.length > 1) {
|
|
43
|
-
return 2 + (bestMatch[bestMatch.length - 1] - bestMatch[0]);
|
|
44
|
-
}
|
|
45
|
-
return 2 + bestMatch[0];
|
|
46
|
-
};
|
|
47
|
-
const travel = (path, regexp, obj) => {
|
|
48
|
-
const keys = path.split(regexp).filter(Boolean);
|
|
49
|
-
let res = obj;
|
|
50
|
-
for (const key of keys) {
|
|
51
|
-
if (res === null || res === undefined) {
|
|
52
|
-
return res;
|
|
53
|
-
}
|
|
54
|
-
res = res[key];
|
|
55
|
-
}
|
|
56
|
-
return res;
|
|
57
|
-
};
|
|
58
|
-
const regexPaths = { basic: /[,[\]]+?/, extend: /[,[\].]+?/ };
|
|
59
|
-
const path = (obj, path) => {
|
|
60
|
-
const result = travel(path, regexPaths.basic, obj);
|
|
61
|
-
if (result !== undefined && result !== obj)
|
|
62
|
-
return result;
|
|
63
|
-
return travel(path, regexPaths.extend, obj);
|
|
64
|
-
};
|
|
65
|
-
const onlyNumbers = (str) => str.replace(/[^0-9]/g, "");
|
|
66
|
-
const diacritics = (input) => input.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
|
67
|
-
const strCompare = (text, value, _, match = "FUZZY") => {
|
|
68
|
-
if (match === "CONTAINS") {
|
|
69
|
-
return text.includes(value);
|
|
70
|
-
}
|
|
71
|
-
if (match === "EQUAL") {
|
|
72
|
-
return text === value;
|
|
73
|
-
}
|
|
74
|
-
if (match === "CONTAINS_NUMBERS") {
|
|
75
|
-
return onlyNumbers(text).includes(onlyNumbers(value));
|
|
76
|
-
}
|
|
77
|
-
if (match === "STARTS_WITH") {
|
|
78
|
-
return text.startsWith(value);
|
|
79
|
-
}
|
|
80
|
-
if (match === "ENDS_WITH") {
|
|
81
|
-
return text.endsWith(value);
|
|
82
|
-
}
|
|
83
|
-
if (match === "FUZZY") {
|
|
84
|
-
const r = fuzzyMatch(text, value);
|
|
85
|
-
return r !== null;
|
|
86
|
-
}
|
|
87
|
-
return false;
|
|
88
|
-
};
|
|
89
|
-
const compare = (search, value, defaultScore, match = "FUZZY") => Array.isArray(value) ? value.some((x) => strCompare(search, x, defaultScore, match)) : strCompare(search, value, defaultScore, match);
|
|
90
|
-
export const fzf = (items, id, keys) => {
|
|
91
|
-
if (keys.length === 0) {
|
|
92
|
-
return items;
|
|
93
|
-
}
|
|
94
|
-
const map = new Map();
|
|
95
|
-
const remap = keys.map((x) => {
|
|
96
|
-
return { ...x, value: Is.array(x.value) ? x.value.map(diacritics) : diacritics(`${x.value}`) };
|
|
97
|
-
});
|
|
98
|
-
items.forEach((item) => {
|
|
99
|
-
const idVal = path(item, id);
|
|
100
|
-
remap.forEach((filter) => {
|
|
101
|
-
const searchValue = path(item, filter.key);
|
|
102
|
-
if (!searchValue)
|
|
103
|
-
return;
|
|
104
|
-
const target = diacritics(`${filter.value}`.toLocaleLowerCase()).trim();
|
|
105
|
-
const search = diacritics(`${searchValue}`.toLocaleLowerCase()).trim();
|
|
106
|
-
if (compare(search, target, filter.score, filter.match)) {
|
|
107
|
-
return void map.set(idVal, item);
|
|
108
|
-
}
|
|
109
|
-
if (Is.function(filter.ifNotMatch)) {
|
|
110
|
-
const result = filter.ifNotMatch(target, search);
|
|
111
|
-
if (result)
|
|
112
|
-
map.set(idVal, item);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
return Array.from(map.values());
|
|
117
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export const keyboardKeys = {
|
|
2
|
-
ArrowUp: "ArrowUp",
|
|
3
|
-
ArrowDown: "ArrowDown",
|
|
4
|
-
ArrowLeft: "ArrowLeft",
|
|
5
|
-
ArrowRight: "ArrowRight",
|
|
6
|
-
};
|
|
7
|
-
export class KeyboardArea {
|
|
8
|
-
set = new Set();
|
|
9
|
-
key(key, callback) {
|
|
10
|
-
const fn = (e) => (e.key === key ? callback(e) : undefined);
|
|
11
|
-
return () => this.set.delete(fn);
|
|
12
|
-
}
|
|
13
|
-
onKeyDown(_) { }
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tailwindcssv4.d.ts","sourceRoot":"","sources":["../../tailwindcssv4.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,MAAM,EAAE,GAmDb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
import forms from "@tailwindcss/forms";
|
|
17
|
-
import plugin from "tailwindcss/plugin";
|
|
18
|
-
import { createDesignTokens, parsers } from "./src/styles/design-tokens";
|
|
19
|
-
import { defaultLightTheme as theme } from "./src/styles/theme";
|
|
20
|
-
var COLORS = createDesignTokens(theme.colors, parsers.formatWithVar("hsla"));
|
|
21
|
-
var spacing = createDesignTokens(theme.spacing, parsers.cssVariable);
|
|
22
|
-
var shadows = createDesignTokens(theme.shadow, parsers.cssVariable);
|
|
23
|
-
var css = String.raw;
|
|
24
|
-
var config = plugin(function (_a) {
|
|
25
|
-
var addVariant = _a.addVariant;
|
|
26
|
-
addVariant("hocus", ["&:hover", "&:focus"]);
|
|
27
|
-
addVariant("link", ["&:hover", "&:active"]);
|
|
28
|
-
addVariant("group-assert", [
|
|
29
|
-
css(templateObject_1 || (templateObject_1 = __makeTemplateObject([":merge(.group):valid:has(.input:valid:not(:placeholder-shown)) &"], [":merge(.group):valid:has(.input:valid:not(:placeholder-shown)) &"]))),
|
|
30
|
-
]);
|
|
31
|
-
addVariant("group-checkbox-checked", [
|
|
32
|
-
css(templateObject_2 || (templateObject_2 = __makeTemplateObject([":merge(&:has(.form-checkbox[type=\"checkbox\"]:checked))"], [":merge(&:has(.form-checkbox[type=\"checkbox\"]:checked))"]))),
|
|
33
|
-
]);
|
|
34
|
-
addVariant("group-error", [
|
|
35
|
-
css(templateObject_3 || (templateObject_3 = __makeTemplateObject([":merge(.group):invalid:has(.input:not(:focus):invalid[data-initialized=true]) &"], [":merge(.group):invalid:has(.input:not(:focus):invalid[data-initialized=true]) &"]))),
|
|
36
|
-
css(templateObject_4 || (templateObject_4 = __makeTemplateObject([":merge(.group[data-error=true]:has(.input[data-initialized=true])) &"], [":merge(.group[data-error=true]:has(.input[data-initialized=true])) &"]))),
|
|
37
|
-
css(templateObject_5 || (templateObject_5 = __makeTemplateObject([":merge(.group[data-error=true][data-interactive=true]):has(.input) &"], [":merge(.group[data-error=true][data-interactive=true]):has(.input) &"]))),
|
|
38
|
-
css(templateObject_6 || (templateObject_6 = __makeTemplateObject([":merge(.group[data-error=true][data-interactive=true]):has(.input[data-initialized=true]) &"], [":merge(.group[data-error=true][data-interactive=true]):has(.input[data-initialized=true]) &"]))),
|
|
39
|
-
]);
|
|
40
|
-
}, {
|
|
41
|
-
plugins: [forms({ strategy: "class" })],
|
|
42
|
-
theme: {
|
|
43
|
-
extend: {
|
|
44
|
-
transitionTimingFunction: {
|
|
45
|
-
DEFAULT: "cubic-bezier(0,0,.58,1)",
|
|
46
|
-
normal: "cubic-bezier(.25,.1,.25,1)",
|
|
47
|
-
},
|
|
48
|
-
spacing: spacing,
|
|
49
|
-
fill: COLORS,
|
|
50
|
-
colors: COLORS,
|
|
51
|
-
width: spacing,
|
|
52
|
-
fontSize: spacing,
|
|
53
|
-
boxShadow: shadows,
|
|
54
|
-
dropShadow: shadows,
|
|
55
|
-
lineHeight: { typography: "1.45" },
|
|
56
|
-
letterSpacing: { typography: "0.0175" },
|
|
57
|
-
placeholderColor: COLORS,
|
|
58
|
-
transitionDuration: { DEFAULT: "375ms" },
|
|
59
|
-
minWidth: { xs: "20rem", screen: "100vh" },
|
|
60
|
-
borderColor: __assign(__assign({}, COLORS), { DEFAULT: COLORS.card.border }),
|
|
61
|
-
borderRadius: createDesignTokens(theme.rounded, parsers.cssVariable),
|
|
62
|
-
zIndex: {
|
|
63
|
-
wizard: "var(--z-wizard)",
|
|
64
|
-
navbar: "var(--z-navbar)",
|
|
65
|
-
normal: "var(--z-normal)",
|
|
66
|
-
overlay: "var(--z-overlay)",
|
|
67
|
-
tooltip: "var(--z-tooltip)",
|
|
68
|
-
calendar: "var(--z-calendar)",
|
|
69
|
-
floating: "var(--z-floating)",
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
export default config;
|
|
75
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
package/dist/styles/common.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export const rounded = {
|
|
2
|
-
button: "0.55rem",
|
|
3
|
-
pill: "2rem",
|
|
4
|
-
card: "0.75rem",
|
|
5
|
-
full: "9999px",
|
|
6
|
-
};
|
|
7
|
-
export const spacing = {
|
|
8
|
-
base: "1rem",
|
|
9
|
-
hairline: "0.0625rem",
|
|
10
|
-
lg: "1.125rem",
|
|
11
|
-
sm: "0.75rem",
|
|
12
|
-
"field-height": "1.5rem",
|
|
13
|
-
"field-label": "0.875rem",
|
|
14
|
-
"input-height": "2.5rem",
|
|
15
|
-
"input-x": "0.5rem",
|
|
16
|
-
"input-y": "0.25rem",
|
|
17
|
-
"input-inline": "0.25rem",
|
|
18
|
-
"input-gap": "0.3rem",
|
|
19
|
-
};
|
|
20
|
-
export const zIndex = {
|
|
21
|
-
wizard: "50",
|
|
22
|
-
normal: "1",
|
|
23
|
-
navbar: "22",
|
|
24
|
-
calendar: "2",
|
|
25
|
-
overlay: "21",
|
|
26
|
-
tooltip: "20",
|
|
27
|
-
floating: "22",
|
|
28
|
-
};
|