@k8ordo/ui 1.0.0 → 2.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 +37 -12
- package/dist/components/ai/conversation/conversation.d.mts +8 -10
- package/dist/components/ai/conversation/conversation.mjs +1 -6
- package/dist/components/ai/conversation/index.d.mts +15 -1
- package/dist/components/ai/conversation/index.mjs +8 -1
- package/dist/components/ai/index.d.mts +5 -9
- package/dist/components/ai/index.mjs +4 -4
- package/dist/components/ai/message/index.d.mts +12 -1
- package/dist/components/ai/message/index.mjs +7 -1
- package/dist/components/ai/message/message.d.mts +3 -5
- package/dist/components/ai/message/message.mjs +1 -5
- package/dist/components/ai/prompt-input/index.d.mts +23 -1
- package/dist/components/ai/prompt-input/index.mjs +8 -1
- package/dist/components/ai/prompt-input/prompt-input.d.mts +4 -6
- package/dist/components/ai/prompt-input/prompt-input.mjs +1 -6
- package/dist/components/ai/suggestion/index.d.mts +13 -1
- package/dist/components/ai/suggestion/index.mjs +7 -1
- package/dist/components/ai/suggestion/suggestion.d.mts +3 -5
- package/dist/components/ai/suggestion/suggestion.mjs +1 -5
- package/dist/components/buttons/icon-button/icon-button.mjs +1 -1
- package/dist/components/form/checkbox/checkbox.d.mts +1 -0
- package/dist/components/form/checkbox/checkbox.mjs +3 -2
- package/dist/components/form/checkbox-group/index.d.mts +1 -0
- package/dist/components/form/file-field/file-field.d.mts +12 -15
- package/dist/components/form/file-field/file-field.mjs +1 -6
- package/dist/components/form/file-field/index.d.mts +17 -1
- package/dist/components/form/file-field/index.mjs +8 -1
- package/dist/components/form/radio/radio.d.mts +1 -0
- package/dist/components/form/radio/radio.mjs +3 -2
- package/dist/components/index.d.mts +15 -21
- package/dist/components/index.mjs +7 -7
- package/dist/components/navigation/anchor/anchor.mjs +1 -1
- package/dist/components/navigation/tabs/index.d.mts +19 -1
- package/dist/components/navigation/tabs/index.mjs +9 -1
- package/dist/components/navigation/tabs/tabs.d.mts +16 -18
- package/dist/components/navigation/tabs/tabs.mjs +1 -7
- package/dist/components/overlays/dialog/dialog.d.mts +12 -16
- package/dist/components/overlays/dialog/dialog.mjs +1 -6
- package/dist/components/overlays/dialog/index.d.mts +17 -1
- package/dist/components/overlays/dialog/index.mjs +8 -1
- package/dist/components/overlays/dropdown-menu/dropdown-menu.d.mts +20 -24
- package/dist/components/overlays/dropdown-menu/dropdown-menu.mjs +2 -11
- package/dist/components/overlays/dropdown-menu/index.d.mts +31 -1
- package/dist/components/overlays/dropdown-menu/index.mjs +12 -1
- package/dist/components/overlays/dropdown-menu/sub-menu.mjs +1 -1
- package/dist/components/overlays/list-box/index.d.mts +27 -1
- package/dist/components/overlays/list-box/index.mjs +9 -1
- package/dist/components/overlays/list-box/list-box.d.mts +20 -22
- package/dist/components/overlays/list-box/list-box.mjs +2 -8
- package/dist/components/overlays/popover/index.d.mts +24 -1
- package/dist/components/overlays/popover/index.mjs +8 -1
- package/dist/components/overlays/popover/popover.d.mts +18 -20
- package/dist/components/overlays/popover/popover.mjs +2 -7
- package/dist/components/overlays/tooltip/index.d.mts +21 -1
- package/dist/components/overlays/tooltip/index.mjs +8 -1
- package/dist/components/overlays/tooltip/tooltip.d.mts +18 -22
- package/dist/components/overlays/tooltip/tooltip.mjs +2 -7
- package/dist/hooks/index.d.mts +1 -4
- package/dist/hooks/index.mjs +2 -5
- package/dist/index.d.mts +13 -15
- package/dist/index.mjs +9 -12
- package/dist/integrations/_shared/renderers.mjs +7 -7
- package/dist/integrations/_shared/schemas.d.mts +1 -1
- package/dist/{hooks/focus-trap/index.d.mts → internal/focus-trap.d.mts} +1 -1
- package/dist/{hooks/focus-trap/index.mjs → internal/focus-trap.mjs} +1 -1
- package/dist/styles/index.css +0 -8
- package/docs/GUIDE.md +148 -133
- package/docs/llms.txt +11 -7
- package/docs/props.generated.json +18 -0
- package/docs/references/ai-chat.md +67 -67
- package/docs/references/color.md +108 -107
- package/docs/references/components.md +318 -310
- package/docs/references/generative-ui.md +51 -30
- package/docs/references/helpers.md +155 -52
- package/docs/references/hooks.md +61 -74
- package/docs/references/interaction-design.md +47 -47
- package/docs/references/spatial-design.md +83 -81
- package/docs/references/typography.md +68 -67
- package/package.json +32 -33
- package/dist/hooks/hash/index.d.mts +0 -4
- package/dist/hooks/hash/index.mjs +0 -25
- package/dist/hooks/local-storage/index.d.mts +0 -4
- package/dist/hooks/local-storage/index.mjs +0 -46
- package/dist/hooks/session-storage/index.d.mts +0 -4
- package/dist/hooks/session-storage/index.mjs +0 -46
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Spinner } from "./feedback/spinner/spinner.mjs";
|
|
2
2
|
import { Button } from "./buttons/button/button.mjs";
|
|
3
|
-
import { Popover } from "./overlays/popover/
|
|
4
|
-
import { Tooltip } from "./overlays/tooltip/
|
|
3
|
+
import { Popover } from "./overlays/popover/index.mjs";
|
|
4
|
+
import { Tooltip } from "./overlays/tooltip/index.mjs";
|
|
5
5
|
import { IconButton } from "./buttons/icon-button/icon-button.mjs";
|
|
6
6
|
import { ChromeIcon, EdgeIcon, FirefoxIcon, SafariIcon } from "./icons/browsers.mjs";
|
|
7
7
|
import { ColorScaleIcon } from "./icons/color-scale.mjs";
|
|
@@ -27,7 +27,7 @@ import { Autocomplete } from "./form/autocomplete/autocomplete.mjs";
|
|
|
27
27
|
import { Checkbox } from "./form/checkbox/checkbox.mjs";
|
|
28
28
|
import { CheckboxCard } from "./form/checkbox-card/checkbox-card.mjs";
|
|
29
29
|
import { CheckboxGroup } from "./form/checkbox-group/index.mjs";
|
|
30
|
-
import { FileField } from "./form/file-field/
|
|
30
|
+
import { FileField } from "./form/file-field/index.mjs";
|
|
31
31
|
import { Form } from "./form/form/form.mjs";
|
|
32
32
|
import { FormControl } from "./form/form-control/form-control.mjs";
|
|
33
33
|
import { NumberField } from "./form/number-field/number-field.mjs";
|
|
@@ -46,12 +46,12 @@ import { Stack } from "./layout/stack/stack.mjs";
|
|
|
46
46
|
import { Anchor } from "./navigation/anchor/anchor.mjs";
|
|
47
47
|
import { Breadcrumb } from "./navigation/breadcrumb/index.mjs";
|
|
48
48
|
import { Pagination } from "./navigation/pagination/pagination.mjs";
|
|
49
|
-
import { Tabs } from "./navigation/tabs/
|
|
50
|
-
import { Dialog } from "./overlays/dialog/
|
|
49
|
+
import { Tabs } from "./navigation/tabs/index.mjs";
|
|
50
|
+
import { Dialog } from "./overlays/dialog/index.mjs";
|
|
51
51
|
import { UIProvider } from "./providers/ui-provider.mjs";
|
|
52
52
|
import { PortalRootProvider, usePortalRoot } from "./providers/portal-root.mjs";
|
|
53
53
|
import { Modal } from "./overlays/modal/modal.mjs";
|
|
54
54
|
import { Drawer } from "./overlays/drawer/drawer.mjs";
|
|
55
|
-
import { DropdownMenu } from "./overlays/dropdown-menu/
|
|
56
|
-
import { ListBox } from "./overlays/list-box/
|
|
55
|
+
import { DropdownMenu } from "./overlays/dropdown-menu/index.mjs";
|
|
56
|
+
import { ListBox } from "./overlays/list-box/index.mjs";
|
|
57
57
|
export { AIIcon, AccessibilityIcon, Accordion, Alert, AlertIcon, Anchor, AssistantIcon, AtomIcon, Autocomplete, Avatar, BadIcon, Badge, BlogIcon, BoringIcon, Breadcrumb, Button, Card, CheckIcon, Checkbox, CheckboxCard, CheckboxGroup, ChevronIcon, ChromeIcon, CloseIcon, Code, CodeXmlIcon, ColorContrastIcon, ColorInfoIcon, ColorScaleIcon, CopyIcon, DarkModeIcon, Dialog, DifficultIcon, Drawer, DropdownMenu, EasyIcon, EdgeIcon, ExternalLinkIcon, FileField, FirefoxIcon, FlaskIcon, ForkIcon, Form, FormControl, FormIcon, FullscreenIcon, GitHubIcon, GoodIcon, Grid, Heading, HistoryIcon, HorizontalWritingIcon, IconButton, InformativeIcon, InterestingIcon, LightModeIcon, LinkIcon, ListBox, ListIcon, LocationIcon, LockIcon, LockOpenIcon, Logo, LogoIcon, MailIcon, MinusIcon, MixedColorIcon, Modal, NavigationMenuIcon, NewsIcon, NumberField, PackageIcon, Pagination, PaletteIcon, PasswordInput, PlusIcon, Popover, PortalRootProvider, PrepareIcon, Progress, PublishDateIcon, QiitaIcon, RSSIcon, Radio, RadioCard, RefreshIcon, SafariIcon, ScrollLinked, Select, SendIcon, Separator, ShallowIcon, ShieldCheckIcon, Skeleton, SlideIcon, Slider, SparklesIcon, Spinner, SquircleIcon, Stack, SubscribeIcon, Switch, Table, TableIcon, Tabs, TagIcon, TextField, Textarea, ToastProvider, Tooltip, TwitterIcon, UIProvider, UpdateDateIcon, VerticalWritingIcon, ViewIcon, ViewOffIcon, usePortalRoot, useToast };
|
|
@@ -7,7 +7,7 @@ const defaultRenderAnchor = ({ children: anchorChildren, ...rest }) => /* @__PUR
|
|
|
7
7
|
});
|
|
8
8
|
const Anchor = ({ href, children, openInNewTab = false, renderAnchor = defaultRenderAnchor, ...rest }) => {
|
|
9
9
|
const kind = !href.startsWith("http") && !openInNewTab ? "internal" : "external";
|
|
10
|
-
const baseClassName = "text-fg-info underline transition-colors hover:text-fg-
|
|
10
|
+
const baseClassName = "text-fg-info underline transition-colors hover:text-fg-base focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border-info focus-visible:rounded-sm";
|
|
11
11
|
const props = kind === "internal" ? {
|
|
12
12
|
className: baseClassName,
|
|
13
13
|
children
|
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/components/navigation/tabs/index.d.ts
|
|
2
|
+
declare const Tabs: {
|
|
3
|
+
readonly Root: import("react").FC<import("react").PropsWithChildren<{
|
|
4
|
+
defaultSelectedId?: string | null;
|
|
5
|
+
selectedId?: string;
|
|
6
|
+
onChange?: (id: string) => void;
|
|
7
|
+
ids: [string, ...string[]];
|
|
8
|
+
}>>;
|
|
9
|
+
readonly List: import("react").FC<import("react").PropsWithChildren<{
|
|
10
|
+
label: string;
|
|
11
|
+
}>>;
|
|
12
|
+
readonly Tab: import("react").FC<import("react").PropsWithChildren<{
|
|
13
|
+
id: string;
|
|
14
|
+
}>>;
|
|
15
|
+
readonly Panel: import("react").FC<import("react").PropsWithChildren<{
|
|
16
|
+
id: string;
|
|
17
|
+
}>>;
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
2
20
|
export { Tabs };
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from "react";
|
|
2
2
|
//#region src/components/navigation/tabs/tabs.d.ts
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}>>;
|
|
19
|
-
};
|
|
3
|
+
declare const Root: FC<PropsWithChildren<{
|
|
4
|
+
defaultSelectedId?: string | null;
|
|
5
|
+
selectedId?: string;
|
|
6
|
+
onChange?: (id: string) => void;
|
|
7
|
+
ids: [string, ...string[]];
|
|
8
|
+
}>>;
|
|
9
|
+
declare const List: FC<PropsWithChildren<{
|
|
10
|
+
label: string;
|
|
11
|
+
}>>;
|
|
12
|
+
declare const Tab: FC<PropsWithChildren<{
|
|
13
|
+
id: string;
|
|
14
|
+
}>>;
|
|
15
|
+
declare const Panel: FC<PropsWithChildren<{
|
|
16
|
+
id: string;
|
|
17
|
+
}>>;
|
|
20
18
|
//#endregion
|
|
21
|
-
export {
|
|
19
|
+
export { List, Panel, Root, Tab };
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { FC, PropsWithChildren, ReactNode, Ref } from "react";
|
|
2
2
|
//#region src/components/overlays/dialog/dialog.d.ts
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
readonly Content: FC<{
|
|
15
|
-
children?: ReactNode | undefined;
|
|
16
|
-
}>;
|
|
17
|
-
};
|
|
3
|
+
declare const Root: FC<PropsWithChildren<{
|
|
4
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
5
|
+
id?: string | undefined;
|
|
6
|
+
tabIndex?: number | undefined;
|
|
7
|
+
role?: 'dialog' | 'alertdialog' | undefined;
|
|
8
|
+
}>>;
|
|
9
|
+
declare const Header: FC<{
|
|
10
|
+
title: ReactNode;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
}>;
|
|
13
|
+
declare const Content: FC<PropsWithChildren>;
|
|
18
14
|
//#endregion
|
|
19
|
-
export {
|
|
15
|
+
export { Content, Header, Root };
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/components/overlays/dialog/index.d.ts
|
|
2
|
+
declare const Dialog: {
|
|
3
|
+
readonly Root: import("react").FC<import("react").PropsWithChildren<{
|
|
4
|
+
ref?: import("react").Ref<HTMLElement> | undefined;
|
|
5
|
+
id?: string | undefined;
|
|
6
|
+
tabIndex?: number | undefined;
|
|
7
|
+
role?: 'dialog' | 'alertdialog' | undefined;
|
|
8
|
+
}>>;
|
|
9
|
+
readonly Header: import("react").FC<{
|
|
10
|
+
title: import("react").ReactNode;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
}>;
|
|
13
|
+
readonly Content: import("react").FC<{
|
|
14
|
+
children?: import("react").ReactNode | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
2
18
|
export { Dialog };
|
|
@@ -1,34 +1,30 @@
|
|
|
1
1
|
import { Button } from "../../buttons/button/button.mjs";
|
|
2
2
|
import "../../buttons/button/index.mjs";
|
|
3
3
|
import { Placement } from "../../../types/variables.mjs";
|
|
4
|
-
import { SubMenuProps } from "./sub-menu.mjs";
|
|
5
4
|
import { ComponentProps, FC, PropsWithChildren, ReactNode } from "react";
|
|
6
5
|
//#region src/components/overlays/dropdown-menu/dropdown-menu.d.ts
|
|
6
|
+
declare const Root: FC<PropsWithChildren<{
|
|
7
|
+
placement?: Placement;
|
|
8
|
+
isOpen?: boolean;
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
onChange?: (isOpen: boolean) => void;
|
|
11
|
+
}>>;
|
|
12
|
+
declare const Content: FC<PropsWithChildren>;
|
|
7
13
|
type ItemProps = {
|
|
8
14
|
onAction: () => void;
|
|
9
15
|
label: string;
|
|
10
16
|
};
|
|
11
|
-
declare const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
readonly Trigger: FC<{
|
|
24
|
-
label: string;
|
|
25
|
-
size?: ComponentProps<typeof Button>['size'];
|
|
26
|
-
variant?: ComponentProps<typeof Button>['variant'];
|
|
27
|
-
}>;
|
|
28
|
-
readonly IconTrigger: FC<{
|
|
29
|
-
icon: ReactNode;
|
|
30
|
-
label: string;
|
|
31
|
-
}>;
|
|
32
|
-
};
|
|
17
|
+
declare const Item: FC<ItemProps & {
|
|
18
|
+
index?: number;
|
|
19
|
+
}>;
|
|
20
|
+
declare const Trigger: FC<{
|
|
21
|
+
label: string;
|
|
22
|
+
size?: ComponentProps<typeof Button>['size'];
|
|
23
|
+
variant?: ComponentProps<typeof Button>['variant'];
|
|
24
|
+
}>;
|
|
25
|
+
declare const IconTrigger: FC<{
|
|
26
|
+
icon: ReactNode;
|
|
27
|
+
label: string;
|
|
28
|
+
}>;
|
|
33
29
|
//#endregion
|
|
34
|
-
export {
|
|
30
|
+
export { Content, IconTrigger, Item, ItemProps, Root, Trigger };
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
import { Button } from "../../buttons/button/button.mjs";
|
|
3
3
|
import { useListNavigation } from "../_internal/use-list-navigation.mjs";
|
|
4
4
|
import { useOpenContext } from "../popover/hooks.mjs";
|
|
5
|
-
import { Popover } from "../popover/
|
|
5
|
+
import { Popover } from "../popover/index.mjs";
|
|
6
6
|
import { IconButton } from "../../buttons/icon-button/icon-button.mjs";
|
|
7
7
|
import { ChevronIcon } from "../../icons/lucide.mjs";
|
|
8
8
|
import { MenuContextProvider, useMenuContent, useMenuItem } from "./hooks.mjs";
|
|
9
9
|
import { cloneWithIndex, itemClass, panelClass } from "./shared.mjs";
|
|
10
|
-
import { SubMenu } from "./sub-menu.mjs";
|
|
11
10
|
import { useState } from "react";
|
|
12
11
|
import { jsx } from "react/jsx-runtime";
|
|
13
12
|
//#region src/components/overlays/dropdown-menu/dropdown-menu.tsx
|
|
@@ -73,13 +72,5 @@ const IconTrigger = ({ icon, label }) => /* @__PURE__ */ jsx(Popover.Trigger, {
|
|
|
73
72
|
...props,
|
|
74
73
|
children: icon
|
|
75
74
|
}) });
|
|
76
|
-
const DropdownMenu = {
|
|
77
|
-
Root,
|
|
78
|
-
Content,
|
|
79
|
-
Item,
|
|
80
|
-
SubMenu,
|
|
81
|
-
Trigger,
|
|
82
|
-
IconTrigger
|
|
83
|
-
};
|
|
84
75
|
//#endregion
|
|
85
|
-
export {
|
|
76
|
+
export { Content, IconTrigger, Item, Root, Trigger };
|
|
@@ -1,2 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Button } from "../../buttons/button/button.mjs";
|
|
2
|
+
import { Placement } from "../../../types/variables.mjs";
|
|
3
|
+
import { ItemProps } from "./dropdown-menu.mjs";
|
|
4
|
+
import { SubMenuProps } from "./sub-menu.mjs";
|
|
5
|
+
import "../../index.mjs";
|
|
6
|
+
import "../../../index.mjs";
|
|
7
|
+
import { FC } from "react";
|
|
8
|
+
//#region src/components/overlays/dropdown-menu/index.d.ts
|
|
9
|
+
declare const DropdownMenu: {
|
|
10
|
+
readonly Root: FC<import("react").PropsWithChildren<{
|
|
11
|
+
placement?: Placement;
|
|
12
|
+
isOpen?: boolean;
|
|
13
|
+
defaultOpen?: boolean;
|
|
14
|
+
onChange?: (isOpen: boolean) => void;
|
|
15
|
+
}>>;
|
|
16
|
+
readonly Content: FC<{
|
|
17
|
+
children?: import("react").ReactNode | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
readonly Item: FC<ItemProps>;
|
|
20
|
+
readonly SubMenu: FC<SubMenuProps>;
|
|
21
|
+
readonly Trigger: FC<{
|
|
22
|
+
label: string;
|
|
23
|
+
size?: import("react").ComponentProps<typeof Button>['size'];
|
|
24
|
+
variant?: import("react").ComponentProps<typeof Button>['variant'];
|
|
25
|
+
}>;
|
|
26
|
+
readonly IconTrigger: FC<{
|
|
27
|
+
icon: import("react").ReactNode;
|
|
28
|
+
label: string;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
2
32
|
export { DropdownMenu };
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Content, IconTrigger, Item, Root, Trigger } from "./dropdown-menu.mjs";
|
|
2
|
+
import { SubMenu } from "./sub-menu.mjs";
|
|
3
|
+
//#region src/components/overlays/dropdown-menu/index.ts
|
|
4
|
+
const DropdownMenu = {
|
|
5
|
+
Root,
|
|
6
|
+
Content,
|
|
7
|
+
Item,
|
|
8
|
+
SubMenu,
|
|
9
|
+
Trigger,
|
|
10
|
+
IconTrigger
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
2
13
|
export { DropdownMenu };
|
|
@@ -5,7 +5,7 @@ import { useCanHover } from "../_internal/use-can-hover.mjs";
|
|
|
5
5
|
import { useHoverIntent } from "../_internal/use-hover-intent.mjs";
|
|
6
6
|
import { useListNavigation } from "../_internal/use-list-navigation.mjs";
|
|
7
7
|
import { useOpenContext, usePopoverContext } from "../popover/hooks.mjs";
|
|
8
|
-
import { Popover } from "../popover/
|
|
8
|
+
import { Popover } from "../popover/index.mjs";
|
|
9
9
|
import { ChevronIcon } from "../../icons/lucide.mjs";
|
|
10
10
|
import { MenuContextProvider, useMenuContext } from "./hooks.mjs";
|
|
11
11
|
import { cloneWithIndex, itemClass, panelClass } from "./shared.mjs";
|
|
@@ -1,2 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Button } from "../../buttons/button/button.mjs";
|
|
2
|
+
import { Option, Placement } from "../../../types/variables.mjs";
|
|
3
|
+
import "../../index.mjs";
|
|
4
|
+
import "../../../index.mjs";
|
|
5
|
+
//#region src/components/overlays/list-box/index.d.ts
|
|
6
|
+
declare const ListBox: {
|
|
7
|
+
readonly Root: import("react").FC<import("react").PropsWithChildren<{
|
|
8
|
+
placement?: Placement;
|
|
9
|
+
options: readonly Option[];
|
|
10
|
+
value?: Option['value'];
|
|
11
|
+
defaultValue?: Option['value'];
|
|
12
|
+
onChange?: (value: Option['value']) => void;
|
|
13
|
+
}>>;
|
|
14
|
+
readonly Content: import("react").FC<{
|
|
15
|
+
helpContent?: import("react").ReactElement;
|
|
16
|
+
}>;
|
|
17
|
+
readonly Trigger: import("react").FC<{
|
|
18
|
+
size?: import("react").ComponentProps<typeof Button>['size'];
|
|
19
|
+
label?: string;
|
|
20
|
+
}>;
|
|
21
|
+
readonly IconTrigger: import("react").FC<{
|
|
22
|
+
size?: import("react").ComponentProps<typeof Button>['size'];
|
|
23
|
+
icon: import("react").ReactElement;
|
|
24
|
+
label?: string;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
2
28
|
export { ListBox };
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Content, IconTrigger, Root, Trigger } from "./list-box.mjs";
|
|
2
|
+
//#region src/components/overlays/list-box/index.ts
|
|
3
|
+
const ListBox = {
|
|
4
|
+
Root,
|
|
5
|
+
Content,
|
|
6
|
+
Trigger,
|
|
7
|
+
IconTrigger
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
2
10
|
export { ListBox };
|
|
@@ -3,26 +3,24 @@ import "../../buttons/button/index.mjs";
|
|
|
3
3
|
import { Option, Placement } from "../../../types/variables.mjs";
|
|
4
4
|
import { ComponentProps, FC, PropsWithChildren, ReactElement } from "react";
|
|
5
5
|
//#region src/components/overlays/list-box/list-box.d.ts
|
|
6
|
-
declare const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}>;
|
|
26
|
-
};
|
|
6
|
+
declare const Root: FC<PropsWithChildren<{
|
|
7
|
+
placement?: Placement;
|
|
8
|
+
options: readonly Option[];
|
|
9
|
+
value?: Option['value'];
|
|
10
|
+
defaultValue?: Option['value'];
|
|
11
|
+
onChange?: (value: Option['value']) => void;
|
|
12
|
+
}>>;
|
|
13
|
+
declare const Content: FC<{
|
|
14
|
+
helpContent?: ReactElement;
|
|
15
|
+
}>;
|
|
16
|
+
declare const Trigger: FC<{
|
|
17
|
+
size?: ComponentProps<typeof Button>['size'];
|
|
18
|
+
label?: string;
|
|
19
|
+
}>;
|
|
20
|
+
declare const IconTrigger: FC<{
|
|
21
|
+
size?: ComponentProps<typeof Button>['size'];
|
|
22
|
+
icon: ReactElement;
|
|
23
|
+
label?: string;
|
|
24
|
+
}>;
|
|
27
25
|
//#endregion
|
|
28
|
-
export {
|
|
26
|
+
export { Content, IconTrigger, Root, Trigger };
|
|
@@ -4,7 +4,7 @@ import { Button } from "../../buttons/button/button.mjs";
|
|
|
4
4
|
import { useListNavigation } from "../_internal/use-list-navigation.mjs";
|
|
5
5
|
import { useControllableState } from "../../../hooks/controllable-state/index.mjs";
|
|
6
6
|
import { useOpenContext } from "../popover/hooks.mjs";
|
|
7
|
-
import { Popover } from "../popover/
|
|
7
|
+
import { Popover } from "../popover/index.mjs";
|
|
8
8
|
import { IconButton } from "../../buttons/icon-button/icon-button.mjs";
|
|
9
9
|
import { CheckIcon, ChevronIcon } from "../../icons/lucide.mjs";
|
|
10
10
|
import { MenuContextProvider, useMenuContent, useMenuItem, useMenuTrigger } from "./hooks.mjs";
|
|
@@ -140,11 +140,5 @@ const IconTrigger = ({ size = "md", icon, label }) => {
|
|
|
140
140
|
})]
|
|
141
141
|
})] }) });
|
|
142
142
|
};
|
|
143
|
-
const ListBox = {
|
|
144
|
-
Root,
|
|
145
|
-
Content,
|
|
146
|
-
Trigger,
|
|
147
|
-
IconTrigger
|
|
148
|
-
};
|
|
149
143
|
//#endregion
|
|
150
|
-
export {
|
|
144
|
+
export { Content, IconTrigger, Root, Trigger };
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
import { Placement } from "../../../types/variables.mjs";
|
|
1
2
|
import { PopoverContentProps, PopoverTriggerProps, useOpenContext } from "./hooks.mjs";
|
|
2
|
-
import
|
|
3
|
+
import "./popover.mjs";
|
|
4
|
+
import "../../../index.mjs";
|
|
5
|
+
//#region src/components/overlays/popover/index.d.ts
|
|
6
|
+
declare const Popover: {
|
|
7
|
+
readonly Root: import("react").FC<import("react").PropsWithChildren<{
|
|
8
|
+
placement?: Placement;
|
|
9
|
+
role?: 'dialog' | 'menu' | 'listbox';
|
|
10
|
+
flipDisabled?: boolean;
|
|
11
|
+
closeOnClickAway?: boolean;
|
|
12
|
+
trapFocus?: boolean;
|
|
13
|
+
isOpen?: boolean;
|
|
14
|
+
defaultOpen?: boolean;
|
|
15
|
+
onChange?: (isOpen: boolean) => void;
|
|
16
|
+
}>>;
|
|
17
|
+
readonly Content: import("react").FC<{
|
|
18
|
+
renderItem: (props: PopoverContentProps) => import("react").ReactElement;
|
|
19
|
+
animation?: 'scale' | 'fade';
|
|
20
|
+
}>;
|
|
21
|
+
readonly Trigger: import("react").FC<{
|
|
22
|
+
renderItem: (props: PopoverTriggerProps) => import("react").ReactElement;
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
3
26
|
export { Popover, type PopoverContentProps, type PopoverTriggerProps, useOpenContext };
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { useOpenContext } from "./hooks.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { Content, Root, Trigger } from "./popover.mjs";
|
|
3
|
+
//#region src/components/overlays/popover/index.ts
|
|
4
|
+
const Popover = {
|
|
5
|
+
Root,
|
|
6
|
+
Content,
|
|
7
|
+
Trigger
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
3
10
|
export { Popover, useOpenContext };
|
|
@@ -2,24 +2,22 @@ import { Placement } from "../../../types/variables.mjs";
|
|
|
2
2
|
import { PopoverContentProps, PopoverTriggerProps, useOpenContext } from "./hooks.mjs";
|
|
3
3
|
import { FC, PropsWithChildren, ReactElement } from "react";
|
|
4
4
|
//#region src/components/overlays/popover/popover.d.ts
|
|
5
|
-
declare const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}>;
|
|
23
|
-
};
|
|
5
|
+
declare const Root: FC<PropsWithChildren<{
|
|
6
|
+
placement?: Placement;
|
|
7
|
+
role?: 'dialog' | 'menu' | 'listbox';
|
|
8
|
+
flipDisabled?: boolean;
|
|
9
|
+
closeOnClickAway?: boolean;
|
|
10
|
+
trapFocus?: boolean;
|
|
11
|
+
isOpen?: boolean;
|
|
12
|
+
defaultOpen?: boolean;
|
|
13
|
+
onChange?: (isOpen: boolean) => void;
|
|
14
|
+
}>>;
|
|
15
|
+
declare const Content: FC<{
|
|
16
|
+
renderItem: (props: PopoverContentProps) => ReactElement;
|
|
17
|
+
animation?: 'scale' | 'fade';
|
|
18
|
+
}>;
|
|
19
|
+
declare const Trigger: FC<{
|
|
20
|
+
renderItem: (props: PopoverTriggerProps) => ReactElement;
|
|
21
|
+
}>;
|
|
24
22
|
//#endregion
|
|
25
|
-
export {
|
|
23
|
+
export { Content, type PopoverContentProps, type PopoverTriggerProps, Root, Trigger, useOpenContext };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cn } from "../../../helpers/cn.mjs";
|
|
3
3
|
import { useControllableState } from "../../../hooks/controllable-state/index.mjs";
|
|
4
4
|
import { useWritingMode } from "../../../hooks/writing-mode/index.mjs";
|
|
5
|
-
import { useFocusTrap } from "../../../
|
|
5
|
+
import { useFocusTrap } from "../../../internal/focus-trap.mjs";
|
|
6
6
|
import { getContentAnchorStyle, toAnchorName } from "./anchor-positioning.mjs";
|
|
7
7
|
import { pushEscapeLayer } from "./escape-stack.mjs";
|
|
8
8
|
import { PopoverProvider, useOpenContext, usePopoverContent, usePopoverContext, usePopoverTrigger } from "./hooks.mjs";
|
|
@@ -81,10 +81,5 @@ const Content = ({ renderItem, animation = "scale" }) => {
|
|
|
81
81
|
});
|
|
82
82
|
};
|
|
83
83
|
const Trigger = ({ renderItem }) => renderItem(usePopoverTrigger());
|
|
84
|
-
const Popover = {
|
|
85
|
-
Root,
|
|
86
|
-
Content,
|
|
87
|
-
Trigger
|
|
88
|
-
};
|
|
89
84
|
//#endregion
|
|
90
|
-
export {
|
|
85
|
+
export { Content, Root, Trigger, useOpenContext };
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Placement } from "../../../types/variables.mjs";
|
|
2
|
+
import "../../../index.mjs";
|
|
3
|
+
import { TooltipTriggerProps } from "./tooltip.mjs";
|
|
4
|
+
//#region src/components/overlays/tooltip/index.d.ts
|
|
5
|
+
declare const Tooltip: {
|
|
6
|
+
readonly Root: import("react").FC<import("react").PropsWithChildren<{
|
|
7
|
+
placement?: Placement;
|
|
8
|
+
isOpen?: boolean;
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
onChange?: (isOpen: boolean) => void;
|
|
11
|
+
openDelay?: number;
|
|
12
|
+
closeDelay?: number;
|
|
13
|
+
}>>;
|
|
14
|
+
readonly Trigger: import("react").FC<{
|
|
15
|
+
renderItem: (props: TooltipTriggerProps) => import("react").ReactElement;
|
|
16
|
+
}>;
|
|
17
|
+
readonly Content: import("react").FC<{
|
|
18
|
+
children?: import("react").ReactNode | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
2
22
|
export { Tooltip, type TooltipTriggerProps };
|