@enablo/swirlcn-ui 0.0.0-stage → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +30 -2
- package/dist/chunk-3DJWDNQL.js +77 -0
- package/dist/chunk-7XUCETA6.js +447 -0
- package/dist/chunk-KZESIYUN.js +18 -0
- package/dist/flip.d.ts +98 -0
- package/dist/flip.js +158 -0
- package/dist/fonts/Inter-italic.var.woff2 +0 -0
- package/dist/fonts/Inter.var.woff2 +0 -0
- package/dist/fonts/OFL.txt +96 -0
- package/dist/index.d.ts +2459 -0
- package/dist/index.js +8439 -0
- package/dist/server.d.ts +144 -0
- package/dist/server.js +88 -0
- package/dist/spacing-BQaEPbUv.d.ts +59 -0
- package/dist/theme.css +146 -0
- package/package.json +84 -3
- package/src/components/accordion.tsx +102 -0
- package/src/components/action-list.tsx +294 -0
- package/src/components/alert-dialog.tsx +155 -0
- package/src/components/autocomplete.tsx +313 -0
- package/src/components/avatar.tsx +258 -0
- package/src/components/badge.tsx +100 -0
- package/src/components/banner.tsx +112 -0
- package/src/components/button-group.tsx +87 -0
- package/src/components/button.tsx +362 -0
- package/src/components/card.tsx +186 -0
- package/src/components/carousel.tsx +245 -0
- package/src/components/checkbox.tsx +125 -0
- package/src/components/chip.tsx +153 -0
- package/src/components/color-input.tsx +98 -0
- package/src/components/data-cell.tsx +230 -0
- package/src/components/date-input.tsx +223 -0
- package/src/components/date-picker.tsx +276 -0
- package/src/components/description-list.tsx +97 -0
- package/src/components/dialog.tsx +405 -0
- package/src/components/empty-state.tsx +63 -0
- package/src/components/file-chip.tsx +206 -0
- package/src/components/file-uploader.tsx +148 -0
- package/src/components/flip-app-header.tsx +104 -0
- package/src/components/flip-brand.tsx +77 -0
- package/src/components/flip-theme.tsx +95 -0
- package/src/components/form-control.tsx +397 -0
- package/src/components/form-group.tsx +26 -0
- package/src/components/heading.tsx +70 -0
- package/src/components/icon.tsx +119 -0
- package/src/components/image-grid.tsx +285 -0
- package/src/components/inline-notification.tsx +167 -0
- package/src/components/inline-status.tsx +100 -0
- package/src/components/input.tsx +390 -0
- package/src/components/label.tsx +28 -0
- package/src/components/lightbox.tsx +314 -0
- package/src/components/link.tsx +46 -0
- package/src/components/list.tsx +40 -0
- package/src/components/menu.tsx +530 -0
- package/src/components/option-list.tsx +582 -0
- package/src/components/pagination.tsx +336 -0
- package/src/components/popover.tsx +194 -0
- package/src/components/progress.tsx +158 -0
- package/src/components/radio-group.tsx +136 -0
- package/src/components/resource-list.tsx +686 -0
- package/src/components/search.tsx +127 -0
- package/src/components/select.tsx +456 -0
- package/src/components/separator.tsx +93 -0
- package/src/components/skeleton-box.tsx +63 -0
- package/src/components/skeleton-text.tsx +66 -0
- package/src/components/spinner.tsx +83 -0
- package/src/components/stack.tsx +86 -0
- package/src/components/status-indicator.tsx +31 -0
- package/src/components/switch.tsx +90 -0
- package/src/components/table.tsx +242 -0
- package/src/components/tabs.tsx +147 -0
- package/src/components/tag.tsx +169 -0
- package/src/components/text.tsx +126 -0
- package/src/components/textarea.tsx +130 -0
- package/src/components/theme-provider.tsx +115 -0
- package/src/components/thumbnail.tsx +250 -0
- package/src/components/time-input.tsx +123 -0
- package/src/components/toast.tsx +217 -0
- package/src/components/toggle-group.tsx +124 -0
- package/src/components/toolbar.tsx +105 -0
- package/src/components/tooltip.tsx +97 -0
- package/src/components/tree-navigation.tsx +194 -0
- package/src/components/tree-view.tsx +292 -0
- package/src/flip.ts +12 -0
- package/src/index.ts +317 -0
- package/src/lib/date-mask.ts +176 -0
- package/src/lib/field-context.ts +86 -0
- package/src/lib/flip-app-script.ts +38 -0
- package/src/lib/flip-host.ts +84 -0
- package/src/lib/flip-theme-css.ts +90 -0
- package/src/lib/focus.ts +18 -0
- package/src/lib/glyphs.ts +137 -0
- package/src/lib/spacing.ts +93 -0
- package/src/lib/theme-context.ts +27 -0
- package/src/lib/theme-script.ts +49 -0
- package/src/lib/use-mobile.ts +17 -0
- package/src/lib/utils.ts +28 -0
- package/src/server.ts +20 -0
- package/src/styles/fonts/Inter-italic.var.woff2 +0 -0
- package/src/styles/fonts/Inter.var.woff2 +0 -0
- package/src/styles/fonts/OFL.txt +96 -0
- package/src/styles/theme.css +146 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cn } from "../lib/utils";
|
|
3
|
+
|
|
4
|
+
const ChevronRightIcon = () => (
|
|
5
|
+
<svg viewBox="0 0 24 24" className="size-full" aria-hidden focusable={false}>
|
|
6
|
+
<path
|
|
7
|
+
d="M8.59999 17.4C8.38333 17.1834 8.27499 16.9167 8.27499 16.6C8.27499 16.2834 8.38333 16.0167 8.59999 15.8L12.4 12L8.59999 8.20002C8.38333 7.98336 8.27499 7.71669 8.27499 7.40002C8.27499 7.08336 8.38333 6.81669 8.59999 6.60002C8.81666 6.38336 9.08333 6.27502 9.39999 6.27502C9.71666 6.27502 9.98333 6.38336 10.2 6.60002L14.8 11.2C14.9167 11.3167 15 11.4417 15.05 11.575C15.1 11.7084 15.125 11.85 15.125 12C15.125 12.15 15.1 12.2917 15.05 12.425C15 12.5584 14.9167 12.6834 14.8 12.8L10.2 17.4C9.98333 17.6167 9.71666 17.725 9.39999 17.725C9.08333 17.725 8.81666 17.6167 8.59999 17.4Z"
|
|
8
|
+
fill="currentColor"
|
|
9
|
+
/>
|
|
10
|
+
</svg>
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
const ExpandMoreIcon = () => (
|
|
14
|
+
<svg viewBox="0 0 24 24" className="size-full" aria-hidden focusable={false}>
|
|
15
|
+
<path
|
|
16
|
+
d="M12 15.075C11.85 15.075 11.7083 15.05 11.575 15C11.4417 14.95 11.3167 14.875 11.2 14.775L6.57501 10.15C6.35835 9.93338 6.25435 9.67072 6.26301 9.36205C6.27101 9.05405 6.38335 8.79172 6.60001 8.57505C6.81668 8.35838 7.08335 8.25005 7.40001 8.25005C7.71668 8.25005 7.98335 8.35838 8.20001 8.57505L12 12.375L15.825 8.55005C16.0417 8.33338 16.3043 8.22938 16.613 8.23805C16.921 8.24605 17.1833 8.35838 17.4 8.57505C17.6167 8.79172 17.725 9.05838 17.725 9.37505C17.725 9.69172 17.6167 9.95838 17.4 10.175L12.8 14.775C12.6833 14.875 12.5583 14.95 12.425 15C12.2917 15.05 12.15 15.075 12 15.075Z"
|
|
17
|
+
fill="currentColor"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
/* ---------------------------------------------------------------- context */
|
|
23
|
+
|
|
24
|
+
interface TreeViewContextValue {
|
|
25
|
+
semantics: "tree" | "list";
|
|
26
|
+
isExpanded: (itemId: string) => boolean;
|
|
27
|
+
setExpanded: (itemId: string, expanded: boolean) => void;
|
|
28
|
+
/** The item that holds the tab stop. */
|
|
29
|
+
tabStop: string | undefined;
|
|
30
|
+
setTabStop: (itemId: string) => void;
|
|
31
|
+
expandedIcon?: React.ReactNode;
|
|
32
|
+
collapsedIcon?: React.ReactNode;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const TreeViewContext = React.createContext<TreeViewContextValue | null>(null);
|
|
36
|
+
const LevelContext = React.createContext(0);
|
|
37
|
+
|
|
38
|
+
function useTreeView() {
|
|
39
|
+
const context = React.useContext(TreeViewContext);
|
|
40
|
+
if (!context) throw new Error("TreeViewItem must be used inside a TreeView.");
|
|
41
|
+
return context;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* ------------------------------------------------------------------- tree */
|
|
45
|
+
|
|
46
|
+
export interface TreeViewProps
|
|
47
|
+
extends Omit<React.ComponentProps<"ul">, "onChange"> {
|
|
48
|
+
/** Accessible name of the tree. */
|
|
49
|
+
label?: string;
|
|
50
|
+
/** Items expanded at first. Swirl's `initiallyExpandedItemIds`. */
|
|
51
|
+
defaultExpandedItemIds?: string[];
|
|
52
|
+
/** Expanded items, controlled. */
|
|
53
|
+
expandedItemIds?: string[];
|
|
54
|
+
onExpandedItemIdsChange?: (itemIds: string[]) => void;
|
|
55
|
+
/**
|
|
56
|
+
* `tree` is an interactive tree. `list` drops the tree roles and the
|
|
57
|
+
* toggles and shows every item, for a static outline.
|
|
58
|
+
*/
|
|
59
|
+
semantics?: "tree" | "list";
|
|
60
|
+
/** Replace the toggle shown on expanded items. */
|
|
61
|
+
expandedIcon?: React.ReactNode;
|
|
62
|
+
/** Replace the toggle shown on collapsed items. */
|
|
63
|
+
collapsedIcon?: React.ReactNode;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** The tree items that are on screen, in reading order. */
|
|
67
|
+
const visibleItems = (tree: HTMLElement) =>
|
|
68
|
+
Array.from(tree.querySelectorAll<HTMLElement>('[role="treeitem"]')).filter(
|
|
69
|
+
(item) => item.offsetParent !== null,
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Swirl's tree view: nested items with toggles and guide lines. It is one tab
|
|
74
|
+
* stop: arrow keys move through the visible items, Right expands or steps
|
|
75
|
+
* into an item, Left collapses or steps out to its parent, and Home and End
|
|
76
|
+
* jump to the ends.
|
|
77
|
+
*/
|
|
78
|
+
export function TreeView({
|
|
79
|
+
className,
|
|
80
|
+
label,
|
|
81
|
+
defaultExpandedItemIds = [],
|
|
82
|
+
expandedItemIds,
|
|
83
|
+
onExpandedItemIdsChange,
|
|
84
|
+
semantics = "tree",
|
|
85
|
+
expandedIcon,
|
|
86
|
+
collapsedIcon,
|
|
87
|
+
onKeyDown,
|
|
88
|
+
children,
|
|
89
|
+
...props
|
|
90
|
+
}: TreeViewProps) {
|
|
91
|
+
const ref = React.useRef<HTMLUListElement>(null);
|
|
92
|
+
const [uncontrolled, setUncontrolled] = React.useState(defaultExpandedItemIds);
|
|
93
|
+
const expanded = expandedItemIds ?? uncontrolled;
|
|
94
|
+
const [tabStop, setTabStop] = React.useState<string>();
|
|
95
|
+
|
|
96
|
+
const setExpanded = (itemId: string, open: boolean) => {
|
|
97
|
+
const next = open
|
|
98
|
+
? Array.from(new Set([...expanded, itemId]))
|
|
99
|
+
: expanded.filter((id) => id !== itemId);
|
|
100
|
+
if (expandedItemIds === undefined) setUncontrolled(next);
|
|
101
|
+
onExpandedItemIdsChange?.(next);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// Until an item is focused, the first one holds the tab stop. It moves to
|
|
105
|
+
// the first visible item again if the one holding it is collapsed away or
|
|
106
|
+
// removed, so it runs when the expansion or the items change.
|
|
107
|
+
React.useLayoutEffect(() => {
|
|
108
|
+
if (semantics !== "tree" || !ref.current) return;
|
|
109
|
+
const items = visibleItems(ref.current);
|
|
110
|
+
if (!items.some((item) => item.dataset.itemId === tabStop)) {
|
|
111
|
+
setTabStop(items[0]?.dataset.itemId);
|
|
112
|
+
}
|
|
113
|
+
}, [semantics, tabStop, expanded, children]);
|
|
114
|
+
|
|
115
|
+
const context: TreeViewContextValue = {
|
|
116
|
+
semantics,
|
|
117
|
+
isExpanded: (itemId) => semantics === "list" || expanded.includes(itemId),
|
|
118
|
+
setExpanded,
|
|
119
|
+
tabStop,
|
|
120
|
+
setTabStop,
|
|
121
|
+
expandedIcon,
|
|
122
|
+
collapsedIcon,
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<TreeViewContext.Provider value={context}>
|
|
127
|
+
<ul
|
|
128
|
+
ref={ref}
|
|
129
|
+
role={semantics === "tree" ? "tree" : undefined}
|
|
130
|
+
aria-label={label}
|
|
131
|
+
className={cn("m-0 flex list-none flex-col gap-0.5 p-0 pb-1", className)}
|
|
132
|
+
onKeyDown={(event) => {
|
|
133
|
+
onKeyDown?.(event);
|
|
134
|
+
const tree = ref.current;
|
|
135
|
+
if (event.defaultPrevented || semantics !== "tree" || !tree) return;
|
|
136
|
+
const items = visibleItems(tree);
|
|
137
|
+
const current = (document.activeElement as HTMLElement | null)?.closest<HTMLElement>(
|
|
138
|
+
'[role="treeitem"]',
|
|
139
|
+
);
|
|
140
|
+
const index = current ? items.indexOf(current) : -1;
|
|
141
|
+
if (index === -1) return;
|
|
142
|
+
const itemId = current!.dataset.itemId!;
|
|
143
|
+
const hasChildren = current!.getAttribute("aria-expanded") !== null;
|
|
144
|
+
const isOpen = current!.getAttribute("aria-expanded") === "true";
|
|
145
|
+
const focus = (item: HTMLElement | undefined) => item?.focus();
|
|
146
|
+
|
|
147
|
+
switch (event.key) {
|
|
148
|
+
case "ArrowDown":
|
|
149
|
+
focus(items[index + 1]);
|
|
150
|
+
break;
|
|
151
|
+
case "ArrowUp":
|
|
152
|
+
focus(items[index - 1]);
|
|
153
|
+
break;
|
|
154
|
+
case "Home":
|
|
155
|
+
focus(items[0]);
|
|
156
|
+
break;
|
|
157
|
+
case "End":
|
|
158
|
+
focus(items[items.length - 1]);
|
|
159
|
+
break;
|
|
160
|
+
case "ArrowRight":
|
|
161
|
+
if (hasChildren && !isOpen) setExpanded(itemId, true);
|
|
162
|
+
else if (isOpen) focus(items[index + 1]);
|
|
163
|
+
break;
|
|
164
|
+
case "ArrowLeft":
|
|
165
|
+
if (isOpen) setExpanded(itemId, false);
|
|
166
|
+
else {
|
|
167
|
+
// Step out to the item whose group holds this one.
|
|
168
|
+
const parent = current!
|
|
169
|
+
.closest('[role="group"]')
|
|
170
|
+
?.parentElement?.querySelector<HTMLElement>(':scope > [role="treeitem"]');
|
|
171
|
+
focus(parent ?? undefined);
|
|
172
|
+
}
|
|
173
|
+
break;
|
|
174
|
+
default:
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
event.preventDefault();
|
|
178
|
+
}}
|
|
179
|
+
{...props}
|
|
180
|
+
>
|
|
181
|
+
{children}
|
|
182
|
+
</ul>
|
|
183
|
+
</TreeViewContext.Provider>
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* ------------------------------------------------------------------- item */
|
|
188
|
+
|
|
189
|
+
export interface TreeViewItemProps
|
|
190
|
+
extends Omit<React.ComponentProps<"a">, "children"> {
|
|
191
|
+
/** Unique id, used for expansion and focus. */
|
|
192
|
+
itemId: string;
|
|
193
|
+
label: React.ReactNode;
|
|
194
|
+
/** Leading icon, or an emoji. */
|
|
195
|
+
icon?: React.ReactNode;
|
|
196
|
+
/** Marks the item as the current page. */
|
|
197
|
+
active?: boolean;
|
|
198
|
+
/** Small tags after the label, such as a draft `Tag`. */
|
|
199
|
+
tags?: React.ReactNode;
|
|
200
|
+
/** Show a toggle for an item with children. Defaults to true. */
|
|
201
|
+
expandable?: boolean;
|
|
202
|
+
/** Nested `TreeViewItem`s. */
|
|
203
|
+
children?: React.ReactNode;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export function TreeViewItem({
|
|
207
|
+
className,
|
|
208
|
+
itemId,
|
|
209
|
+
label,
|
|
210
|
+
icon,
|
|
211
|
+
active = false,
|
|
212
|
+
tags,
|
|
213
|
+
expandable = true,
|
|
214
|
+
children,
|
|
215
|
+
onFocus,
|
|
216
|
+
...props
|
|
217
|
+
}: TreeViewItemProps) {
|
|
218
|
+
const tree = useTreeView();
|
|
219
|
+
const level = React.useContext(LevelContext);
|
|
220
|
+
const hasChildren = React.Children.toArray(children).some(React.isValidElement);
|
|
221
|
+
const isTree = tree.semantics === "tree";
|
|
222
|
+
const expanded = tree.isExpanded(itemId);
|
|
223
|
+
const toggle = (event: React.MouseEvent) => {
|
|
224
|
+
event.preventDefault();
|
|
225
|
+
event.stopPropagation();
|
|
226
|
+
tree.setExpanded(itemId, !expanded);
|
|
227
|
+
};
|
|
228
|
+
return (
|
|
229
|
+
<li role={isTree ? "none" : undefined} className="block list-none">
|
|
230
|
+
<a
|
|
231
|
+
role={isTree ? "treeitem" : undefined}
|
|
232
|
+
data-item-id={itemId}
|
|
233
|
+
aria-level={isTree ? level + 1 : undefined}
|
|
234
|
+
aria-expanded={isTree && hasChildren ? expanded : undefined}
|
|
235
|
+
aria-selected={isTree ? tree.tabStop === itemId : undefined}
|
|
236
|
+
aria-current={active ? "page" : undefined}
|
|
237
|
+
tabIndex={isTree ? (tree.tabStop === itemId ? 0 : -1) : undefined}
|
|
238
|
+
className={cn(
|
|
239
|
+
"flex h-9 items-center gap-1 rounded-sm px-2 py-1 text-base font-medium text-foreground no-underline",
|
|
240
|
+
"desktop:text-sm",
|
|
241
|
+
"hover:bg-state-hovered active:bg-state-pressed",
|
|
242
|
+
"outline-focus focus:not-focus-visible:outline-none focus-visible:outline-2 focus-visible:outline-solid",
|
|
243
|
+
active && "bg-state-hovered",
|
|
244
|
+
className,
|
|
245
|
+
)}
|
|
246
|
+
onFocus={(event) => {
|
|
247
|
+
onFocus?.(event);
|
|
248
|
+
if (isTree) tree.setTabStop(itemId);
|
|
249
|
+
}}
|
|
250
|
+
{...props}
|
|
251
|
+
>
|
|
252
|
+
{expandable && isTree && (
|
|
253
|
+
<span className="block size-6 shrink-0 text-icon-default desktop:size-5">
|
|
254
|
+
{hasChildren && (
|
|
255
|
+
<span className="block size-full" onClick={toggle}>
|
|
256
|
+
{expanded
|
|
257
|
+
? (tree.expandedIcon ?? <ExpandMoreIcon />)
|
|
258
|
+
: (tree.collapsedIcon ?? <ChevronRightIcon />)}
|
|
259
|
+
</span>
|
|
260
|
+
)}
|
|
261
|
+
</span>
|
|
262
|
+
)}
|
|
263
|
+
{icon && (
|
|
264
|
+
<span
|
|
265
|
+
className={cn(
|
|
266
|
+
"mr-1 flex size-6 shrink-0 items-center justify-center text-lg text-icon-default",
|
|
267
|
+
"desktop:size-5 desktop:text-base [&>svg]:size-full",
|
|
268
|
+
)}
|
|
269
|
+
>
|
|
270
|
+
{icon}
|
|
271
|
+
</span>
|
|
272
|
+
)}
|
|
273
|
+
<span className="min-w-20 grow truncate">{label}</span>
|
|
274
|
+
{tags && <span className="flex items-center gap-1 pl-1">{tags}</span>}
|
|
275
|
+
</a>
|
|
276
|
+
{hasChildren && (
|
|
277
|
+
<ul
|
|
278
|
+
role={isTree ? "group" : undefined}
|
|
279
|
+
aria-label={typeof label === "string" ? label : undefined}
|
|
280
|
+
className={cn(
|
|
281
|
+
"relative m-0 flex list-none flex-col gap-0.5 p-0 pt-0.5 pl-7 desktop:pl-6",
|
|
282
|
+
// Swirl's guide line, centred under the toggle.
|
|
283
|
+
"before:absolute before:top-0.5 before:bottom-0 before:left-5 before:w-px before:bg-border desktop:before:left-[1.125rem]",
|
|
284
|
+
!expanded && "hidden",
|
|
285
|
+
)}
|
|
286
|
+
>
|
|
287
|
+
<LevelContext.Provider value={level + 1}>{children}</LevelContext.Provider>
|
|
288
|
+
</ul>
|
|
289
|
+
)}
|
|
290
|
+
</li>
|
|
291
|
+
);
|
|
292
|
+
}
|
package/src/flip.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flip embedding helpers for the client: `@enablo/swirlcn-ui/flip`.
|
|
3
|
+
*
|
|
4
|
+
* A separate entry so the main one does not import `@getflip/bridge`, which
|
|
5
|
+
* is an optional peer dependency. Install it to use this entry.
|
|
6
|
+
*/
|
|
7
|
+
export { FlipThemeSync } from "./components/flip-theme";
|
|
8
|
+
export type { FlipThemeSyncProps } from "./components/flip-theme";
|
|
9
|
+
export { FlipAppHeader } from "./components/flip-app-header";
|
|
10
|
+
export type { FlipAppHeaderProps } from "./components/flip-app-header";
|
|
11
|
+
export { closeFlipApp, ensureFlipBridge, flipHost, useFlipHost } from "./lib/flip-host";
|
|
12
|
+
export type { FlipHost } from "./lib/flip-host";
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
/* Utilities */
|
|
2
|
+
export { cn, resolveAlias } from "./lib/utils";
|
|
3
|
+
export { focusRing, focusRingInset } from "./lib/focus";
|
|
4
|
+
export { spacingScale, gap, gapX, gapY, padding } from "./lib/spacing";
|
|
5
|
+
export type { SwirlSpacing } from "./lib/spacing";
|
|
6
|
+
|
|
7
|
+
/* Primitives */
|
|
8
|
+
export { Button, buttonVariants } from "./components/button";
|
|
9
|
+
export type {
|
|
10
|
+
ButtonProps,
|
|
11
|
+
ButtonIntent,
|
|
12
|
+
ButtonSize,
|
|
13
|
+
ButtonVariant,
|
|
14
|
+
ShadcnButtonSize,
|
|
15
|
+
ShadcnButtonVariant,
|
|
16
|
+
} from "./components/button";
|
|
17
|
+
export { ButtonGroup } from "./components/button-group";
|
|
18
|
+
export type { ButtonGroupProps } from "./components/button-group";
|
|
19
|
+
export { Link } from "./components/link";
|
|
20
|
+
export type { LinkProps } from "./components/link";
|
|
21
|
+
|
|
22
|
+
export { Text, textVariants } from "./components/text";
|
|
23
|
+
export { List } from "./components/list";
|
|
24
|
+
export type { ListProps } from "./components/list";
|
|
25
|
+
export type { TextProps, TextColor, TextSize, TextWeight } from "./components/text";
|
|
26
|
+
|
|
27
|
+
export { Heading } from "./components/heading";
|
|
28
|
+
export type { HeadingProps, HeadingLevel } from "./components/heading";
|
|
29
|
+
|
|
30
|
+
export { Icon } from "./components/icon";
|
|
31
|
+
export type { IconProps } from "./components/icon";
|
|
32
|
+
|
|
33
|
+
export { Spinner } from "./components/spinner";
|
|
34
|
+
export type { SpinnerProps } from "./components/spinner";
|
|
35
|
+
|
|
36
|
+
export { SkeletonText } from "./components/skeleton-text";
|
|
37
|
+
export type { SkeletonTextProps, SkeletonTextSize } from "./components/skeleton-text";
|
|
38
|
+
export { SkeletonBox } from "./components/skeleton-box";
|
|
39
|
+
export type { SkeletonBoxProps } from "./components/skeleton-box";
|
|
40
|
+
|
|
41
|
+
export { Separator } from "./components/separator";
|
|
42
|
+
export type { SeparatorProps, SeparatorSpacing } from "./components/separator";
|
|
43
|
+
|
|
44
|
+
/* Layout */
|
|
45
|
+
export { Stack } from "./components/stack";
|
|
46
|
+
export type { StackProps, StackOrientation } from "./components/stack";
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
Card,
|
|
50
|
+
CardContent,
|
|
51
|
+
CardDescription,
|
|
52
|
+
CardFooter,
|
|
53
|
+
CardHeader,
|
|
54
|
+
CardTitle,
|
|
55
|
+
cardVariants,
|
|
56
|
+
} from "./components/card";
|
|
57
|
+
export type { CardProps } from "./components/card";
|
|
58
|
+
|
|
59
|
+
/* Status + content markers */
|
|
60
|
+
export { Badge, badgeVariants } from "./components/badge";
|
|
61
|
+
export type { BadgeProps, BadgeIntent } from "./components/badge";
|
|
62
|
+
|
|
63
|
+
export { Tag, tagVariants } from "./components/tag";
|
|
64
|
+
export type { TagProps } from "./components/tag";
|
|
65
|
+
export { Chip } from "./components/chip";
|
|
66
|
+
export type { ChipProps } from "./components/chip";
|
|
67
|
+
|
|
68
|
+
export { Avatar, AvatarGroup, avatarColorFor, initialsFor } from "./components/avatar";
|
|
69
|
+
export type { AvatarProps, AvatarGroupProps, AvatarColor, AvatarSize } from "./components/avatar";
|
|
70
|
+
|
|
71
|
+
export { Progress } from "./components/progress";
|
|
72
|
+
export type { ProgressProps, ProgressSize, ProgressIntent } from "./components/progress";
|
|
73
|
+
|
|
74
|
+
/* Forms */
|
|
75
|
+
export { Label } from "./components/label";
|
|
76
|
+
export type { LabelProps } from "./components/label";
|
|
77
|
+
|
|
78
|
+
export { FormControl } from "./components/form-control";
|
|
79
|
+
export type { FormControlProps, FormControlField } from "./components/form-control";
|
|
80
|
+
|
|
81
|
+
export { FormGroup } from "./components/form-group";
|
|
82
|
+
export type { FormGroupProps } from "./components/form-group";
|
|
83
|
+
|
|
84
|
+
export { useField } from "./lib/field-context";
|
|
85
|
+
export type { FieldContextValue, FieldLabelPosition, FieldFontSize } from "./lib/field-context";
|
|
86
|
+
|
|
87
|
+
export { Input, inputVariants } from "./components/input";
|
|
88
|
+
export type { InputProps } from "./components/input";
|
|
89
|
+
|
|
90
|
+
export { Textarea } from "./components/textarea";
|
|
91
|
+
export type { TextareaProps } from "./components/textarea";
|
|
92
|
+
|
|
93
|
+
export { Checkbox } from "./components/checkbox";
|
|
94
|
+
export type { CheckboxProps } from "./components/checkbox";
|
|
95
|
+
|
|
96
|
+
export { Radio, RadioGroup } from "./components/radio-group";
|
|
97
|
+
export type { RadioProps, RadioGroupProps } from "./components/radio-group";
|
|
98
|
+
|
|
99
|
+
export { Switch } from "./components/switch";
|
|
100
|
+
export type { SwitchProps } from "./components/switch";
|
|
101
|
+
|
|
102
|
+
export { Select, SelectOption, SelectSection } from "./components/select";
|
|
103
|
+
export type {
|
|
104
|
+
SelectProps,
|
|
105
|
+
SingleSelectProps,
|
|
106
|
+
MultiSelectProps,
|
|
107
|
+
SelectOptionProps,
|
|
108
|
+
SelectSectionProps,
|
|
109
|
+
} from "./components/select";
|
|
110
|
+
|
|
111
|
+
export { Autocomplete } from "./components/autocomplete";
|
|
112
|
+
export type {
|
|
113
|
+
AutocompleteProps,
|
|
114
|
+
AutocompleteSuggestion,
|
|
115
|
+
SingleAutocompleteProps,
|
|
116
|
+
MultiAutocompleteProps,
|
|
117
|
+
} from "./components/autocomplete";
|
|
118
|
+
|
|
119
|
+
export { DatePicker } from "./components/date-picker";
|
|
120
|
+
export type {
|
|
121
|
+
DatePickerProps,
|
|
122
|
+
DatePickerLabels,
|
|
123
|
+
SingleDatePickerProps,
|
|
124
|
+
RangeDatePickerProps,
|
|
125
|
+
} from "./components/date-picker";
|
|
126
|
+
|
|
127
|
+
export { DateInput } from "./components/date-input";
|
|
128
|
+
export type { DateInputProps } from "./components/date-input";
|
|
129
|
+
|
|
130
|
+
export { TimeInput } from "./components/time-input";
|
|
131
|
+
export type { TimeInputProps } from "./components/time-input";
|
|
132
|
+
|
|
133
|
+
export { ColorInput } from "./components/color-input";
|
|
134
|
+
export type { ColorInputProps } from "./components/color-input";
|
|
135
|
+
|
|
136
|
+
export { FileUploader } from "./components/file-uploader";
|
|
137
|
+
export type { FileUploaderProps, FileUploaderHandle } from "./components/file-uploader";
|
|
138
|
+
|
|
139
|
+
export { Search } from "./components/search";
|
|
140
|
+
export type { SearchProps } from "./components/search";
|
|
141
|
+
|
|
142
|
+
export { Toolbar } from "./components/toolbar";
|
|
143
|
+
export type { ToolbarProps } from "./components/toolbar";
|
|
144
|
+
export { ToggleGroup, ToggleGroupItem } from "./components/toggle-group";
|
|
145
|
+
export type { ToggleGroupProps, ToggleGroupItemProps } from "./components/toggle-group";
|
|
146
|
+
|
|
147
|
+
/* Overlays */
|
|
148
|
+
export {
|
|
149
|
+
Dialog,
|
|
150
|
+
DialogBody,
|
|
151
|
+
DialogClose,
|
|
152
|
+
DialogContent,
|
|
153
|
+
DialogDescription,
|
|
154
|
+
DialogFooter,
|
|
155
|
+
DialogHeader,
|
|
156
|
+
DialogOverlay,
|
|
157
|
+
DialogPortal,
|
|
158
|
+
DialogTitle,
|
|
159
|
+
DialogTrigger,
|
|
160
|
+
dialogContentVariants,
|
|
161
|
+
} from "./components/dialog";
|
|
162
|
+
export type { DialogContentProps } from "./components/dialog";
|
|
163
|
+
|
|
164
|
+
export {
|
|
165
|
+
Popover,
|
|
166
|
+
PopoverAnchor,
|
|
167
|
+
PopoverClose,
|
|
168
|
+
PopoverContent,
|
|
169
|
+
PopoverTrigger,
|
|
170
|
+
} from "./components/popover";
|
|
171
|
+
export type { PopoverProps, PopoverContentProps } from "./components/popover";
|
|
172
|
+
|
|
173
|
+
export {
|
|
174
|
+
Tooltip,
|
|
175
|
+
TooltipContent,
|
|
176
|
+
TooltipProvider,
|
|
177
|
+
TooltipRoot,
|
|
178
|
+
TooltipTrigger,
|
|
179
|
+
} from "./components/tooltip";
|
|
180
|
+
export type { TooltipProps } from "./components/tooltip";
|
|
181
|
+
|
|
182
|
+
export { Menu, MenuItem } from "./components/menu";
|
|
183
|
+
export type { MenuProps, MenuItemProps, MenuPlacement } from "./components/menu";
|
|
184
|
+
|
|
185
|
+
export {
|
|
186
|
+
AlertDialog,
|
|
187
|
+
AlertDialogAction,
|
|
188
|
+
AlertDialogCancel,
|
|
189
|
+
AlertDialogContent,
|
|
190
|
+
AlertDialogDescription,
|
|
191
|
+
AlertDialogFooter,
|
|
192
|
+
AlertDialogHeader,
|
|
193
|
+
AlertDialogOverlay,
|
|
194
|
+
AlertDialogPortal,
|
|
195
|
+
AlertDialogTitle,
|
|
196
|
+
AlertDialogTrigger,
|
|
197
|
+
} from "./components/alert-dialog";
|
|
198
|
+
export type { AlertDialogContentProps, AlertDialogFooterProps } from "./components/alert-dialog";
|
|
199
|
+
|
|
200
|
+
export { OptionList, OptionListItem, OptionListSection } from "./components/option-list";
|
|
201
|
+
export type {
|
|
202
|
+
OptionListProps,
|
|
203
|
+
OptionListItemProps,
|
|
204
|
+
OptionListSectionProps,
|
|
205
|
+
OptionListItemDrop,
|
|
206
|
+
} from "./components/option-list";
|
|
207
|
+
export { ActionList, ActionListItem, ActionListSection } from "./components/action-list";
|
|
208
|
+
export type {
|
|
209
|
+
ActionListProps,
|
|
210
|
+
ActionListItemProps,
|
|
211
|
+
ActionListSectionProps,
|
|
212
|
+
} from "./components/action-list";
|
|
213
|
+
|
|
214
|
+
/* Navigation + disclosure */
|
|
215
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger } from "./components/tabs";
|
|
216
|
+
export type { TabsListProps } from "./components/tabs";
|
|
217
|
+
|
|
218
|
+
export {
|
|
219
|
+
Accordion,
|
|
220
|
+
AccordionContent,
|
|
221
|
+
AccordionItem,
|
|
222
|
+
AccordionTrigger,
|
|
223
|
+
} from "./components/accordion";
|
|
224
|
+
export type { AccordionTriggerProps } from "./components/accordion";
|
|
225
|
+
|
|
226
|
+
export { TreeView, TreeViewItem } from "./components/tree-view";
|
|
227
|
+
export type { TreeViewProps, TreeViewItemProps } from "./components/tree-view";
|
|
228
|
+
export { TreeNavigation, TreeNavigationItem } from "./components/tree-navigation";
|
|
229
|
+
export type { TreeNavigationProps, TreeNavigationItemProps } from "./components/tree-navigation";
|
|
230
|
+
export { Pagination } from "./components/pagination";
|
|
231
|
+
export type { PaginationProps } from "./components/pagination";
|
|
232
|
+
|
|
233
|
+
/* Feedback */
|
|
234
|
+
export {
|
|
235
|
+
Alert,
|
|
236
|
+
AlertDescription,
|
|
237
|
+
AlertTitle,
|
|
238
|
+
InlineNotification,
|
|
239
|
+
notificationVariants,
|
|
240
|
+
} from "./components/inline-notification";
|
|
241
|
+
export type {
|
|
242
|
+
AlertProps,
|
|
243
|
+
InlineNotificationProps,
|
|
244
|
+
NotificationIntent,
|
|
245
|
+
} from "./components/inline-notification";
|
|
246
|
+
|
|
247
|
+
export { StatusIndicator } from "./components/status-indicator";
|
|
248
|
+
export type { StatusIndicatorProps } from "./components/status-indicator";
|
|
249
|
+
export { InlineStatus, InlineError } from "./components/inline-status";
|
|
250
|
+
export type { InlineStatusProps, InlineErrorProps } from "./components/inline-status";
|
|
251
|
+
export { Banner, bannerVariants } from "./components/banner";
|
|
252
|
+
export type { BannerProps } from "./components/banner";
|
|
253
|
+
|
|
254
|
+
export { ToastProvider, useToast, toastVariants } from "./components/toast";
|
|
255
|
+
export type { ToastIntent, ToastOptions, ToastProviderProps } from "./components/toast";
|
|
256
|
+
|
|
257
|
+
export { EmptyState } from "./components/empty-state";
|
|
258
|
+
export type { EmptyStateProps } from "./components/empty-state";
|
|
259
|
+
|
|
260
|
+
/* Data */
|
|
261
|
+
export {
|
|
262
|
+
Table,
|
|
263
|
+
TableBody,
|
|
264
|
+
TableCell,
|
|
265
|
+
TableEmpty,
|
|
266
|
+
TableFooter,
|
|
267
|
+
TableHead,
|
|
268
|
+
TableHeader,
|
|
269
|
+
TableRow,
|
|
270
|
+
} from "./components/table";
|
|
271
|
+
export type {
|
|
272
|
+
TableProps,
|
|
273
|
+
TableRowProps,
|
|
274
|
+
TableHeadProps,
|
|
275
|
+
TableCellProps,
|
|
276
|
+
TableEmptyProps,
|
|
277
|
+
} from "./components/table";
|
|
278
|
+
|
|
279
|
+
export { DescriptionList, DescriptionListItem } from "./components/description-list";
|
|
280
|
+
export type { DescriptionListProps, DescriptionListItemProps } from "./components/description-list";
|
|
281
|
+
|
|
282
|
+
export { DataCell, DataCellStack } from "./components/data-cell";
|
|
283
|
+
export type { DataCellProps, DataCellStackProps } from "./components/data-cell";
|
|
284
|
+
|
|
285
|
+
export { FileChip } from "./components/file-chip";
|
|
286
|
+
export type { FileChipProps } from "./components/file-chip";
|
|
287
|
+
|
|
288
|
+
export { Thumbnail } from "./components/thumbnail";
|
|
289
|
+
export type { ThumbnailProps } from "./components/thumbnail";
|
|
290
|
+
|
|
291
|
+
export { ImageGrid, ImageGridItem } from "./components/image-grid";
|
|
292
|
+
export type { ImageGridProps, ImageGridItemProps } from "./components/image-grid";
|
|
293
|
+
|
|
294
|
+
export { Lightbox, LightboxSlide } from "./components/lightbox";
|
|
295
|
+
export type { LightboxProps, LightboxSlideProps } from "./components/lightbox";
|
|
296
|
+
|
|
297
|
+
export { Carousel, CarouselSlide } from "./components/carousel";
|
|
298
|
+
export type { CarouselProps, CarouselSlideProps, CarouselHandle } from "./components/carousel";
|
|
299
|
+
|
|
300
|
+
export {
|
|
301
|
+
ResourceList,
|
|
302
|
+
ResourceListFileItem,
|
|
303
|
+
ResourceListItem,
|
|
304
|
+
ResourceListSection,
|
|
305
|
+
} from "./components/resource-list";
|
|
306
|
+
export type {
|
|
307
|
+
ResourceListProps,
|
|
308
|
+
ResourceListItemProps,
|
|
309
|
+
ResourceListItemDrop,
|
|
310
|
+
ResourceListSectionProps,
|
|
311
|
+
ResourceListFileItemProps,
|
|
312
|
+
} from "./components/resource-list";
|
|
313
|
+
|
|
314
|
+
/* Theming */
|
|
315
|
+
export { ThemeProvider, useTheme, useOptionalTheme } from "./components/theme-provider";
|
|
316
|
+
// ThemeScript and themeScript are server-safe and live in @enablo/swirlcn-ui/server.
|
|
317
|
+
export type { Theme, ThemeProviderProps } from "./components/theme-provider";
|