@gigo-ui/components 1.0.0-alpha
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/README.md +49 -0
- package/dist/assets/favicon.svg +1 -0
- package/dist/components/chaos/CatchSubmit.svelte +144 -0
- package/dist/components/chaos/CatchSubmit.svelte.d.ts +11 -0
- package/dist/components/chaos/ChaosButton.svelte +132 -0
- package/dist/components/chaos/ChaosButton.svelte.d.ts +4 -0
- package/dist/components/chaos/ChaosForm.svelte +206 -0
- package/dist/components/chaos/ChaosForm.svelte.d.ts +10 -0
- package/dist/components/chaos/ColorPickerWrong.svelte +141 -0
- package/dist/components/chaos/ColorPickerWrong.svelte.d.ts +11 -0
- package/dist/components/chaos/DropdownCalc.svelte +195 -0
- package/dist/components/chaos/DropdownCalc.svelte.d.ts +8 -0
- package/dist/components/chaos/GhostCard.svelte +157 -0
- package/dist/components/chaos/GhostCard.svelte.d.ts +13 -0
- package/dist/components/chaos/GravityInput.svelte +161 -0
- package/dist/components/chaos/GravityInput.svelte.d.ts +13 -0
- package/dist/components/chaos/PasswordPeekhole.svelte +141 -0
- package/dist/components/chaos/PasswordPeekhole.svelte.d.ts +11 -0
- package/dist/components/chaos/ProgressDoom.svelte +139 -0
- package/dist/components/chaos/ProgressDoom.svelte.d.ts +12 -0
- package/dist/components/chaos/RotaryDial.svelte +221 -0
- package/dist/components/chaos/RotaryDial.svelte.d.ts +10 -0
- package/dist/components/chaos/SliderPhone.svelte +92 -0
- package/dist/components/chaos/SliderPhone.svelte.d.ts +10 -0
- package/dist/components/chaos/TermsSidescroll.svelte +121 -0
- package/dist/components/chaos/TermsSidescroll.svelte.d.ts +12 -0
- package/dist/components/chaos/VolumeSlider.svelte +116 -0
- package/dist/components/chaos/VolumeSlider.svelte.d.ts +14 -0
- package/dist/components/ui/Button.svelte +162 -0
- package/dist/components/ui/Button.svelte.d.ts +4 -0
- package/dist/components/ui/Card.svelte +141 -0
- package/dist/components/ui/Card.svelte.d.ts +4 -0
- package/dist/components/ui/Carousel.svelte +164 -0
- package/dist/components/ui/Carousel.svelte.d.ts +4 -0
- package/dist/components/ui/Form.svelte +178 -0
- package/dist/components/ui/Form.svelte.d.ts +4 -0
- package/dist/components/ui/Input.svelte +135 -0
- package/dist/components/ui/Input.svelte.d.ts +4 -0
- package/dist/components/ui/Modal.svelte +173 -0
- package/dist/components/ui/Modal.svelte.d.ts +4 -0
- package/dist/components/ui/Navigation.svelte +91 -0
- package/dist/components/ui/Navigation.svelte.d.ts +4 -0
- package/dist/docs/categories.d.ts +13 -0
- package/dist/docs/categories.js +17 -0
- package/dist/docs/component-data.d.ts +6 -0
- package/dist/docs/component-data.js +49 -0
- package/dist/docs/components/badui/catch-submit.d.ts +2 -0
- package/dist/docs/components/badui/catch-submit.js +49 -0
- package/dist/docs/components/badui/color-picker-wrong.d.ts +2 -0
- package/dist/docs/components/badui/color-picker-wrong.js +40 -0
- package/dist/docs/components/badui/dropdown-calc.d.ts +2 -0
- package/dist/docs/components/badui/dropdown-calc.js +28 -0
- package/dist/docs/components/badui/ghost-card.d.ts +2 -0
- package/dist/docs/components/badui/ghost-card.js +54 -0
- package/dist/docs/components/badui/gravity-input.d.ts +2 -0
- package/dist/docs/components/badui/gravity-input.js +64 -0
- package/dist/docs/components/badui/password-peekhole.d.ts +2 -0
- package/dist/docs/components/badui/password-peekhole.js +51 -0
- package/dist/docs/components/badui/progress-doom.d.ts +2 -0
- package/dist/docs/components/badui/progress-doom.js +48 -0
- package/dist/docs/components/badui/rotary-dial.d.ts +2 -0
- package/dist/docs/components/badui/rotary-dial.js +40 -0
- package/dist/docs/components/badui/slider-phone.d.ts +2 -0
- package/dist/docs/components/badui/slider-phone.js +40 -0
- package/dist/docs/components/badui/terms-sidescroll.d.ts +2 -0
- package/dist/docs/components/badui/terms-sidescroll.js +46 -0
- package/dist/docs/components/badui/volume-slider.d.ts +2 -0
- package/dist/docs/components/badui/volume-slider.js +52 -0
- package/dist/docs/components/chaos/chaos-button.d.ts +2 -0
- package/dist/docs/components/chaos/chaos-button.js +48 -0
- package/dist/docs/components/chaos/chaos-form.d.ts +2 -0
- package/dist/docs/components/chaos/chaos-form.js +68 -0
- package/dist/docs/components/standard/button.d.ts +2 -0
- package/dist/docs/components/standard/button.js +66 -0
- package/dist/docs/components/standard/card.d.ts +2 -0
- package/dist/docs/components/standard/card.js +55 -0
- package/dist/docs/components/standard/carousel.d.ts +2 -0
- package/dist/docs/components/standard/carousel.js +63 -0
- package/dist/docs/components/standard/form.d.ts +2 -0
- package/dist/docs/components/standard/form.js +57 -0
- package/dist/docs/components/standard/input.d.ts +2 -0
- package/dist/docs/components/standard/input.js +65 -0
- package/dist/docs/components/standard/modal.d.ts +2 -0
- package/dist/docs/components/standard/modal.js +63 -0
- package/dist/docs/components/standard/navigation.d.ts +2 -0
- package/dist/docs/components/standard/navigation.js +51 -0
- package/dist/docs/types.d.ts +16 -0
- package/dist/docs/types.js +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +21 -0
- package/dist/styles/globals.css +569 -0
- package/dist/types/index.d.ts +177 -0
- package/dist/types/index.js +1 -0
- package/dist/utils/cn.d.ts +9 -0
- package/dist/utils/cn.js +90 -0
- package/package.json +61 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, chaosClasses, chaosRandom, chaosPickOne } from '../../utils/cn.js';
|
|
3
|
+
import type { GigoNavProps, NavItem } from '../../types/index.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
items = [],
|
|
7
|
+
chaos = false,
|
|
8
|
+
chaosLevel = 5,
|
|
9
|
+
educational = false,
|
|
10
|
+
a11yWarning = false,
|
|
11
|
+
wrongDestinations = false,
|
|
12
|
+
randomReorder = false,
|
|
13
|
+
fakeLoading = false,
|
|
14
|
+
class: className,
|
|
15
|
+
...restProps
|
|
16
|
+
}: GigoNavProps = $props();
|
|
17
|
+
|
|
18
|
+
let displayItems = $state<NavItem[]>([]);
|
|
19
|
+
let loadingItem = $state<string | null>(null);
|
|
20
|
+
|
|
21
|
+
// Random reorder
|
|
22
|
+
$effect(() => {
|
|
23
|
+
displayItems = [...items];
|
|
24
|
+
if (!chaos || !randomReorder) return;
|
|
25
|
+
const timer = setInterval(() => {
|
|
26
|
+
displayItems = [...displayItems].sort(() => Math.random() - 0.5);
|
|
27
|
+
}, 3000);
|
|
28
|
+
return () => clearInterval(timer);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
function getHref(item: NavItem): string {
|
|
32
|
+
if (chaos && wrongDestinations) {
|
|
33
|
+
const otherItems = items.filter((i) => i.id !== item.id);
|
|
34
|
+
return otherItems.length > 0 ? chaosPickOne(otherItems).href : item.href;
|
|
35
|
+
}
|
|
36
|
+
return item.href;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function handleClick(item: NavItem, e: MouseEvent) {
|
|
40
|
+
if (chaos && fakeLoading) {
|
|
41
|
+
e.preventDefault();
|
|
42
|
+
loadingItem = item.id;
|
|
43
|
+
setTimeout(() => {
|
|
44
|
+
loadingItem = null;
|
|
45
|
+
// Actually navigate after fake delay
|
|
46
|
+
const href = getHref(item);
|
|
47
|
+
window.location.href = href;
|
|
48
|
+
}, 1500 + chaosRandom(2000));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let navClass = $derived(
|
|
53
|
+
cn(
|
|
54
|
+
'flex items-center gap-1 rounded-xl border border-(--border) bg-(--surface-1)/80 backdrop-blur-md p-2',
|
|
55
|
+
chaos && chaosClasses(chaosLevel),
|
|
56
|
+
className
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<nav class={navClass} {...restProps}>
|
|
62
|
+
{#each displayItems as item (item.id)}
|
|
63
|
+
<a
|
|
64
|
+
href={getHref(item)}
|
|
65
|
+
class={cn(
|
|
66
|
+
'group/link relative inline-flex items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium text-(--muted-foreground) transition-all duration-200 hover:text-(--foreground) hover:bg-(--surface-2)',
|
|
67
|
+
loadingItem === item.id && 'pointer-events-none opacity-40'
|
|
68
|
+
)}
|
|
69
|
+
onclick={(e) => handleClick(item, e)}
|
|
70
|
+
>
|
|
71
|
+
{#if item.icon}
|
|
72
|
+
<span class="text-base transition-transform duration-200 group-hover/link:scale-110">{item.icon}</span>
|
|
73
|
+
{/if}
|
|
74
|
+
{item.label}
|
|
75
|
+
{#if loadingItem === item.id}
|
|
76
|
+
<svg class="ml-1 h-3 w-3 animate-spin" viewBox="0 0 24 24" fill="none">
|
|
77
|
+
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"/>
|
|
78
|
+
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"/>
|
|
79
|
+
</svg>
|
|
80
|
+
{/if}
|
|
81
|
+
<!-- Hover underline -->
|
|
82
|
+
<span class="absolute bottom-1 left-3 right-3 h-px bg-linear-to-r from-gigo-magenta to-gigo-cyan scale-x-0 transition-transform duration-200 group-hover/link:scale-x-100 origin-left"></span>
|
|
83
|
+
</a>
|
|
84
|
+
{/each}
|
|
85
|
+
|
|
86
|
+
{#if educational && chaos}
|
|
87
|
+
<span class="ml-auto text-xs text-(--muted-foreground) italic font-mono px-2">
|
|
88
|
+
links may lie
|
|
89
|
+
</span>
|
|
90
|
+
{/if}
|
|
91
|
+
</nav>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const categories: readonly [{
|
|
2
|
+
readonly id: "badui";
|
|
3
|
+
readonly label: "BadUI Collection";
|
|
4
|
+
readonly description: "Components that technically work, but make you wish they didn't.";
|
|
5
|
+
}, {
|
|
6
|
+
readonly id: "chaos";
|
|
7
|
+
readonly label: "Classic Chaos";
|
|
8
|
+
readonly description: "Standard UI elements that misbehave when chaos mode is on.";
|
|
9
|
+
}, {
|
|
10
|
+
readonly id: "standard";
|
|
11
|
+
readonly label: "Standard UI";
|
|
12
|
+
readonly description: "Well-built base components with optional chaos toggles.";
|
|
13
|
+
}];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const categories = [
|
|
2
|
+
{
|
|
3
|
+
id: "badui",
|
|
4
|
+
label: "BadUI Collection",
|
|
5
|
+
description: "Components that technically work, but make you wish they didn't.",
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
id: "chaos",
|
|
9
|
+
label: "Classic Chaos",
|
|
10
|
+
description: "Standard UI elements that misbehave when chaos mode is on.",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: "standard",
|
|
14
|
+
label: "Standard UI",
|
|
15
|
+
description: "Well-built base components with optional chaos toggles.",
|
|
16
|
+
},
|
|
17
|
+
];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { PropDoc, ComponentDoc } from "./types.js";
|
|
2
|
+
export { categories } from "./categories.js";
|
|
3
|
+
import type { ComponentDoc } from "./types.js";
|
|
4
|
+
export declare const componentDocs: ComponentDoc[];
|
|
5
|
+
export declare function getComponentsByCategory(category: ComponentDoc["category"]): ComponentDoc[];
|
|
6
|
+
export declare function getComponentBySlug(slug: string): ComponentDoc | undefined;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export { categories } from "./categories.js";
|
|
2
|
+
import { ghostCard } from "./components/badui/ghost-card.js";
|
|
3
|
+
import { gravityInput } from "./components/badui/gravity-input.js";
|
|
4
|
+
import { rotaryDial } from "./components/badui/rotary-dial.js";
|
|
5
|
+
import { sliderPhone } from "./components/badui/slider-phone.js";
|
|
6
|
+
import { catchSubmit } from "./components/badui/catch-submit.js";
|
|
7
|
+
import { dropdownCalc } from "./components/badui/dropdown-calc.js";
|
|
8
|
+
import { passwordPeekhole } from "./components/badui/password-peekhole.js";
|
|
9
|
+
import { volumeSlider } from "./components/badui/volume-slider.js";
|
|
10
|
+
import { progressDoom } from "./components/badui/progress-doom.js";
|
|
11
|
+
import { colorPickerWrong } from "./components/badui/color-picker-wrong.js";
|
|
12
|
+
import { termsSidescroll } from "./components/badui/terms-sidescroll.js";
|
|
13
|
+
import { chaosButton } from "./components/chaos/chaos-button.js";
|
|
14
|
+
import { chaosForm } from "./components/chaos/chaos-form.js";
|
|
15
|
+
import { button } from "./components/standard/button.js";
|
|
16
|
+
import { input } from "./components/standard/input.js";
|
|
17
|
+
import { modal } from "./components/standard/modal.js";
|
|
18
|
+
import { card } from "./components/standard/card.js";
|
|
19
|
+
import { carousel } from "./components/standard/carousel.js";
|
|
20
|
+
import { form } from "./components/standard/form.js";
|
|
21
|
+
import { navigation } from "./components/standard/navigation.js";
|
|
22
|
+
export const componentDocs = [
|
|
23
|
+
ghostCard,
|
|
24
|
+
gravityInput,
|
|
25
|
+
rotaryDial,
|
|
26
|
+
sliderPhone,
|
|
27
|
+
catchSubmit,
|
|
28
|
+
dropdownCalc,
|
|
29
|
+
passwordPeekhole,
|
|
30
|
+
volumeSlider,
|
|
31
|
+
progressDoom,
|
|
32
|
+
colorPickerWrong,
|
|
33
|
+
termsSidescroll,
|
|
34
|
+
chaosButton,
|
|
35
|
+
chaosForm,
|
|
36
|
+
button,
|
|
37
|
+
input,
|
|
38
|
+
modal,
|
|
39
|
+
card,
|
|
40
|
+
carousel,
|
|
41
|
+
form,
|
|
42
|
+
navigation,
|
|
43
|
+
];
|
|
44
|
+
export function getComponentsByCategory(category) {
|
|
45
|
+
return componentDocs.filter((c) => c.category === category);
|
|
46
|
+
}
|
|
47
|
+
export function getComponentBySlug(slug) {
|
|
48
|
+
return componentDocs.find((c) => c.slug === slug);
|
|
49
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export const catchSubmit = {
|
|
2
|
+
name: "Catch Submit",
|
|
3
|
+
slug: "catch-submit",
|
|
4
|
+
emoji: "🏃",
|
|
5
|
+
category: "badui",
|
|
6
|
+
tagline: "The submit button runs away from your cursor",
|
|
7
|
+
description: "A submit button that teleports to a random position whenever the cursor enters it. Tracks escape count, shows trail dots, displays taunting messages, and reveals a hint after 5+ escapes.",
|
|
8
|
+
usage: `<script lang="ts">
|
|
9
|
+
import { CatchSubmit } from '@gigo-ui/components';
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<CatchSubmit
|
|
13
|
+
label="Submit Form"
|
|
14
|
+
arenaHeight={300}
|
|
15
|
+
onsubmit={() => alert('You caught it!')}
|
|
16
|
+
/>`,
|
|
17
|
+
props: [
|
|
18
|
+
{
|
|
19
|
+
name: "label",
|
|
20
|
+
type: "string",
|
|
21
|
+
default: "'Submit'",
|
|
22
|
+
description: "Button label text",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "onsubmit",
|
|
26
|
+
type: "() => void",
|
|
27
|
+
default: "undefined",
|
|
28
|
+
description: "Callback when button is finally clicked",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "arenaHeight",
|
|
32
|
+
type: "number",
|
|
33
|
+
default: "256",
|
|
34
|
+
description: "Height of the escape arena in pixels",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "tauntsArray",
|
|
38
|
+
type: "string[]",
|
|
39
|
+
default: "[...defaults]",
|
|
40
|
+
description: "Array of taunting messages shown during escapes",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "class",
|
|
44
|
+
type: "string",
|
|
45
|
+
default: "''",
|
|
46
|
+
description: "Additional CSS classes",
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export const colorPickerWrong = {
|
|
2
|
+
name: "Color Picker Wrong",
|
|
3
|
+
slug: "color-picker-wrong",
|
|
4
|
+
emoji: "🎨",
|
|
5
|
+
category: "badui",
|
|
6
|
+
tagline: "Pick a color, get the wrong one",
|
|
7
|
+
description: "A color picker that channel-swaps and hue-shifts every color you select. You pick red, you get teal. You pick blue, you get orange. Includes delayed updates and lying color names.",
|
|
8
|
+
usage: `<script lang="ts">
|
|
9
|
+
import { ColorPickerWrong } from '@gigo-ui/components';
|
|
10
|
+
let color = $state('#e040fb');
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<ColorPickerWrong bind:value={color} />`,
|
|
14
|
+
props: [
|
|
15
|
+
{
|
|
16
|
+
name: "value",
|
|
17
|
+
type: "string",
|
|
18
|
+
default: "'#e040fb'",
|
|
19
|
+
description: "Output color hex (bindable, always wrong)",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "offsetHue",
|
|
23
|
+
type: "boolean",
|
|
24
|
+
default: "true",
|
|
25
|
+
description: "Shift hue channels",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "swapChannels",
|
|
29
|
+
type: "boolean",
|
|
30
|
+
default: "true",
|
|
31
|
+
description: "Swap RGB channels",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "delayUpdate",
|
|
35
|
+
type: "boolean",
|
|
36
|
+
default: "true",
|
|
37
|
+
description: "Delay color update randomly",
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const dropdownCalc = {
|
|
2
|
+
name: "Dropdown Calculator",
|
|
3
|
+
slug: "dropdown-calc",
|
|
4
|
+
emoji: "🔢",
|
|
5
|
+
category: "badui",
|
|
6
|
+
tagline: "Every digit selected via dropdown menus",
|
|
7
|
+
description: "A calculator where every digit of both operands and the operator must be selected from individual dropdown menus. Supports +, -, ×, ÷ with proper division-by-zero handling.",
|
|
8
|
+
usage: `<script lang="ts">
|
|
9
|
+
import { DropdownCalc } from '@gigo-ui/components';
|
|
10
|
+
let value = $state('');
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<DropdownCalc bind:value />`,
|
|
14
|
+
props: [
|
|
15
|
+
{
|
|
16
|
+
name: "value",
|
|
17
|
+
type: "string",
|
|
18
|
+
default: "''",
|
|
19
|
+
description: "Current calculation result (bindable)",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "class",
|
|
23
|
+
type: "string",
|
|
24
|
+
default: "''",
|
|
25
|
+
description: "Additional CSS classes",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export const ghostCard = {
|
|
2
|
+
name: "Ghost Card",
|
|
3
|
+
slug: "ghost-card",
|
|
4
|
+
emoji: "👻",
|
|
5
|
+
category: "badui",
|
|
6
|
+
tagline: "A card that randomly vanishes and reappears broken",
|
|
7
|
+
description: "Displays content in a card that periodically disappears, then reappears in a glitched state — mirrored, sliced via clip-path, hue-rotated, or offset. Simulates unreliable rendering with visual corruption effects.",
|
|
8
|
+
usage: `<script lang="ts">
|
|
9
|
+
import { GhostCard } from '@gigo-ui/components';
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<GhostCard
|
|
13
|
+
title="Important Info"
|
|
14
|
+
description="This content may vanish at any moment."
|
|
15
|
+
/>`,
|
|
16
|
+
props: [
|
|
17
|
+
{
|
|
18
|
+
name: "title",
|
|
19
|
+
type: "string",
|
|
20
|
+
default: "'Ghost Card'",
|
|
21
|
+
description: "Card heading text",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "description",
|
|
25
|
+
type: "string",
|
|
26
|
+
default: "''",
|
|
27
|
+
description: "Card body text",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "class",
|
|
31
|
+
type: "string",
|
|
32
|
+
default: "''",
|
|
33
|
+
description: "Additional CSS classes",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "disappearMinMs",
|
|
37
|
+
type: "number",
|
|
38
|
+
default: "2000",
|
|
39
|
+
description: "Minimum time before disappearing (ms)",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "disappearMaxMs",
|
|
43
|
+
type: "number",
|
|
44
|
+
default: "5000",
|
|
45
|
+
description: "Maximum time before disappearing (ms)",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "glitchChance",
|
|
49
|
+
type: "number",
|
|
50
|
+
default: "0.6",
|
|
51
|
+
description: "Probability of glitch on reappear (0-1)",
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export const gravityInput = {
|
|
2
|
+
name: "Gravity Input",
|
|
3
|
+
slug: "gravity-input",
|
|
4
|
+
emoji: "🪂",
|
|
5
|
+
category: "badui",
|
|
6
|
+
tagline: "Catch falling characters to type",
|
|
7
|
+
description: "Characters fall from the top of a drop zone with simulated gravity. Click a character before it falls off screen to append it to the input value. Features real physics simulation with requestAnimationFrame.",
|
|
8
|
+
usage: `<script lang="ts">
|
|
9
|
+
import { GravityInput } from '@gigo-ui/components';
|
|
10
|
+
let value = $state('');
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<GravityInput
|
|
14
|
+
bind:value
|
|
15
|
+
placeholder="Catch characters to type..."
|
|
16
|
+
spawnInterval={300}
|
|
17
|
+
maxFalling={20}
|
|
18
|
+
arenaHeight={280}
|
|
19
|
+
/>`,
|
|
20
|
+
props: [
|
|
21
|
+
{
|
|
22
|
+
name: "value",
|
|
23
|
+
type: "string",
|
|
24
|
+
default: "''",
|
|
25
|
+
description: "Current input value (bindable)",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "placeholder",
|
|
29
|
+
type: "string",
|
|
30
|
+
default: "''",
|
|
31
|
+
description: "Placeholder text when empty",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "spawnInterval",
|
|
35
|
+
type: "number",
|
|
36
|
+
default: "400",
|
|
37
|
+
description: "Milliseconds between character spawns",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "maxFalling",
|
|
41
|
+
type: "number",
|
|
42
|
+
default: "15",
|
|
43
|
+
description: "Maximum simultaneous falling characters",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "characters",
|
|
47
|
+
type: "string",
|
|
48
|
+
default: "'0-9a-zA-Z@.!?#$%'",
|
|
49
|
+
description: "Character pool for falling glyphs",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "arenaHeight",
|
|
53
|
+
type: "number",
|
|
54
|
+
default: "224",
|
|
55
|
+
description: "Height of the drop zone in pixels",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "class",
|
|
59
|
+
type: "string",
|
|
60
|
+
default: "''",
|
|
61
|
+
description: "Additional CSS classes",
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export const passwordPeekhole = {
|
|
2
|
+
name: "Password Peekhole",
|
|
3
|
+
slug: "password-peekhole",
|
|
4
|
+
emoji: "🔒",
|
|
5
|
+
category: "badui",
|
|
6
|
+
tagline: "See your password through a draggable peephole",
|
|
7
|
+
description: "A password input completely hidden behind an opaque overlay. A tiny circular peephole can be dragged around to reveal portions of the text. Uses CSS clip-path for the reveal effect.",
|
|
8
|
+
usage: `<script lang="ts">
|
|
9
|
+
import { PasswordPeekhole } from '@gigo-ui/components';
|
|
10
|
+
let password = $state('');
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<PasswordPeekhole
|
|
14
|
+
bind:value={password}
|
|
15
|
+
placeholder="Enter your secret..."
|
|
16
|
+
holeSize={50}
|
|
17
|
+
accentColor="#18ffff"
|
|
18
|
+
/>`,
|
|
19
|
+
props: [
|
|
20
|
+
{
|
|
21
|
+
name: "value",
|
|
22
|
+
type: "string",
|
|
23
|
+
default: "''",
|
|
24
|
+
description: "Current password value (bindable)",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "placeholder",
|
|
28
|
+
type: "string",
|
|
29
|
+
default: "''",
|
|
30
|
+
description: "Placeholder text",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "holeSize",
|
|
34
|
+
type: "number",
|
|
35
|
+
default: "40",
|
|
36
|
+
description: "Radius of the draggable peephole in pixels",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "accentColor",
|
|
40
|
+
type: "string",
|
|
41
|
+
default: "'#e040fb'",
|
|
42
|
+
description: "Accent color for the peephole handle and indicators",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "class",
|
|
46
|
+
type: "string",
|
|
47
|
+
default: "''",
|
|
48
|
+
description: "Additional CSS classes",
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export const progressDoom = {
|
|
2
|
+
name: "Progress Doom",
|
|
3
|
+
slug: "progress-doom",
|
|
4
|
+
emoji: "⏳",
|
|
5
|
+
category: "badui",
|
|
6
|
+
tagline: "A progress bar that lies, stalls, and goes backwards",
|
|
7
|
+
description: "A progress bar that shows three different values — real, displayed, and claimed — none of which agree. It goes backwards randomly, stalls at inconvenient moments, and lies about completion.",
|
|
8
|
+
usage: `<script lang="ts">
|
|
9
|
+
import { ProgressDoom } from '@gigo-ui/components';
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<ProgressDoom
|
|
13
|
+
targetMs={5000}
|
|
14
|
+
onComplete={() => alert('Done!')}
|
|
15
|
+
/>`,
|
|
16
|
+
props: [
|
|
17
|
+
{
|
|
18
|
+
name: "targetMs",
|
|
19
|
+
type: "number",
|
|
20
|
+
default: "5000",
|
|
21
|
+
description: "Target duration in milliseconds",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "goBackwards",
|
|
25
|
+
type: "boolean",
|
|
26
|
+
default: "true",
|
|
27
|
+
description: "Progress randomly goes backwards",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "stall",
|
|
31
|
+
type: "boolean",
|
|
32
|
+
default: "true",
|
|
33
|
+
description: "Progress randomly stalls",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "lieAboutCompletion",
|
|
37
|
+
type: "boolean",
|
|
38
|
+
default: "true",
|
|
39
|
+
description: "Displayed percentage lies",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "onComplete",
|
|
43
|
+
type: "() => void",
|
|
44
|
+
default: "undefined",
|
|
45
|
+
description: "Callback when actually complete",
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export const rotaryDial = {
|
|
2
|
+
name: "Rotary Dial",
|
|
3
|
+
slug: "rotary-dial",
|
|
4
|
+
emoji: "☎️",
|
|
5
|
+
category: "badui",
|
|
6
|
+
tagline: "Enter numbers by rotating a dial",
|
|
7
|
+
description: "An SVG rotary phone dial for number entry. Uses atan2 calculations for rotation tracking, enforces clockwise-only rotation, and animates the return spring. Each digit requires a full rotation cycle.",
|
|
8
|
+
usage: `<script lang="ts">
|
|
9
|
+
import { RotaryDial } from '@gigo-ui/components';
|
|
10
|
+
let value = $state('');
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<RotaryDial bind:value maxDigits={10} dialSize={300} />`,
|
|
14
|
+
props: [
|
|
15
|
+
{
|
|
16
|
+
name: "value",
|
|
17
|
+
type: "string",
|
|
18
|
+
default: "''",
|
|
19
|
+
description: "Current dialed number (bindable)",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "maxDigits",
|
|
23
|
+
type: "number",
|
|
24
|
+
default: "10",
|
|
25
|
+
description: "Maximum digits allowed",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "dialSize",
|
|
29
|
+
type: "number",
|
|
30
|
+
default: "260",
|
|
31
|
+
description: "Diameter of the rotary dial in pixels",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "class",
|
|
35
|
+
type: "string",
|
|
36
|
+
default: "''",
|
|
37
|
+
description: "Additional CSS classes",
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export const sliderPhone = {
|
|
2
|
+
name: "Slider Phone",
|
|
3
|
+
slug: "slider-phone",
|
|
4
|
+
emoji: "📱",
|
|
5
|
+
category: "badui",
|
|
6
|
+
tagline: "Enter a phone number with individual sliders",
|
|
7
|
+
description: "10 range sliders (0-9 each) for entering a phone number one digit at a time. Displays the result formatted as (XXX) XXX-XXXX. The ultimate in tedious data entry.",
|
|
8
|
+
usage: `<script lang="ts">
|
|
9
|
+
import { SliderPhone } from '@gigo-ui/components';
|
|
10
|
+
let value = $state('');
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<SliderPhone bind:value digitCount={10} formatPattern="(XXX) XXX-XXXX" />`,
|
|
14
|
+
props: [
|
|
15
|
+
{
|
|
16
|
+
name: "value",
|
|
17
|
+
type: "string",
|
|
18
|
+
default: "''",
|
|
19
|
+
description: "Current phone number (bindable)",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "digitCount",
|
|
23
|
+
type: "number",
|
|
24
|
+
default: "10",
|
|
25
|
+
description: "Number of digit sliders",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "formatPattern",
|
|
29
|
+
type: "string",
|
|
30
|
+
default: "'(XXX) XXX-XXXX'",
|
|
31
|
+
description: "Display format pattern (X = digit placeholder)",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "class",
|
|
35
|
+
type: "string",
|
|
36
|
+
default: "''",
|
|
37
|
+
description: "Additional CSS classes",
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
};
|