doom-design-system 0.3.3 → 0.4.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.
Files changed (42) hide show
  1. package/README.md +10 -6
  2. package/dist/components/Avatar/Avatar.js +2 -1
  3. package/dist/components/Badge/Badge.d.ts +5 -3
  4. package/dist/components/Badge/Badge.js +5 -5
  5. package/dist/components/Badge/Badge.module.css +20 -2
  6. package/dist/components/Button/Button.d.ts +3 -3
  7. package/dist/components/Button/Button.js +6 -6
  8. package/dist/components/Button/Button.module.css +30 -6
  9. package/dist/components/Drawer/Drawer.js +1 -1
  10. package/dist/components/Drawer/Drawer.module.css +0 -22
  11. package/dist/components/FileUpload/FileUpload.d.ts +32 -0
  12. package/dist/components/FileUpload/FileUpload.js +237 -0
  13. package/dist/components/FileUpload/FileUpload.module.css +330 -0
  14. package/dist/components/FileUpload/index.d.ts +2 -0
  15. package/dist/components/FileUpload/index.js +1 -0
  16. package/dist/components/Image/Image.d.ts +8 -0
  17. package/dist/components/Image/Image.js +60 -0
  18. package/dist/components/Image/Image.module.css +36 -0
  19. package/dist/components/Image/index.d.ts +1 -0
  20. package/dist/components/Image/index.js +1 -0
  21. package/dist/components/Layout/Layout.d.ts +12 -8
  22. package/dist/components/Layout/Layout.js +13 -11
  23. package/dist/components/Layout/Layout.module.css +29 -0
  24. package/dist/components/Link/Link.d.ts +6 -3
  25. package/dist/components/Link/Link.js +27 -6
  26. package/dist/components/Link/Link.module.css +22 -6
  27. package/dist/components/Modal/Modal.js +1 -1
  28. package/dist/components/Modal/Modal.module.css +0 -36
  29. package/dist/components/Sheet/Sheet.js +1 -1
  30. package/dist/components/Sheet/Sheet.module.css +0 -22
  31. package/dist/components/Slat/Slat.d.ts +14 -0
  32. package/dist/components/Slat/Slat.js +27 -0
  33. package/dist/components/Slat/Slat.module.css +101 -0
  34. package/dist/components/Slat/index.d.ts +2 -0
  35. package/dist/components/Slat/index.js +1 -0
  36. package/dist/index.d.ts +41 -38
  37. package/dist/index.js +41 -38
  38. package/dist/styles/globals.css +238 -0
  39. package/dist/styles/themes/definitions.d.ts +3 -3
  40. package/dist/styles/themes/definitions.js +3 -3
  41. package/dist/tsconfig.build.tsbuildinfo +1 -1
  42. package/package.json +1 -1
@@ -0,0 +1,330 @@
1
+ .window {
2
+ background-color: var(--card-bg);
3
+ border: var(--border-width) solid var(--card-border);
4
+ border-radius: var(--radius);
5
+ box-shadow: var(--shadow-hard);
6
+ padding: 0;
7
+ display: flex;
8
+ flex-direction: column;
9
+ overflow: hidden;
10
+ position: relative;
11
+ transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
12
+ width: 100%;
13
+ max-width: 100%;
14
+ min-width: 280px;
15
+ }
16
+ .window.disabled {
17
+ cursor: not-allowed;
18
+ opacity: 0.6;
19
+ cursor: not-allowed !important;
20
+ background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0, 0, 0, 0.05) 10px, rgba(0, 0, 0, 0.05) 20px) !important;
21
+ }
22
+ .window.disabled:hover {
23
+ transform: none !important;
24
+ filter: none !important;
25
+ }
26
+ .window.disabled {
27
+ /*
28
+ .window should be able to override all children css and this is an example of that
29
+ */
30
+ }
31
+ .window.disabled * {
32
+ pointer-events: none;
33
+ }
34
+ .window.disabled::after {
35
+ content: "";
36
+ position: absolute;
37
+ inset: 0;
38
+ pointer-events: none;
39
+ z-index: 20;
40
+ }
41
+ .window.void {
42
+ border-color: transparent;
43
+ box-shadow: 0 0 0 4px var(--foreground);
44
+ transform: scale(1.01);
45
+ cursor: wait;
46
+ }
47
+ .window.void .header {
48
+ background-color: var(--common-black);
49
+ color: var(--background);
50
+ border-bottom: none;
51
+ }
52
+ .window.void .header > * {
53
+ --primary: var(--common-white);
54
+ --primary-foreground: var(--common-black);
55
+ }
56
+ .window.void .body {
57
+ background-color: var(--common-black);
58
+ cursor: wait;
59
+ margin-top: -1px;
60
+ position: relative;
61
+ z-index: 1;
62
+ overflow: hidden;
63
+ }
64
+ .window.void .body::before, .window.void .body::after {
65
+ content: "";
66
+ position: absolute;
67
+ inset: -50%;
68
+ width: 200%;
69
+ height: 200%;
70
+ background-image: radial-gradient(1px 1px at 20% 30%, #fff 100%, transparent), radial-gradient(1px 1px at 40% 70%, #fff 100%, transparent), radial-gradient(1px 1px at 60% 40%, #fff 100%, transparent), radial-gradient(1px 1px at 80% 80%, #fff 100%, transparent), radial-gradient(1px 1px at 10% 10%, #fff 100%, transparent), radial-gradient(1px 1px at 30% 50%, #fff 100%, transparent), radial-gradient(1px 1px at 50% 20%, #fff 100%, transparent), radial-gradient(1px 1px at 70% 90%, #fff 100%, transparent), radial-gradient(1px 1px at 90% 30%, #fff 100%, transparent), radial-gradient(1.5px 1.5px at 15% 75%, #fff 100%, transparent), radial-gradient(1px 1px at 85% 15%, #fff 100%, transparent), radial-gradient(1px 1px at 55% 65%, #fff 100%, transparent);
71
+ background-size: 50% 50%;
72
+ opacity: 0.5;
73
+ z-index: 0;
74
+ animation: consume-stars 6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
75
+ pointer-events: none;
76
+ }
77
+ .window.void .body::after {
78
+ animation-name: consume-stars-alt;
79
+ animation-delay: -3s;
80
+ background-position: 33% 33%;
81
+ opacity: 0.3;
82
+ }
83
+ .window.void .body .starField {
84
+ position: absolute;
85
+ inset: 0;
86
+ pointer-events: none;
87
+ z-index: 0;
88
+ overflow: hidden;
89
+ }
90
+ .window.void .body .starField::before, .window.void .body .starField::after {
91
+ content: "";
92
+ position: absolute;
93
+ inset: -50%;
94
+ width: 200%;
95
+ height: 200%;
96
+ background-image: radial-gradient(1px 1px at 25% 35%, #fff 100%, transparent), radial-gradient(1px 1px at 45% 75%, #fff 100%, transparent), radial-gradient(1px 1px at 65% 45%, #fff 100%, transparent), radial-gradient(1px 1px at 85% 85%, #fff 100%, transparent), radial-gradient(1px 1px at 15% 15%, #fff 100%, transparent), radial-gradient(1px 1px at 35% 55%, #fff 100%, transparent), radial-gradient(1px 1px at 55% 25%, #fff 100%, transparent), radial-gradient(1px 1px at 75% 95%, #fff 100%, transparent), radial-gradient(1px 1px at 95% 35%, #fff 100%, transparent), radial-gradient(1.5px 1.5px at 20% 80%, #fff 100%, transparent), radial-gradient(1px 1px at 90% 20%, #fff 100%, transparent), radial-gradient(1px 1px at 60% 70%, #fff 100%, transparent);
97
+ background-size: 50% 50%;
98
+ opacity: 0.5;
99
+ animation: consume-stars 6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
100
+ animation-delay: -1.5s;
101
+ }
102
+ .window.void .body .starField::after {
103
+ animation-name: consume-stars-alt;
104
+ animation-delay: -4.5s;
105
+ background-position: 40% 40%;
106
+ opacity: 0.3;
107
+ }
108
+ .window.void .headerContent,
109
+ .window.void .headerTitle {
110
+ opacity: 0;
111
+ visibility: hidden;
112
+ }
113
+ .window.void .voidIconWrapper,
114
+ .window.void .voidText,
115
+ .window.void .secondary,
116
+ .window.void .helperText {
117
+ opacity: 0;
118
+ transform: scale(0.9);
119
+ pointer-events: none;
120
+ }
121
+
122
+ .header {
123
+ background-color: var(--primary);
124
+ color: var(--primary-foreground);
125
+ padding: var(--spacing-sm) var(--spacing-md);
126
+ border-bottom: var(--border-width) solid var(--border-strong);
127
+ user-select: none;
128
+ min-height: 56px;
129
+ transition: all 0.4s ease;
130
+ }
131
+ @media (max-width: 480px) {
132
+ .header {
133
+ padding: var(--spacing-sm);
134
+ min-height: 48px;
135
+ }
136
+ }
137
+ @media (max-width: 360px) {
138
+ .header {
139
+ padding: var(--spacing-md);
140
+ }
141
+ }
142
+ .header > * {
143
+ --primary: var(--primary-foreground);
144
+ --primary-foreground: var(--primary);
145
+ --foreground: var(--primary-foreground);
146
+ --muted-foreground: var(--primary-foreground);
147
+ }
148
+ .header.errorHeader {
149
+ background-color: var(--error);
150
+ color: var(--error-foreground);
151
+ }
152
+ .header.disabledHeader {
153
+ background-color: var(--muted);
154
+ color: var(--muted-foreground);
155
+ opacity: 0.6;
156
+ cursor: not-allowed !important;
157
+ background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0, 0, 0, 0.05) 10px, rgba(0, 0, 0, 0.05) 20px) !important;
158
+ }
159
+ .header.disabledHeader:hover {
160
+ transform: none !important;
161
+ filter: none !important;
162
+ }
163
+ .header.disabledHeader {
164
+ opacity: 1;
165
+ }
166
+
167
+ .headerContent {
168
+ flex: 1;
169
+ min-width: 0;
170
+ }
171
+
172
+ .headerTitle {
173
+ font-family: var(--font-heading);
174
+ font-weight: 800;
175
+ font-size: var(--text-sm);
176
+ letter-spacing: 0.05em;
177
+ text-transform: uppercase;
178
+ line-height: 1.2;
179
+ display: block;
180
+ }
181
+
182
+ .requiredMark {
183
+ display: inline-flex;
184
+ vertical-align: middle;
185
+ margin-left: 2px;
186
+ color: inherit;
187
+ transform: translateY(-2px);
188
+ }
189
+
190
+ .body {
191
+ padding: var(--spacing-lg);
192
+ background-color: var(--card-bg);
193
+ min-height: 200px;
194
+ display: flex;
195
+ flex-direction: column;
196
+ align-items: center;
197
+ justify-content: center;
198
+ cursor: pointer;
199
+ transition: background-color 0.2s ease;
200
+ position: relative;
201
+ }
202
+ @media (max-width: 640px) {
203
+ .body {
204
+ padding: var(--spacing-md);
205
+ min-height: 160px;
206
+ }
207
+ }
208
+ @media (max-width: 360px) {
209
+ .body {
210
+ padding: var(--spacing-sm) var(--spacing-md);
211
+ }
212
+ }
213
+ .body.hasFiles {
214
+ justify-content: flex-start;
215
+ align-items: stretch;
216
+ cursor: default;
217
+ }
218
+ .body.dragging, .body.error {
219
+ background-color: var(--surface-accent);
220
+ }
221
+
222
+ .emptyState {
223
+ width: 100%;
224
+ cursor: pointer;
225
+ outline: none;
226
+ border-radius: var(--radius);
227
+ transition: background-color 0.2s ease;
228
+ }
229
+ .emptyState:focus-visible {
230
+ box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--primary);
231
+ }
232
+ .void .emptyState:hover {
233
+ background-color: transparent;
234
+ cursor: wait;
235
+ }
236
+ .emptyState {
237
+ text-align: center;
238
+ }
239
+
240
+ .voidIconWrapper {
241
+ transition: all 0.3s ease;
242
+ padding: var(--spacing-md);
243
+ margin-bottom: var(--spacing-sm);
244
+ }
245
+
246
+ .icon {
247
+ color: var(--muted-foreground);
248
+ transition: all 0.3s ease;
249
+ }
250
+ @media (max-width: 480px) {
251
+ .icon {
252
+ width: 32px;
253
+ height: 32px;
254
+ }
255
+ }
256
+
257
+ .secondary {
258
+ color: var(--muted-foreground);
259
+ opacity: 0.8;
260
+ }
261
+
262
+ .hiddenInput {
263
+ display: none;
264
+ }
265
+
266
+ .fileList {
267
+ width: 100%;
268
+ flex: 1;
269
+ }
270
+
271
+ .removeButton {
272
+ width: 32px;
273
+ height: 32px;
274
+ padding: 0 !important;
275
+ flex-shrink: 0;
276
+ }
277
+
278
+ @keyframes consume-stars {
279
+ 0% {
280
+ transform: scale(2.5) rotate(0deg);
281
+ opacity: 0;
282
+ }
283
+ 5% {
284
+ opacity: 1;
285
+ }
286
+ 95% {
287
+ opacity: 1;
288
+ }
289
+ 100% {
290
+ transform: scale(0) rotate(360deg);
291
+ opacity: 0;
292
+ }
293
+ }
294
+ @keyframes consume-stars-alt {
295
+ 0% {
296
+ transform: scale(3) rotate(45deg);
297
+ opacity: 0;
298
+ }
299
+ 5% {
300
+ opacity: 1;
301
+ }
302
+ 95% {
303
+ opacity: 1;
304
+ }
305
+ 100% {
306
+ transform: scale(0) rotate(405deg);
307
+ opacity: 0;
308
+ }
309
+ }
310
+ .previewWrapper {
311
+ width: 64px;
312
+ height: 64px;
313
+ border-radius: var(--radius);
314
+ overflow: hidden;
315
+ border: var(--border-width) solid var(--border-strong);
316
+ position: relative;
317
+ background: var(--surface-accent);
318
+ flex-shrink: 0;
319
+ }
320
+
321
+ .previewImg {
322
+ width: 100%;
323
+ height: 100%;
324
+ object-fit: cover;
325
+ }
326
+
327
+ .previewSkeleton {
328
+ position: absolute;
329
+ inset: 0;
330
+ }
@@ -0,0 +1,2 @@
1
+ export { FileUpload } from "./FileUpload";
2
+ export type { FileUploadProps } from "./FileUpload";
@@ -0,0 +1 @@
1
+ export { FileUpload } from "./FileUpload.js";
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ export interface ImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
3
+ fit?: "cover" | "contain" | "fill" | "none" | "scale-down";
4
+ fallbackSrc?: string;
5
+ aspectRatio?: string | number;
6
+ rounded?: boolean;
7
+ }
8
+ export declare function Image({ src, alt, className, fit, style, onLoad, onError, fallbackSrc, aspectRatio, rounded, ...props }: ImageProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,60 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { useState, useRef, useEffect } from "react";
15
+ import clsx from "clsx";
16
+ import styles from "./Image.module.css";
17
+ import { Skeleton } from "../Skeleton/Skeleton.js";
18
+ export function Image(_a) {
19
+ var { src, alt, className, fit, style, onLoad, onError, fallbackSrc, aspectRatio, rounded = true } = _a, props = __rest(_a, ["src", "alt", "className", "fit", "style", "onLoad", "onError", "fallbackSrc", "aspectRatio", "rounded"]);
20
+ const [isLoaded, setIsLoaded] = useState(false);
21
+ const [hasError, setHasError] = useState(false);
22
+ const [showSkeleton, setShowSkeleton] = useState(false);
23
+ const timerRef = useRef(null);
24
+ useEffect(() => {
25
+ setIsLoaded(false);
26
+ setHasError(false);
27
+ setShowSkeleton(false);
28
+ if (timerRef.current)
29
+ clearTimeout(timerRef.current);
30
+ timerRef.current = setTimeout(() => {
31
+ setShowSkeleton(true);
32
+ }, 150);
33
+ return () => {
34
+ if (timerRef.current)
35
+ clearTimeout(timerRef.current);
36
+ };
37
+ }, [src]);
38
+ const handleLoad = (e) => {
39
+ if (timerRef.current)
40
+ clearTimeout(timerRef.current);
41
+ setIsLoaded(true);
42
+ onLoad === null || onLoad === void 0 ? void 0 : onLoad(e);
43
+ };
44
+ const handleError = (e) => {
45
+ if (fallbackSrc && !hasError) {
46
+ setHasError(true);
47
+ return;
48
+ }
49
+ if (timerRef.current)
50
+ clearTimeout(timerRef.current);
51
+ setIsLoaded(true);
52
+ onError === null || onError === void 0 ? void 0 : onError(e);
53
+ };
54
+ return (_jsxs("div", { className: clsx(styles.wrapper, rounded && styles.rounded, className), style: Object.assign({ aspectRatio }, style), children: [!isLoaded && showSkeleton && (_jsx(Skeleton, { className: styles.skeleton, style: {
55
+ position: "absolute",
56
+ inset: 0,
57
+ height: "100%",
58
+ width: "100%",
59
+ } })), _jsx("img", Object.assign({ src: hasError ? fallbackSrc : src, alt: alt, className: clsx(styles.image, fit && styles[`fit-${fit}`], showSkeleton && styles["with-transition"]), onLoad: handleLoad, onError: handleError, "data-loaded": isLoaded ? "true" : "false", style: { width: "100%", height: "100%" } }, props))] }));
60
+ }
@@ -0,0 +1,36 @@
1
+ .image {
2
+ display: block;
3
+ max-width: 100%;
4
+ height: auto;
5
+ }
6
+ .image[data-loaded=false] {
7
+ opacity: 0;
8
+ }
9
+ .image.with-transition {
10
+ transition: opacity 0.3s ease-in-out;
11
+ }
12
+ .image.fit-cover {
13
+ object-fit: cover;
14
+ }
15
+ .image.fit-contain {
16
+ object-fit: contain;
17
+ }
18
+ .image.fit-fill {
19
+ object-fit: fill;
20
+ }
21
+ .image.fit-none {
22
+ object-fit: none;
23
+ }
24
+ .image.fit-scale-down {
25
+ object-fit: scale-down;
26
+ }
27
+
28
+ .wrapper {
29
+ position: relative;
30
+ display: block;
31
+ overflow: hidden;
32
+ }
33
+
34
+ .rounded {
35
+ border-radius: var(--radius);
36
+ }
@@ -0,0 +1 @@
1
+ export * from "./Image";
@@ -0,0 +1 @@
1
+ export * from "./Image.js";
@@ -1,4 +1,4 @@
1
- import React, { ElementType } from 'react';
1
+ import React, { ElementType } from "react";
2
2
  interface LayoutProps extends React.HTMLAttributes<HTMLElement> {
3
3
  children?: React.ReactNode;
4
4
  as?: ElementType;
@@ -9,19 +9,23 @@ export interface GridProps extends LayoutProps {
9
9
  }
10
10
  export declare function Grid({ children, columns, gap, className, style, as: Component, ...props }: GridProps): import("react/jsx-runtime").JSX.Element;
11
11
  export interface FlexProps extends LayoutProps {
12
- direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
13
- justify?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
14
- align?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
12
+ direction?: "row" | "column" | "row-reverse" | "column-reverse";
13
+ justify?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly";
14
+ align?: "flex-start" | "flex-end" | "center" | "stretch" | "baseline";
15
15
  gap?: string | number;
16
- wrap?: boolean | 'wrap' | 'nowrap' | 'wrap-reverse';
16
+ wrap?: boolean | "wrap" | "nowrap" | "wrap-reverse";
17
17
  }
18
18
  export declare function Flex({ children, direction, justify, align, gap, wrap, className, style, as: Component, ...props }: FlexProps): import("react/jsx-runtime").JSX.Element;
19
- export interface StackProps extends Omit<FlexProps, 'direction'> {
20
- direction?: 'column' | 'column-reverse' | 'row' | 'row-reverse';
19
+ export interface StackProps extends Omit<FlexProps, "direction"> {
20
+ direction?: "column" | "column-reverse" | "row" | "row-reverse";
21
21
  }
22
22
  export declare function Stack({ children, direction, gap, align, ...props }: StackProps): import("react/jsx-runtime").JSX.Element;
23
+ export interface SwitcherProps extends FlexProps {
24
+ threshold?: "xxs" | "xs" | "sm" | "md";
25
+ }
26
+ export declare function Switcher({ children, threshold, className, ...props }: SwitcherProps): import("react/jsx-runtime").JSX.Element;
23
27
  export interface ContainerProps extends LayoutProps {
24
- maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | 'fluid';
28
+ maxWidth?: "sm" | "md" | "lg" | "xl" | "fluid";
25
29
  }
26
30
  export declare function Container({ children, maxWidth, className, as: Component, ...props }: ContainerProps): import("react/jsx-runtime").JSX.Element;
27
31
  export {};
@@ -1,4 +1,4 @@
1
- 'use client';
1
+ "use client";
2
2
  var __rest = (this && this.__rest) || function (s, e) {
3
3
  var t = {};
4
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -11,27 +11,29 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  return t;
12
12
  };
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
- import clsx from 'clsx';
15
- import styles from './Layout.module.css';
14
+ import clsx from "clsx";
15
+ import styles from "./Layout.module.css";
16
16
  export function Grid(_a) {
17
- var { children, columns = '1fr', gap = '1rem', className, style, as: Component = 'div' } = _a, props = __rest(_a, ["children", "columns", "gap", "className", "style", "as"]);
18
- const gridTemplateColumns = typeof columns === 'number' ? `repeat(${columns}, 1fr)` : columns;
17
+ var { children, columns = "1fr", gap = "1rem", className, style, as: Component = "div" } = _a, props = __rest(_a, ["children", "columns", "gap", "className", "style", "as"]);
18
+ const gridTemplateColumns = typeof columns === "number" ? `repeat(${columns}, 1fr)` : columns;
19
19
  return (_jsx(Component, Object.assign({ className: clsx(styles.grid, className), style: Object.assign({ gridTemplateColumns,
20
20
  gap }, style) }, props, { children: children })));
21
21
  }
22
22
  export function Flex(_a) {
23
- var { children, direction = 'row', justify = 'flex-start', align = 'stretch', gap = '0', wrap = false, className, style, as: Component = 'div' } = _a, props = __rest(_a, ["children", "direction", "justify", "align", "gap", "wrap", "className", "style", "as"]);
24
- const flexWrap = typeof wrap === 'boolean'
25
- ? (wrap ? 'wrap' : 'nowrap')
26
- : wrap;
23
+ var { children, direction = "row", justify = "flex-start", align = "stretch", gap = "0", wrap = false, className, style, as: Component = "div" } = _a, props = __rest(_a, ["children", "direction", "justify", "align", "gap", "wrap", "className", "style", "as"]);
24
+ const flexWrap = typeof wrap === "boolean" ? (wrap ? "wrap" : "nowrap") : wrap;
27
25
  return (_jsx(Component, Object.assign({ className: clsx(styles.flex, className), style: Object.assign({ flexDirection: direction, justifyContent: justify, alignItems: align, gap,
28
26
  flexWrap }, style) }, props, { children: children })));
29
27
  }
30
28
  export function Stack(_a) {
31
- var { children, direction = 'column', gap = '1rem', align = 'stretch' } = _a, props = __rest(_a, ["children", "direction", "gap", "align"]);
29
+ var { children, direction = "column", gap = "1rem", align = "stretch" } = _a, props = __rest(_a, ["children", "direction", "gap", "align"]);
32
30
  return (_jsx(Flex, Object.assign({ direction: direction, gap: gap, align: align }, props, { children: children })));
33
31
  }
32
+ export function Switcher(_a) {
33
+ var { children, threshold = "xs", className } = _a, props = __rest(_a, ["children", "threshold", "className"]);
34
+ return (_jsx(Flex, Object.assign({ className: clsx(styles.switcher, styles[`switch-${threshold}`], className) }, props, { children: children })));
35
+ }
34
36
  export function Container(_a) {
35
- var { children, maxWidth = 'xl', className, as: Component = 'div' } = _a, props = __rest(_a, ["children", "maxWidth", "className", "as"]);
37
+ var { children, maxWidth = "xl", className, as: Component = "div" } = _a, props = __rest(_a, ["children", "maxWidth", "className", "as"]);
36
38
  return (_jsx(Component, Object.assign({ className: clsx(styles.container, styles[maxWidth], className) }, props, { children: children })));
37
39
  }
@@ -28,3 +28,32 @@
28
28
  .container.fluid {
29
29
  max-width: 100%;
30
30
  }
31
+
32
+ .switcher {
33
+ display: flex;
34
+ flex-direction: row;
35
+ }
36
+ @media (max-width: 360px) {
37
+ .switcher.switch-xxs {
38
+ flex-direction: column;
39
+ align-items: flex-start !important;
40
+ }
41
+ }
42
+ @media (max-width: 480px) {
43
+ .switcher.switch-xs {
44
+ flex-direction: column;
45
+ align-items: flex-start !important;
46
+ }
47
+ }
48
+ @media (max-width: 640px) {
49
+ .switcher.switch-sm {
50
+ flex-direction: column;
51
+ align-items: flex-start !important;
52
+ }
53
+ }
54
+ @media (max-width: 768px) {
55
+ .switcher.switch-md {
56
+ flex-direction: column;
57
+ align-items: flex-start !important;
58
+ }
59
+ }
@@ -1,9 +1,12 @@
1
- import React from 'react';
2
- export type LinkVariant = 'default' | 'button' | 'subtle';
1
+ import React from "react";
2
+ export type LinkVariant = "default" | "button" | "subtle";
3
3
  interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
4
4
  children: React.ReactNode;
5
5
  variant?: LinkVariant;
6
+ prefetch?: boolean;
7
+ isExternal?: boolean;
8
+ disabled?: boolean;
6
9
  className?: string;
7
10
  }
8
- export declare function Link({ children, variant, className, ...props }: LinkProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function Link({ children, variant, prefetch, isExternal, disabled, className, onClick, onMouseEnter, ...props }: LinkProps): import("react/jsx-runtime").JSX.Element;
9
12
  export {};
@@ -1,4 +1,4 @@
1
- 'use client';
1
+ "use client";
2
2
  var __rest = (this && this.__rest) || function (s, e) {
3
3
  var t = {};
4
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -10,10 +10,31 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  }
11
11
  return t;
12
12
  };
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
- import clsx from 'clsx';
15
- import styles from './Link.module.css';
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import clsx from "clsx";
15
+ import styles from "./Link.module.css";
16
+ import React from "react";
17
+ import { ExternalLink } from "lucide-react";
16
18
  export function Link(_a) {
17
- var { children, variant = 'default', className } = _a, props = __rest(_a, ["children", "variant", "className"]);
18
- return (_jsx("a", Object.assign({ className: clsx(styles.link, styles[variant], className) }, props, { children: children })));
19
+ var { children, variant = "default", prefetch, isExternal, disabled, className, onClick, onMouseEnter } = _a, props = __rest(_a, ["children", "variant", "prefetch", "isExternal", "disabled", "className", "onClick", "onMouseEnter"]);
20
+ const [shouldPrefetch, setShouldPrefetch] = React.useState(false);
21
+ const handleMouseEnter = (e) => {
22
+ if (disabled)
23
+ return;
24
+ if (prefetch && !shouldPrefetch) {
25
+ setShouldPrefetch(true);
26
+ }
27
+ onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(e);
28
+ };
29
+ const handleClick = (e) => {
30
+ if (disabled) {
31
+ e.preventDefault();
32
+ return;
33
+ }
34
+ onClick === null || onClick === void 0 ? void 0 : onClick(e);
35
+ };
36
+ const externalProps = isExternal
37
+ ? { target: "_blank", rel: "noopener noreferrer" }
38
+ : {};
39
+ return (_jsxs("a", Object.assign({ className: clsx(styles.link, styles[variant], disabled && styles.disabled, className), onMouseEnter: handleMouseEnter, onClick: handleClick, "aria-disabled": disabled }, externalProps, props, { children: [children, isExternal && _jsx(ExternalLink, { size: 14, className: "ml-1" }), shouldPrefetch && props.href && (_jsx("link", { rel: "prefetch", href: props.href, as: "document" }))] })));
19
40
  }
@@ -2,19 +2,35 @@
2
2
  display: inline-flex;
3
3
  align-items: center;
4
4
  justify-content: center;
5
- font-weight: 700;
6
5
  text-decoration: none;
7
6
  transition: all 0.2s ease-in-out;
8
7
  cursor: pointer;
8
+ outline: none;
9
+ }
10
+ .link:focus-visible {
11
+ outline: revert;
12
+ }
13
+ .link.disabled {
14
+ pointer-events: none;
15
+ opacity: 0.5;
16
+ text-decoration: none;
17
+ cursor: not-allowed;
9
18
  }
10
19
  .link.default {
11
- color: var(--foreground);
12
- border-bottom: 2px solid transparent;
20
+ color: var(--primary);
21
+ text-decoration: underline;
22
+ text-decoration-thickness: 2px;
23
+ text-underline-offset: 2px;
13
24
  }
14
25
  .link.default:hover {
15
- color: var(--primary);
16
- border-bottom-color: var(--primary);
17
- transform: translateY(-1px);
26
+ filter: brightness(1.2);
27
+ }
28
+ .link.default:visited {
29
+ color: var(--primary-dark, var(--primary));
30
+ filter: brightness(0.8);
31
+ }
32
+ .link.default:active {
33
+ filter: brightness(0.9);
18
34
  }
19
35
  .link.subtle {
20
36
  color: var(--muted-foreground);