zabi-components 5.0.22 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +139 -1478
- package/THEME.md +473 -0
- package/THEMING.md +248 -0
- package/dist/atoms/ActionPanel.svelte +116 -0
- package/dist/atoms/ActionPanel.svelte.d.ts +19 -0
- package/dist/atoms/Badge.svelte +1 -1
- package/dist/atoms/Badge.svelte.d.ts +1 -1
- package/dist/atoms/Button.svelte +35 -16
- package/dist/atoms/Button.svelte.d.ts +3 -1
- package/dist/atoms/Card.svelte +49 -67
- package/dist/atoms/Card.svelte.d.ts +4 -4
- package/dist/atoms/CardHeader.svelte +15 -2
- package/dist/atoms/CardHeader.svelte.d.ts +5 -0
- package/dist/atoms/Checkbox.svelte +50 -76
- package/dist/atoms/Checkbox.svelte.d.ts +7 -2
- package/dist/atoms/CodeBlock.svelte +20 -34
- package/dist/atoms/CodeBlock.svelte.d.ts +1 -0
- package/dist/atoms/ColorPicker.svelte +3 -7
- package/dist/atoms/Container.svelte +41 -0
- package/dist/atoms/Container.svelte.d.ts +12 -0
- package/dist/atoms/Divider.svelte +68 -0
- package/dist/atoms/Divider.svelte.d.ts +13 -0
- package/dist/atoms/FeatureCard.svelte +35 -50
- package/dist/atoms/FeatureCard.svelte.d.ts +9 -4
- package/dist/atoms/IconButton.svelte +33 -24
- package/dist/atoms/IconButton.svelte.d.ts +4 -8
- package/dist/atoms/Input.svelte +58 -26
- package/dist/atoms/Input.svelte.d.ts +6 -1
- package/dist/atoms/List.svelte +2 -7
- package/dist/atoms/List.svelte.d.ts +1 -6
- package/dist/atoms/ListItem.svelte +54 -65
- package/dist/atoms/ListItem.svelte.d.ts +7 -13
- package/dist/atoms/ListItemLeading.svelte +19 -0
- package/dist/atoms/ListItemLeading.svelte.d.ts +9 -0
- package/dist/atoms/Progress.svelte +2 -2
- package/dist/atoms/Radio.svelte +51 -0
- package/dist/atoms/Radio.svelte.d.ts +14 -0
- package/dist/atoms/Select.svelte +28 -33
- package/dist/atoms/Select.svelte.d.ts +0 -10
- package/dist/atoms/SelectionControl.svelte +98 -0
- package/dist/atoms/SelectionControl.svelte.d.ts +26 -0
- package/dist/atoms/Skeleton.svelte +39 -15
- package/dist/atoms/Skeleton.svelte.d.ts +7 -3
- package/dist/atoms/Table.svelte +27 -0
- package/dist/atoms/Table.svelte.d.ts +10 -0
- package/dist/atoms/Text.svelte +46 -0
- package/dist/atoms/Text.svelte.d.ts +13 -0
- package/dist/atoms/Textarea.svelte +74 -53
- package/dist/atoms/Textarea.svelte.d.ts +6 -2
- package/dist/atoms/ThemeToggle.svelte +35 -24
- package/dist/atoms/ThemeToggle.svelte.d.ts +1 -0
- package/dist/atoms/Toast.svelte +55 -31
- package/dist/atoms/Toast.svelte.d.ts +4 -1
- package/dist/atoms/Toggle.svelte +37 -22
- package/dist/atoms/Toggle.svelte.d.ts +2 -1
- package/dist/atoms/Tooltip.svelte +90 -11
- package/dist/atoms/index.d.ts +6 -0
- package/dist/atoms/index.js +6 -0
- package/dist/atoms/selection-control.styles.d.ts +25 -0
- package/dist/atoms/selection-control.styles.js +30 -0
- package/dist/components/atoms/index.d.ts +6 -0
- package/dist/components/atoms/index.d.ts.map +1 -1
- package/dist/components/atoms/selection-control.styles.d.ts +26 -0
- package/dist/components/atoms/selection-control.styles.d.ts.map +1 -0
- package/dist/components/index.d.ts +42 -7
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/molecules/index.d.ts +10 -0
- package/dist/components/molecules/index.d.ts.map +1 -1
- package/dist/components/molecules/navigation-menu-context.d.ts +11 -0
- package/dist/components/molecules/navigation-menu-context.d.ts.map +1 -1
- package/dist/components/molecules/toast-store.d.ts +39 -0
- package/dist/components/molecules/toast-store.d.ts.map +1 -0
- package/dist/components/organisms/index.d.ts +3 -3
- package/dist/components/organisms/index.d.ts.map +1 -1
- package/dist/components/types/page.types.d.ts +69 -0
- package/dist/components/types/page.types.d.ts.map +1 -0
- package/dist/components/types/page.types.js +1 -0
- package/dist/components/types/variants.d.ts +64 -0
- package/dist/components/types/variants.d.ts.map +1 -0
- package/dist/components/types/variants.js +44 -0
- package/dist/components/util/fixed-sidebar-flyout.d.ts +23 -0
- package/dist/components/util/fixed-sidebar-flyout.d.ts.map +1 -0
- package/dist/components/util/focus-utils.d.ts +12 -0
- package/dist/components/util/focus-utils.d.ts.map +1 -0
- package/dist/components/util/ssr-safe.d.ts +17 -0
- package/dist/components/util/ssr-safe.d.ts.map +1 -0
- package/dist/index.d.ts +42 -7
- package/dist/index.js +45 -10
- package/dist/lib/layout-width-tokens.d.ts +17 -0
- package/dist/lib/layout-width-tokens.d.ts.map +1 -0
- package/dist/lib/showcase/component-docs/Button.d.ts +3 -0
- package/dist/lib/showcase/component-docs/Button.d.ts.map +1 -0
- package/dist/lib/showcase/component-docs/Input.d.ts +3 -0
- package/dist/lib/showcase/component-docs/Input.d.ts.map +1 -0
- package/dist/lib/showcase/component-docs/List.d.ts +3 -0
- package/dist/lib/showcase/component-docs/List.d.ts.map +1 -0
- package/dist/lib/showcase/component-docs/Modal.d.ts +3 -0
- package/dist/lib/showcase/component-docs/Modal.d.ts.map +1 -0
- package/dist/lib/showcase/component-docs/Radio.d.ts +3 -0
- package/dist/lib/showcase/component-docs/Radio.d.ts.map +1 -0
- package/dist/lib/showcase/component-docs/SidebarNavigation.d.ts +3 -0
- package/dist/lib/showcase/component-docs/SidebarNavigation.d.ts.map +1 -0
- package/dist/lib/showcase/component-docs/Skeleton.d.ts +3 -0
- package/dist/lib/showcase/component-docs/Skeleton.d.ts.map +1 -0
- package/dist/lib/showcase/component-docs/_shared.d.ts +12 -0
- package/dist/lib/showcase/component-docs/_shared.d.ts.map +1 -0
- package/dist/lib/showcase/component-docs/index.d.ts +4 -0
- package/dist/lib/showcase/component-docs/index.d.ts.map +1 -0
- package/dist/lib/showcase/components-catalog.d.ts +3 -0
- package/dist/lib/showcase/components-catalog.d.ts.map +1 -0
- package/dist/lib/showcase/components-showcase-constants.d.ts +89 -0
- package/dist/lib/showcase/components-showcase-constants.d.ts.map +1 -0
- package/dist/lib/showcase/docs-sidebar-helpers.d.ts +15 -0
- package/dist/lib/showcase/docs-sidebar-helpers.d.ts.map +1 -0
- package/dist/molecules/Alert.svelte +50 -23
- package/dist/molecules/Alert.svelte.d.ts +1 -1
- package/dist/molecules/ComponentDemo.svelte +54 -51
- package/dist/molecules/ContactForm.svelte +70 -65
- package/dist/molecules/Dropdown.svelte +99 -108
- package/dist/molecules/Dropdown.svelte.d.ts +12 -6
- package/dist/molecules/EmptyState.svelte +44 -0
- package/dist/molecules/EmptyState.svelte.d.ts +11 -0
- package/dist/molecules/FormField.svelte +89 -0
- package/dist/molecules/FormField.svelte.d.ts +23 -0
- package/dist/molecules/Header.svelte +41 -0
- package/dist/molecules/Header.svelte.d.ts +10 -0
- package/dist/molecules/ImageUpload.svelte +1 -1
- package/dist/molecules/Modal.svelte +39 -26
- package/dist/molecules/Modal.svelte.d.ts +4 -2
- package/dist/molecules/NavigationMenu.svelte +16 -0
- package/dist/molecules/NavigationMenu.svelte.d.ts +2 -0
- package/dist/molecules/NavigationMenuContent.svelte +9 -1
- package/dist/molecules/NavigationMenuLink.svelte +1 -1
- package/dist/molecules/NavigationMenuTrigger.svelte +9 -4
- package/dist/molecules/Page.svelte +16 -0
- package/dist/molecules/Page.svelte.d.ts +8 -0
- package/dist/molecules/PropsTable.svelte +61 -0
- package/dist/molecules/PropsTable.svelte.d.ts +8 -0
- package/dist/molecules/RadioGroup.svelte +197 -0
- package/dist/molecules/RadioGroup.svelte.d.ts +20 -0
- package/dist/molecules/Section.svelte +14 -23
- package/dist/molecules/Section.svelte.d.ts +2 -11
- package/dist/molecules/SidebarBrandHeader.svelte +68 -0
- package/dist/molecules/SidebarBrandHeader.svelte.d.ts +10 -0
- package/dist/molecules/SidebarFooter.svelte +119 -0
- package/dist/molecules/SidebarFooter.svelte.d.ts +23 -0
- package/dist/molecules/SidebarNavSection.svelte +49 -0
- package/dist/molecules/SidebarNavSection.svelte.d.ts +14 -0
- package/dist/molecules/SlideUp.svelte +21 -16
- package/dist/molecules/SlideUp.svelte.d.ts +1 -1
- package/dist/molecules/Tabs.svelte +6 -11
- package/dist/molecules/Toaster.svelte +21 -0
- package/dist/molecules/Toaster.svelte.d.ts +6 -0
- package/dist/molecules/ToasterToast.svelte +217 -0
- package/dist/molecules/ToasterToast.svelte.d.ts +7 -0
- package/dist/molecules/index.d.ts +10 -0
- package/dist/molecules/index.js +10 -0
- package/dist/molecules/navigation-menu-context.d.ts +11 -0
- package/dist/molecules/navigation-menu-context.js +18 -0
- package/dist/molecules/toast-store.d.ts +38 -0
- package/dist/molecules/toast-store.js +34 -0
- package/dist/organisms/SidebarAccountPanel.svelte +118 -0
- package/dist/organisms/SidebarAccountPanel.svelte.d.ts +20 -0
- package/dist/organisms/SidebarNavigation.svelte +286 -212
- package/dist/organisms/SidebarNavigation.svelte.d.ts +22 -1
- package/dist/organisms/{SidebarProjectPanel.svelte → SidebarPanel.svelte} +67 -34
- package/dist/organisms/{SidebarProjectPanel.svelte.d.ts → SidebarPanel.svelte.d.ts} +9 -6
- package/dist/organisms/TopNavbar.svelte +214 -0
- package/dist/organisms/TopNavbar.svelte.d.ts +35 -0
- package/dist/organisms/index.d.ts +3 -3
- package/dist/organisms/index.js +3 -3
- package/dist/routes/lib/focus-utils.d.ts +7 -18
- package/dist/routes/lib/focus-utils.ts +32 -34
- package/dist/routes/lib/ssr-safe.ts +5 -4
- package/dist/routes/lib/variant-utils.ts +48 -39
- package/dist/types/components.d.ts +187 -0
- package/dist/types/components.d.ts.map +1 -0
- package/dist/types/events.d.ts +200 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/index.d.ts +171 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/page.types.d.ts +3 -0
- package/dist/types/page.types.d.ts.map +1 -0
- package/dist/types/page.types.js +1 -0
- package/dist/types/page.types.ts +79 -0
- package/dist/types/variants.d.ts +3 -0
- package/dist/types/variants.d.ts.map +1 -0
- package/dist/types/variants.js +1 -0
- package/dist/types/variants.ts +75 -0
- package/dist/util/fixed-sidebar-flyout.d.ts +22 -0
- package/dist/util/fixed-sidebar-flyout.js +148 -0
- package/dist/util/focus-utils.d.ts +11 -0
- package/dist/util/focus-utils.js +94 -0
- package/dist/util/ssr-safe.d.ts +16 -0
- package/dist/util/ssr-safe.js +48 -0
- package/dist/zabi-components-colors.css +360 -324
- package/dist/zabi-components-theme-dark-only.css +164 -151
- package/dist/zabi-components-theme-dark.css +164 -151
- package/dist/zabi-components-theme-only.css +253 -230
- package/dist/zabi-components-theme.css +253 -230
- package/dist/zabi-components.css +1262 -241
- package/docs/theme-imports.md +112 -0
- package/package.json +32 -10
- package/dist/organisms/Navbar.svelte +0 -92
- package/dist/organisms/Navbar.svelte.d.ts +0 -14
- package/dist/organisms/Navigation.svelte +0 -119
- package/dist/organisms/Navigation.svelte.d.ts +0 -21
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,KAAK,CAAC;CAChB;AAGD,MAAM,WAAW,GAAG;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACrD,KAAK,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WA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'./events.js';
|
|
2
|
+
export * from './variants.js';
|
|
3
|
+
export * from './page.types.js';
|
|
4
|
+
import type { Component } from 'svelte';
|
|
5
|
+
export type ZabiComponent<T extends Record<string, any> = Record<string, any>, E extends Record<string, any> = Record<string, any>> = Component<T, E>;
|
|
6
|
+
export interface ButtonProps {
|
|
7
|
+
variant?: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'info' | 'ghost' | 'link' | 'neutral';
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
type?: 'button' | 'submit' | 'reset';
|
|
12
|
+
className?: string;
|
|
13
|
+
text?: string;
|
|
14
|
+
iconLeft?: string | any;
|
|
15
|
+
iconRight?: string | any;
|
|
16
|
+
ariaLabel?: string;
|
|
17
|
+
ariaDescribedBy?: string;
|
|
18
|
+
ariaExpanded?: boolean;
|
|
19
|
+
ariaControls?: string;
|
|
20
|
+
ariaPressed?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface ButtonEvents {
|
|
23
|
+
click: {
|
|
24
|
+
value: boolean;
|
|
25
|
+
event: MouseEvent;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface HeadingProps {
|
|
29
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface CardProps {
|
|
33
|
+
variant?: 'default' | 'elevated' | 'outlined' | 'flat';
|
|
34
|
+
size?: 'sm' | 'md' | 'lg';
|
|
35
|
+
fullWidth?: boolean;
|
|
36
|
+
className?: string;
|
|
37
|
+
onclick?: (event: MouseEvent) => void | Promise<void>;
|
|
38
|
+
/** Required when card is interactive (has onclick) for accessibility */
|
|
39
|
+
ariaLabel?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface InputProps {
|
|
42
|
+
type?: string;
|
|
43
|
+
value?: string;
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
className?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface InputEvents {
|
|
49
|
+
input: {
|
|
50
|
+
value: string;
|
|
51
|
+
event: Event;
|
|
52
|
+
};
|
|
53
|
+
change: {
|
|
54
|
+
value: string;
|
|
55
|
+
event: Event;
|
|
56
|
+
};
|
|
57
|
+
focus: {
|
|
58
|
+
event: FocusEvent;
|
|
59
|
+
};
|
|
60
|
+
blur: {
|
|
61
|
+
event: FocusEvent;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export interface CheckboxProps {
|
|
65
|
+
checked?: boolean;
|
|
66
|
+
disabled?: boolean;
|
|
67
|
+
className?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface CheckboxEvents {
|
|
70
|
+
change: {
|
|
71
|
+
checked: boolean;
|
|
72
|
+
event: Event;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export interface SelectProps {
|
|
76
|
+
options: Array<{
|
|
77
|
+
value: string;
|
|
78
|
+
label: string;
|
|
79
|
+
}>;
|
|
80
|
+
value?: string;
|
|
81
|
+
searchable?: boolean;
|
|
82
|
+
searchPlaceholder?: string;
|
|
83
|
+
maxMenuHeight?: string;
|
|
84
|
+
menuWidth?: string;
|
|
85
|
+
noResultsText?: string;
|
|
86
|
+
disabled?: boolean;
|
|
87
|
+
className?: string;
|
|
88
|
+
}
|
|
89
|
+
export interface SelectEvents {
|
|
90
|
+
change: {
|
|
91
|
+
value: string;
|
|
92
|
+
event: Event;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export interface TextareaProps {
|
|
96
|
+
value?: string;
|
|
97
|
+
placeholder?: string;
|
|
98
|
+
rows?: number;
|
|
99
|
+
disabled?: boolean;
|
|
100
|
+
className?: string;
|
|
101
|
+
}
|
|
102
|
+
export interface TextareaEvents {
|
|
103
|
+
input: {
|
|
104
|
+
value: string;
|
|
105
|
+
event: Event;
|
|
106
|
+
};
|
|
107
|
+
change: {
|
|
108
|
+
value: string;
|
|
109
|
+
event: Event;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export interface ModalProps {
|
|
113
|
+
open?: boolean;
|
|
114
|
+
title?: string;
|
|
115
|
+
className?: string;
|
|
116
|
+
}
|
|
117
|
+
export interface ModalEvents {
|
|
118
|
+
}
|
|
119
|
+
export interface AlertProps {
|
|
120
|
+
type?: 'success' | 'error' | 'warning' | 'info';
|
|
121
|
+
message: string;
|
|
122
|
+
className?: string;
|
|
123
|
+
}
|
|
124
|
+
export interface BadgeProps {
|
|
125
|
+
variant?: 'default' | 'success' | 'warning' | 'error' | 'info';
|
|
126
|
+
text?: string;
|
|
127
|
+
className?: string;
|
|
128
|
+
}
|
|
129
|
+
export interface ProgressProps {
|
|
130
|
+
value?: number;
|
|
131
|
+
max?: number;
|
|
132
|
+
className?: string;
|
|
133
|
+
}
|
|
134
|
+
export interface SkeletonProps {
|
|
135
|
+
variant?: 'text' | 'circle' | 'block';
|
|
136
|
+
width?: string | number;
|
|
137
|
+
height?: string | number;
|
|
138
|
+
class?: string;
|
|
139
|
+
'aria-label'?: string;
|
|
140
|
+
}
|
|
141
|
+
export interface ToggleProps {
|
|
142
|
+
checked?: boolean;
|
|
143
|
+
disabled?: boolean;
|
|
144
|
+
className?: string;
|
|
145
|
+
}
|
|
146
|
+
export interface ToggleEvents {
|
|
147
|
+
change: {
|
|
148
|
+
checked: boolean;
|
|
149
|
+
event: Event;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
export interface TooltipProps {
|
|
153
|
+
content: string;
|
|
154
|
+
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
155
|
+
className?: string;
|
|
156
|
+
}
|
|
157
|
+
export type Button = ZabiComponent<ButtonProps, ButtonEvents>;
|
|
158
|
+
export type Heading = ZabiComponent<HeadingProps>;
|
|
159
|
+
export type Card = ZabiComponent<CardProps>;
|
|
160
|
+
export type Input = ZabiComponent<InputProps, InputEvents>;
|
|
161
|
+
export type Checkbox = ZabiComponent<CheckboxProps, CheckboxEvents>;
|
|
162
|
+
export type Select = ZabiComponent<SelectProps, SelectEvents>;
|
|
163
|
+
export type Textarea = ZabiComponent<TextareaProps, TextareaEvents>;
|
|
164
|
+
export type Modal = ZabiComponent<ModalProps, ModalEvents>;
|
|
165
|
+
export type Alert = ZabiComponent<AlertProps>;
|
|
166
|
+
export type Badge = ZabiComponent<BadgeProps>;
|
|
167
|
+
export type Progress = ZabiComponent<ProgressProps>;
|
|
168
|
+
export type Skeleton = ZabiComponent<SkeletonProps>;
|
|
169
|
+
export type Toggle = ZabiComponent<ToggleProps, ToggleEvents>;
|
|
170
|
+
export type Tooltip = ZabiComponent<TooltipProps>;
|
|
171
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAGA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAIhC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAGtJ,MAAM,WAAW,WAAW;IACxB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAC7G,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EA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QAAQ,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,QAAQ,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,MAAM,GAAG,aAAa,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AAC9D,MAAM,MAAM,OAAO,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.types.d.ts","sourceRoot":"","sources":["../../src/types/page.types.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,cAAc,mCAAmC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export interface NavItem {
|
|
2
|
+
label: string;
|
|
3
|
+
href: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface ContactFormData {
|
|
7
|
+
name: string;
|
|
8
|
+
email: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
subscribe?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ComponentMetadata {
|
|
14
|
+
name: string;
|
|
15
|
+
category: 'atoms' | 'molecules' | 'organisms';
|
|
16
|
+
description: string;
|
|
17
|
+
props: ComponentProp[];
|
|
18
|
+
variants?: string[];
|
|
19
|
+
examples: ComponentExample[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ComponentProp {
|
|
23
|
+
name: string;
|
|
24
|
+
type: string;
|
|
25
|
+
required: boolean;
|
|
26
|
+
defaultValue?: string;
|
|
27
|
+
description: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ComponentExample {
|
|
31
|
+
title: string;
|
|
32
|
+
description: string;
|
|
33
|
+
code: string;
|
|
34
|
+
language?: string;
|
|
35
|
+
/** Optional demo id for rendering live previews via a registry. */
|
|
36
|
+
demoId?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type ComponentCategory = 'atoms' | 'molecules' | 'organisms';
|
|
40
|
+
|
|
41
|
+
export type ComponentDocSectionId =
|
|
42
|
+
| 'live'
|
|
43
|
+
| 'snippet'
|
|
44
|
+
| 'variants'
|
|
45
|
+
| 'props'
|
|
46
|
+
| 'guidelines';
|
|
47
|
+
|
|
48
|
+
export interface ComponentDocExample {
|
|
49
|
+
title: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
/** Demo renderer id, resolved via a registry. */
|
|
52
|
+
demoId: string;
|
|
53
|
+
/** Copy/paste ready snippet that matches the live demo. */
|
|
54
|
+
code: string;
|
|
55
|
+
language?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface ComponentDocGuidelines {
|
|
59
|
+
whenToUse: string[];
|
|
60
|
+
whenToAvoid?: string[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface ComponentDoc {
|
|
64
|
+
name: string;
|
|
65
|
+
category: ComponentCategory;
|
|
66
|
+
/** Short description: what it is + when to use. */
|
|
67
|
+
description: string;
|
|
68
|
+
/** Primary live example shown first. */
|
|
69
|
+
defaultExample: ComponentDocExample;
|
|
70
|
+
/** Optional additional examples (variants/states/realistic patterns). */
|
|
71
|
+
examples?: ComponentDocExample[];
|
|
72
|
+
/** Optional list of variants/states, for quick scanning. */
|
|
73
|
+
variantsStates?: string[];
|
|
74
|
+
/** Props/API for the exported component. */
|
|
75
|
+
props: ComponentProp[];
|
|
76
|
+
guidelines?: ComponentDocGuidelines;
|
|
77
|
+
/** Optional section visibility/order overrides (defaults to canonical order). */
|
|
78
|
+
sections?: Array<{ id: ComponentDocSectionId; hidden?: boolean }>;
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../src/types/variants.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../components/types/variants.js';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized variant type definitions for zabi-components
|
|
3
|
+
*
|
|
4
|
+
* This file provides consistent variant naming conventions across all components.
|
|
5
|
+
* Variants are categorized into semantic color variants and style variants.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Semantic color variants - used for state indication
|
|
10
|
+
* These variants use semantic colors (success, warning, error, info) to indicate meaning
|
|
11
|
+
*/
|
|
12
|
+
export type SemanticVariant = 'default' | 'success' | 'warning' | 'error' | 'info';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Extended semantic variants - includes additional semantic colors
|
|
16
|
+
* Used by components that support more semantic states
|
|
17
|
+
*/
|
|
18
|
+
export type ExtendedSemanticVariant = SemanticVariant | 'neutral' | 'energetic';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Button style variants - used for different button styles
|
|
22
|
+
* These are style-based variants, not semantic color variants
|
|
23
|
+
*/
|
|
24
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'ghost' | 'outline' | 'link';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Card style variants - used for different card appearances
|
|
28
|
+
*/
|
|
29
|
+
export type CardVariant = 'default' | 'elevated' | 'outlined' | 'flat';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Component size variants - consistent across all components
|
|
33
|
+
*/
|
|
34
|
+
export type SizeVariant = 'sm' | 'md' | 'lg';
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Helper type to check if a variant is a semantic variant
|
|
38
|
+
*/
|
|
39
|
+
export function isSemanticVariant(variant: string): variant is SemanticVariant {
|
|
40
|
+
return ['default', 'success', 'warning', 'error', 'info'].includes(variant);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Helper type to check if a variant is an extended semantic variant
|
|
45
|
+
*/
|
|
46
|
+
export function isExtendedSemanticVariant(variant: string): variant is ExtendedSemanticVariant {
|
|
47
|
+
return ['default', 'success', 'warning', 'error', 'info', 'neutral', 'energetic'].includes(variant);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Variant naming conventions:
|
|
52
|
+
*
|
|
53
|
+
* 1. Semantic Color Variants (for state indication):
|
|
54
|
+
* - default: Standard/default appearance
|
|
55
|
+
* - success: Positive/successful state (green)
|
|
56
|
+
* - warning: Cautionary state (yellow/amber)
|
|
57
|
+
* - error: Error/dangerous state (red)
|
|
58
|
+
* - info: Informational state (blue)
|
|
59
|
+
* - neutral: Neutral state (gray)
|
|
60
|
+
* - energetic: Energetic/vibrant state (yellow/orange)
|
|
61
|
+
*
|
|
62
|
+
* 2. Style Variants (for visual appearance):
|
|
63
|
+
* - Button: primary, secondary, danger, ghost, outline, link
|
|
64
|
+
* - Card: default, elevated, outlined, flat
|
|
65
|
+
*
|
|
66
|
+
* 3. Size Variants (consistent across components):
|
|
67
|
+
* - sm: Small size
|
|
68
|
+
* - md: Medium size (default)
|
|
69
|
+
* - lg: Large size
|
|
70
|
+
*
|
|
71
|
+
* Usage Guidelines:
|
|
72
|
+
* - Use semantic variants when the variant indicates a state or meaning
|
|
73
|
+
* - Use style variants when the variant changes visual appearance only
|
|
74
|
+
* - Always use SizeVariant for size props
|
|
75
|
+
*/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Action } from "svelte/action";
|
|
2
|
+
export type SidebarFlyoutAlign = "top" | "bottom";
|
|
3
|
+
/** Which trigger inside the flyout root to pin to (when multiple anchors exist). */
|
|
4
|
+
export type SidebarFlyoutAnchorRole = "search" | "profile";
|
|
5
|
+
export interface FixedSidebarFlyoutParams {
|
|
6
|
+
open: boolean;
|
|
7
|
+
align: SidebarFlyoutAlign;
|
|
8
|
+
gap?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Prefer setting this when the root contains both search and profile anchors
|
|
11
|
+
* (same `SidebarNavigation`). Defaults to the first `[data-sidebar-flyout-anchor]`.
|
|
12
|
+
*/
|
|
13
|
+
anchorRole?: SidebarFlyoutAnchorRole;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Pins a flyout with `position: fixed` next to the trigger marked with
|
|
17
|
+
* `[data-sidebar-flyout-anchor]` inside `[data-sidebar-flyout-root]` (typically the
|
|
18
|
+
* search or profile button), updating on scroll and resize.
|
|
19
|
+
* While open, the node is moved to `document.body` so `overflow-y: auto` / scroll
|
|
20
|
+
* ancestors cannot clip it (fixed descendants are still painted inside scrollports).
|
|
21
|
+
*/
|
|
22
|
+
export declare const fixedSidebarFlyout: Action<HTMLElement, FixedSidebarFlyoutParams>;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
function findFlyoutAnchor(root, anchorRole) {
|
|
2
|
+
const el = anchorRole
|
|
3
|
+
? root.querySelector(`[data-sidebar-flyout-anchor="${anchorRole}"]`)
|
|
4
|
+
: root.querySelector("[data-sidebar-flyout-anchor]");
|
|
5
|
+
return el instanceof HTMLElement ? el : null;
|
|
6
|
+
}
|
|
7
|
+
function collectScrollParents(el) {
|
|
8
|
+
const list = [window];
|
|
9
|
+
let node = el;
|
|
10
|
+
while (node) {
|
|
11
|
+
const style = getComputedStyle(node);
|
|
12
|
+
if (/(auto|scroll|overlay)/.test(style.overflowX) ||
|
|
13
|
+
/(auto|scroll|overlay)/.test(style.overflowY)) {
|
|
14
|
+
list.push(node);
|
|
15
|
+
}
|
|
16
|
+
node = node.parentElement;
|
|
17
|
+
}
|
|
18
|
+
return list;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Pins a flyout with `position: fixed` next to the trigger marked with
|
|
22
|
+
* `[data-sidebar-flyout-anchor]` inside `[data-sidebar-flyout-root]` (typically the
|
|
23
|
+
* search or profile button), updating on scroll and resize.
|
|
24
|
+
* While open, the node is moved to `document.body` so `overflow-y: auto` / scroll
|
|
25
|
+
* ancestors cannot clip it (fixed descendants are still painted inside scrollports).
|
|
26
|
+
*/
|
|
27
|
+
export const fixedSidebarFlyout = (node, initialParams) => {
|
|
28
|
+
let currentParams = initialParams;
|
|
29
|
+
let scrollTargets = [];
|
|
30
|
+
let ro;
|
|
31
|
+
let detachScroll;
|
|
32
|
+
const rootHostEl = node.closest("[data-sidebar-flyout-root]");
|
|
33
|
+
const flyoutRoot = rootHostEl instanceof HTMLElement ? rootHostEl : null;
|
|
34
|
+
let teleportParent = null;
|
|
35
|
+
let teleportNext = null;
|
|
36
|
+
const onScrollOrResize = () => {
|
|
37
|
+
requestAnimationFrame(() => applyPosition());
|
|
38
|
+
};
|
|
39
|
+
function attachToBody() {
|
|
40
|
+
if (node.parentElement === document.body) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
teleportParent = node.parentElement;
|
|
44
|
+
teleportNext = node.nextSibling;
|
|
45
|
+
document.body.appendChild(node);
|
|
46
|
+
}
|
|
47
|
+
function restoreFromBody() {
|
|
48
|
+
if (teleportParent &&
|
|
49
|
+
node.parentElement === document.body) {
|
|
50
|
+
teleportParent.insertBefore(node, teleportNext);
|
|
51
|
+
}
|
|
52
|
+
teleportParent = null;
|
|
53
|
+
teleportNext = null;
|
|
54
|
+
}
|
|
55
|
+
function applyPosition() {
|
|
56
|
+
const anchor = flyoutRoot
|
|
57
|
+
? findFlyoutAnchor(flyoutRoot, currentParams.anchorRole)
|
|
58
|
+
: null;
|
|
59
|
+
if (!anchor || !currentParams.open) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const r = anchor.getBoundingClientRect();
|
|
63
|
+
const gap = currentParams.gap ?? 12;
|
|
64
|
+
node.style.position = "fixed";
|
|
65
|
+
node.style.left = `${Math.round(r.right + gap)}px`;
|
|
66
|
+
node.style.right = "auto";
|
|
67
|
+
if (currentParams.align === "bottom") {
|
|
68
|
+
node.style.top = "auto";
|
|
69
|
+
node.style.bottom = `${Math.round(window.innerHeight - r.bottom)}px`;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
node.style.bottom = "auto";
|
|
73
|
+
node.style.top = `${Math.round(r.top)}px`;
|
|
74
|
+
}
|
|
75
|
+
/* Above page chrome / sidebar siblings so panels overlay main content */
|
|
76
|
+
node.style.zIndex = "60";
|
|
77
|
+
const maxW = Math.max(200, window.innerWidth - r.right - gap - 16);
|
|
78
|
+
node.style.maxWidth = `${Math.round(maxW)}px`;
|
|
79
|
+
}
|
|
80
|
+
function clearPosition() {
|
|
81
|
+
node.style.removeProperty("position");
|
|
82
|
+
node.style.removeProperty("left");
|
|
83
|
+
node.style.removeProperty("right");
|
|
84
|
+
node.style.removeProperty("top");
|
|
85
|
+
node.style.removeProperty("bottom");
|
|
86
|
+
node.style.removeProperty("z-index");
|
|
87
|
+
node.style.removeProperty("max-width");
|
|
88
|
+
}
|
|
89
|
+
function bindScroll() {
|
|
90
|
+
unbindScroll();
|
|
91
|
+
const anchor = flyoutRoot
|
|
92
|
+
? findFlyoutAnchor(flyoutRoot, currentParams.anchorRole)
|
|
93
|
+
: null;
|
|
94
|
+
if (!anchor) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
scrollTargets = collectScrollParents(anchor);
|
|
98
|
+
for (const t of scrollTargets) {
|
|
99
|
+
t.addEventListener("scroll", onScrollOrResize, {
|
|
100
|
+
passive: true,
|
|
101
|
+
capture: true,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
window.addEventListener("resize", onScrollOrResize);
|
|
105
|
+
ro = new ResizeObserver(onScrollOrResize);
|
|
106
|
+
ro.observe(anchor);
|
|
107
|
+
detachScroll = () => {
|
|
108
|
+
for (const t of scrollTargets) {
|
|
109
|
+
t.removeEventListener("scroll", onScrollOrResize, {
|
|
110
|
+
capture: true,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
window.removeEventListener("resize", onScrollOrResize);
|
|
114
|
+
ro?.disconnect();
|
|
115
|
+
ro = undefined;
|
|
116
|
+
scrollTargets = [];
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function unbindScroll() {
|
|
120
|
+
detachScroll?.();
|
|
121
|
+
detachScroll = undefined;
|
|
122
|
+
}
|
|
123
|
+
function sync(next) {
|
|
124
|
+
currentParams = next;
|
|
125
|
+
if (!next.open) {
|
|
126
|
+
unbindScroll();
|
|
127
|
+
restoreFromBody();
|
|
128
|
+
clearPosition();
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
queueMicrotask(() => {
|
|
132
|
+
attachToBody();
|
|
133
|
+
applyPosition();
|
|
134
|
+
bindScroll();
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
sync(initialParams);
|
|
138
|
+
return {
|
|
139
|
+
update(next) {
|
|
140
|
+
sync(next);
|
|
141
|
+
},
|
|
142
|
+
destroy() {
|
|
143
|
+
unbindScroll();
|
|
144
|
+
restoreFromBody();
|
|
145
|
+
clearPosition();
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Focus helpers for overlays (modals, sheets). Requires `app.css` focus ring classes. */
|
|
2
|
+
/** From `app.css` `@layer components` — import the library/app stylesheet. */
|
|
3
|
+
export declare const FOCUS_BRAND_CLASS = "focus-brand";
|
|
4
|
+
export declare const FOCUS_NAV_CLASS = "focus-nav";
|
|
5
|
+
export declare function getFocusableElements(container: HTMLElement): HTMLElement[];
|
|
6
|
+
/** Tab wraps first↔last inside `container`. Caller should pair with `saveFocus` / `returnFocus`. */
|
|
7
|
+
export declare function trapFocus(container: HTMLElement): () => void;
|
|
8
|
+
export declare function saveFocus(): void;
|
|
9
|
+
/** Restores focus from the last `saveFocus`. Skips disconnected or unfocusable nodes. */
|
|
10
|
+
export declare function returnFocus(): void;
|
|
11
|
+
export declare function focusFirstElement(container: HTMLElement): void;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/** Focus helpers for overlays (modals, sheets). Requires `app.css` focus ring classes. */
|
|
2
|
+
/** From `app.css` `@layer components` — import the library/app stylesheet. */
|
|
3
|
+
export const FOCUS_BRAND_CLASS = "focus-brand";
|
|
4
|
+
export const FOCUS_NAV_CLASS = "focus-nav";
|
|
5
|
+
export function getFocusableElements(container) {
|
|
6
|
+
const selector = [
|
|
7
|
+
'button:not([disabled])',
|
|
8
|
+
'[href]',
|
|
9
|
+
'input:not([disabled])',
|
|
10
|
+
'select:not([disabled])',
|
|
11
|
+
'textarea:not([disabled])',
|
|
12
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
13
|
+
].join(', ');
|
|
14
|
+
return Array.from(container.querySelectorAll(selector)).filter((el) => {
|
|
15
|
+
const style = window.getComputedStyle(el);
|
|
16
|
+
return style.display !== 'none' && style.visibility !== 'hidden';
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/** Tab wraps first↔last inside `container`. Caller should pair with `saveFocus` / `returnFocus`. */
|
|
20
|
+
export function trapFocus(container) {
|
|
21
|
+
const focusableElements = getFocusableElements(container);
|
|
22
|
+
if (focusableElements.length === 0) {
|
|
23
|
+
return () => { };
|
|
24
|
+
}
|
|
25
|
+
const firstElement = focusableElements[0];
|
|
26
|
+
const lastElement = focusableElements[focusableElements.length - 1];
|
|
27
|
+
firstElement.focus();
|
|
28
|
+
function handleKeydown(event) {
|
|
29
|
+
if (event.key !== 'Tab') {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const currentFocus = document.activeElement;
|
|
33
|
+
if (!focusableElements.includes(currentFocus)) {
|
|
34
|
+
event.preventDefault();
|
|
35
|
+
firstElement.focus();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (event.shiftKey) {
|
|
39
|
+
if (currentFocus === firstElement) {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
lastElement.focus();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
if (currentFocus === lastElement) {
|
|
46
|
+
event.preventDefault();
|
|
47
|
+
firstElement.focus();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
container.addEventListener('keydown', handleKeydown);
|
|
52
|
+
return () => {
|
|
53
|
+
container.removeEventListener('keydown', handleKeydown);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/** One entry per overlay open; `returnFocus` pops LIFO (nested modals). */
|
|
57
|
+
const focusReturnStack = [];
|
|
58
|
+
export function saveFocus() {
|
|
59
|
+
if (typeof document === 'undefined') {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const active = document.activeElement;
|
|
63
|
+
if (active instanceof HTMLElement && active !== document.body) {
|
|
64
|
+
focusReturnStack.push(active);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
focusReturnStack.push(null);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/** Restores focus from the last `saveFocus`. Skips disconnected or unfocusable nodes. */
|
|
71
|
+
export function returnFocus() {
|
|
72
|
+
if (typeof document === 'undefined') {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const el = focusReturnStack.pop();
|
|
76
|
+
if (!el) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (typeof el.focus !== 'function' || !el.isConnected) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
el.focus({ preventScroll: true });
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
/* embeds / shadow roots may reject programmatic focus */
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export function focusFirstElement(container) {
|
|
90
|
+
const focusableElements = getFocusableElements(container);
|
|
91
|
+
if (focusableElements.length > 0) {
|
|
92
|
+
focusableElements[0].focus();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-only guards and id generation for components that run under SSR.
|
|
3
|
+
* `generateId()` is non-deterministic on the client (random) vs counter on the server —
|
|
4
|
+
* use stable ids for ARIA pairs (e.g. `menuId` on NavigationMenu), not for persisted keys.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isBrowser(): boolean;
|
|
7
|
+
export declare function safeWindow(): Window | undefined;
|
|
8
|
+
export declare function safeDocument(): Document | undefined;
|
|
9
|
+
export declare function safeLocalStorage(): Storage | undefined;
|
|
10
|
+
export declare function safeSessionStorage(): Storage | undefined;
|
|
11
|
+
export declare function safeRequestAnimationFrame(callback: FrameRequestCallback): number | undefined;
|
|
12
|
+
export declare function safeSetTimeout(callback: () => void, delay: number): NodeJS.Timeout | undefined;
|
|
13
|
+
export declare function safeClearTimeout(id: NodeJS.Timeout | undefined): void;
|
|
14
|
+
export declare function safeSetInterval(callback: () => void, delay: number): NodeJS.Timeout | undefined;
|
|
15
|
+
export declare function safeClearInterval(id: NodeJS.Timeout | undefined): void;
|
|
16
|
+
export declare function generateId(prefix?: string): string;
|