@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,177 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes, HTMLButtonAttributes, HTMLInputAttributes } from "svelte/elements";
|
|
3
|
+
export interface GigoBaseProps {
|
|
4
|
+
chaos?: boolean;
|
|
5
|
+
chaosLevel?: number;
|
|
6
|
+
educational?: boolean;
|
|
7
|
+
a11yWarning?: boolean;
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
export type ButtonVariant = "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "chaos-primary" | "chaos-destructive" | "chaos-nightmare";
|
|
11
|
+
export type ButtonSize = "xs" | "sm" | "md" | "lg" | "xl" | "chaos-sm" | "chaos-lg" | "chaos-xl";
|
|
12
|
+
export interface GigoButtonProps extends GigoBaseProps {
|
|
13
|
+
variant?: ButtonVariant;
|
|
14
|
+
size?: ButtonSize;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
escapeOnHover?: boolean;
|
|
18
|
+
randomizeText?: boolean;
|
|
19
|
+
multiClickRequired?: number;
|
|
20
|
+
children?: Snippet;
|
|
21
|
+
onclick?: HTMLButtonAttributes["onclick"];
|
|
22
|
+
}
|
|
23
|
+
export type InputType = "text" | "email" | "password" | "number" | "tel" | "url" | "search";
|
|
24
|
+
export interface GigoInputProps extends GigoBaseProps {
|
|
25
|
+
type?: InputType;
|
|
26
|
+
value?: string;
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
required?: boolean;
|
|
30
|
+
name?: string;
|
|
31
|
+
randomDelete?: boolean;
|
|
32
|
+
escapeOnFocus?: boolean;
|
|
33
|
+
fakeValidation?: boolean;
|
|
34
|
+
randomizeType?: boolean;
|
|
35
|
+
oninput?: HTMLInputAttributes["oninput"];
|
|
36
|
+
onchange?: HTMLInputAttributes["onchange"];
|
|
37
|
+
}
|
|
38
|
+
export interface GigoModalProps extends GigoBaseProps {
|
|
39
|
+
open?: boolean;
|
|
40
|
+
title?: string;
|
|
41
|
+
resistClose?: boolean;
|
|
42
|
+
escapeModal?: boolean;
|
|
43
|
+
fakeCloseButtons?: boolean;
|
|
44
|
+
spawnMoreModals?: boolean;
|
|
45
|
+
onclose?: () => void;
|
|
46
|
+
children?: Snippet;
|
|
47
|
+
footer?: Snippet;
|
|
48
|
+
}
|
|
49
|
+
export interface GigoCardProps extends GigoBaseProps {
|
|
50
|
+
title?: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
randomRotation?: boolean;
|
|
53
|
+
resistClicks?: boolean;
|
|
54
|
+
zIndexWar?: boolean;
|
|
55
|
+
children?: Snippet;
|
|
56
|
+
header?: Snippet;
|
|
57
|
+
footer?: Snippet;
|
|
58
|
+
onclick?: HTMLAttributes<HTMLDivElement>["onclick"];
|
|
59
|
+
}
|
|
60
|
+
export interface CarouselSlide {
|
|
61
|
+
id: string;
|
|
62
|
+
content: string;
|
|
63
|
+
image?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface GigoCarouselProps extends GigoBaseProps {
|
|
66
|
+
slides: CarouselSlide[];
|
|
67
|
+
autoplay?: boolean;
|
|
68
|
+
interval?: number;
|
|
69
|
+
lyingNavigation?: boolean;
|
|
70
|
+
reverseDirection?: boolean;
|
|
71
|
+
randomJumps?: boolean;
|
|
72
|
+
infiniteFakeSlides?: boolean;
|
|
73
|
+
onslidechange?: (index: number) => void;
|
|
74
|
+
}
|
|
75
|
+
export interface FormField {
|
|
76
|
+
id: string;
|
|
77
|
+
label: string;
|
|
78
|
+
type: InputType;
|
|
79
|
+
placeholder?: string;
|
|
80
|
+
required?: boolean;
|
|
81
|
+
}
|
|
82
|
+
export interface GigoFormProps extends GigoBaseProps {
|
|
83
|
+
fields: FormField[];
|
|
84
|
+
submitLabel?: string;
|
|
85
|
+
randomReset?: boolean;
|
|
86
|
+
fakeValidation?: boolean;
|
|
87
|
+
alwaysFails?: boolean;
|
|
88
|
+
shuffleFields?: boolean;
|
|
89
|
+
onsubmit?: (data: Record<string, string>) => void;
|
|
90
|
+
}
|
|
91
|
+
export interface NavItem {
|
|
92
|
+
id: string;
|
|
93
|
+
label: string;
|
|
94
|
+
href: string;
|
|
95
|
+
icon?: string;
|
|
96
|
+
}
|
|
97
|
+
export interface GigoNavProps extends GigoBaseProps {
|
|
98
|
+
items: NavItem[];
|
|
99
|
+
wrongDestinations?: boolean;
|
|
100
|
+
randomReorder?: boolean;
|
|
101
|
+
fakeLoading?: boolean;
|
|
102
|
+
}
|
|
103
|
+
export interface GigoChaosButtonProps extends GigoBaseProps {
|
|
104
|
+
label?: string;
|
|
105
|
+
onclick?: HTMLButtonAttributes["onclick"];
|
|
106
|
+
}
|
|
107
|
+
export interface GigoChaosFormProps extends GigoBaseProps {
|
|
108
|
+
onsubmit?: (data: Record<string, string>) => void;
|
|
109
|
+
}
|
|
110
|
+
export interface GigoGhostCardProps {
|
|
111
|
+
title?: string;
|
|
112
|
+
description?: string;
|
|
113
|
+
class?: string;
|
|
114
|
+
}
|
|
115
|
+
export interface GigoGravityInputProps {
|
|
116
|
+
value?: string;
|
|
117
|
+
placeholder?: string;
|
|
118
|
+
class?: string;
|
|
119
|
+
}
|
|
120
|
+
export interface GigoRotaryDialProps {
|
|
121
|
+
value?: string;
|
|
122
|
+
maxDigits?: number;
|
|
123
|
+
class?: string;
|
|
124
|
+
}
|
|
125
|
+
export interface GigoSliderPhoneProps {
|
|
126
|
+
value?: string;
|
|
127
|
+
digitCount?: number;
|
|
128
|
+
class?: string;
|
|
129
|
+
}
|
|
130
|
+
export interface GigoCatchSubmitProps {
|
|
131
|
+
label?: string;
|
|
132
|
+
onsubmit?: () => void;
|
|
133
|
+
class?: string;
|
|
134
|
+
}
|
|
135
|
+
export interface GigoDropdownCalcProps {
|
|
136
|
+
value?: string;
|
|
137
|
+
class?: string;
|
|
138
|
+
}
|
|
139
|
+
export interface GigoPasswordPeepholeProps {
|
|
140
|
+
value?: string;
|
|
141
|
+
placeholder?: string;
|
|
142
|
+
class?: string;
|
|
143
|
+
}
|
|
144
|
+
export interface GigoVolumeSliderProps {
|
|
145
|
+
value?: number;
|
|
146
|
+
min?: number;
|
|
147
|
+
max?: number;
|
|
148
|
+
step?: number;
|
|
149
|
+
invertDirection?: boolean;
|
|
150
|
+
jumpAround?: boolean;
|
|
151
|
+
fakeLabels?: boolean;
|
|
152
|
+
class?: string;
|
|
153
|
+
}
|
|
154
|
+
export interface GigoProgressDoomProps {
|
|
155
|
+
targetMs?: number;
|
|
156
|
+
goBackwards?: boolean;
|
|
157
|
+
stall?: boolean;
|
|
158
|
+
lieAboutCompletion?: boolean;
|
|
159
|
+
onComplete?: () => void;
|
|
160
|
+
class?: string;
|
|
161
|
+
}
|
|
162
|
+
export interface GigoColorPickerWrongProps {
|
|
163
|
+
value?: string;
|
|
164
|
+
offsetHue?: boolean;
|
|
165
|
+
swapChannels?: boolean;
|
|
166
|
+
delayUpdate?: boolean;
|
|
167
|
+
class?: string;
|
|
168
|
+
}
|
|
169
|
+
export interface GigoTermsSidescrollProps {
|
|
170
|
+
content?: string;
|
|
171
|
+
accepted?: boolean;
|
|
172
|
+
rotateText?: boolean;
|
|
173
|
+
scrambleOnScroll?: boolean;
|
|
174
|
+
sidewaysScroll?: boolean;
|
|
175
|
+
class?: string;
|
|
176
|
+
}
|
|
177
|
+
export type ChaosIntensity = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ClassValue } from "clsx";
|
|
2
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
3
|
+
export declare function chaosRandom(max: number): number;
|
|
4
|
+
export declare function chaosPickOne<T>(items: T[]): T;
|
|
5
|
+
export declare function chaosClasses(level: number): string;
|
|
6
|
+
export declare function randomGarbageText(): string;
|
|
7
|
+
export declare function sleep(ms: number): Promise<void>;
|
|
8
|
+
/** Clamp a number within a range */
|
|
9
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
package/dist/utils/cn.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
export function cn(...inputs) {
|
|
4
|
+
return twMerge(clsx(inputs));
|
|
5
|
+
}
|
|
6
|
+
const CHAOS_COLORS = [
|
|
7
|
+
"text-gigo-magenta",
|
|
8
|
+
"text-gigo-lime",
|
|
9
|
+
"text-gigo-yellow",
|
|
10
|
+
"text-gigo-orange",
|
|
11
|
+
"text-gigo-pink",
|
|
12
|
+
"text-gigo-cyan",
|
|
13
|
+
"text-gigo-hotpink",
|
|
14
|
+
"text-gigo-red",
|
|
15
|
+
"text-gigo-blue",
|
|
16
|
+
"text-gigo-tomato",
|
|
17
|
+
];
|
|
18
|
+
const CHAOS_TRANSFORMS = [
|
|
19
|
+
"rotate-1",
|
|
20
|
+
"-rotate-1",
|
|
21
|
+
"rotate-3",
|
|
22
|
+
"-rotate-3",
|
|
23
|
+
"rotate-6",
|
|
24
|
+
"-rotate-6",
|
|
25
|
+
"rotate-12",
|
|
26
|
+
"-rotate-12",
|
|
27
|
+
"skew-x-3",
|
|
28
|
+
"-skew-x-3",
|
|
29
|
+
"skew-y-3",
|
|
30
|
+
"-skew-y-3",
|
|
31
|
+
"scale-95",
|
|
32
|
+
"scale-105",
|
|
33
|
+
"scale-110",
|
|
34
|
+
];
|
|
35
|
+
const CHAOS_ANIMATIONS = [
|
|
36
|
+
"animate-gigo-jitter",
|
|
37
|
+
"animate-gigo-wiggle",
|
|
38
|
+
"animate-gigo-shake",
|
|
39
|
+
"animate-gigo-glitch",
|
|
40
|
+
];
|
|
41
|
+
export function chaosRandom(max) {
|
|
42
|
+
return Math.floor(Math.random() * max);
|
|
43
|
+
}
|
|
44
|
+
export function chaosPickOne(items) {
|
|
45
|
+
return items[chaosRandom(items.length)];
|
|
46
|
+
}
|
|
47
|
+
export function chaosClasses(level) {
|
|
48
|
+
if (level <= 0)
|
|
49
|
+
return "";
|
|
50
|
+
const classes = [];
|
|
51
|
+
if (level >= 2)
|
|
52
|
+
classes.push(chaosPickOne(CHAOS_COLORS));
|
|
53
|
+
if (level >= 4)
|
|
54
|
+
classes.push(chaosPickOne(CHAOS_TRANSFORMS));
|
|
55
|
+
if (level >= 6)
|
|
56
|
+
classes.push(chaosPickOne(CHAOS_ANIMATIONS));
|
|
57
|
+
if (level >= 8)
|
|
58
|
+
classes.push("font-gigo-chaos");
|
|
59
|
+
if (level >= 10)
|
|
60
|
+
classes.push("animate-gigo-nightmare", "font-gigo-nightmare");
|
|
61
|
+
return classes.join(" ");
|
|
62
|
+
}
|
|
63
|
+
const GARBAGE_WORDS = [
|
|
64
|
+
"ERROR",
|
|
65
|
+
"undefined",
|
|
66
|
+
"NaN",
|
|
67
|
+
"404",
|
|
68
|
+
"null",
|
|
69
|
+
"???",
|
|
70
|
+
"LOADING...",
|
|
71
|
+
"no.",
|
|
72
|
+
"HELP",
|
|
73
|
+
"bruh",
|
|
74
|
+
":(",
|
|
75
|
+
"segfault",
|
|
76
|
+
"lol",
|
|
77
|
+
"oops",
|
|
78
|
+
"yeet",
|
|
79
|
+
"💀",
|
|
80
|
+
];
|
|
81
|
+
export function randomGarbageText() {
|
|
82
|
+
return chaosPickOne(GARBAGE_WORDS);
|
|
83
|
+
}
|
|
84
|
+
export function sleep(ms) {
|
|
85
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
86
|
+
}
|
|
87
|
+
/** Clamp a number within a range */
|
|
88
|
+
export function clamp(value, min, max) {
|
|
89
|
+
return Math.min(Math.max(value, min), max);
|
|
90
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gigo-ui/components",
|
|
3
|
+
"version": "1.0.0-alpha",
|
|
4
|
+
"description": "Deliberately dysfunctional UI components — technically excellent, intentionally terrible UX",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"svelte": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"svelte": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./globals.css": "./dist/styles/globals.css"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"!dist/**/*.test.*"
|
|
20
|
+
],
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"svelte": "^5.0.0"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"clsx": "^2.1.1",
|
|
26
|
+
"tailwind-merge": "^3.5.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@sveltejs/adapter-auto": "^7.0.0",
|
|
30
|
+
"@sveltejs/kit": "^2.50.2",
|
|
31
|
+
"@sveltejs/package": "^2.5.7",
|
|
32
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
33
|
+
"@tailwindcss/vite": "^4.2.1",
|
|
34
|
+
"publint": "^0.3.18",
|
|
35
|
+
"svelte": "^5.51.0",
|
|
36
|
+
"svelte-check": "^4.4.2",
|
|
37
|
+
"tailwindcss": "^4.2.1",
|
|
38
|
+
"typescript": "^5.9.3",
|
|
39
|
+
"vite": "^7.3.1"
|
|
40
|
+
},
|
|
41
|
+
"keywords": [
|
|
42
|
+
"svelte",
|
|
43
|
+
"ui-components",
|
|
44
|
+
"educational",
|
|
45
|
+
"ux-antipatterns",
|
|
46
|
+
"design-system",
|
|
47
|
+
"tailwindcss"
|
|
48
|
+
],
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=20.0.0"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"dev": "vite dev",
|
|
54
|
+
"build": "vite build",
|
|
55
|
+
"build:lib": "svelte-kit sync && svelte-package && publint",
|
|
56
|
+
"preview": "vite preview",
|
|
57
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
58
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
59
|
+
"package": "svelte-kit sync && svelte-package"
|
|
60
|
+
}
|
|
61
|
+
}
|