pentatrion-design 0.1.0 → 0.1.2
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/components/autocomplete/Autocomplete.d.ts +3 -3
- package/components/autocomplete/Autocomplete.js +8 -8
- package/components/autocomplete/Autocomplete.stories.d.ts +2 -2
- package/components/autocomplete/Autocomplete.stories.js +6 -6
- package/components/autocomplete/AutocompleteOption.d.ts +1 -1
- package/components/autocomplete/AutocompleteOption.js +2 -2
- package/components/autocomplete/LazyAutocomplete.d.ts +2 -2
- package/components/autocomplete/LazyAutocomplete.js +3 -3
- package/components/autocomplete/SimpleAutocomplete.d.ts +2 -2
- package/components/autocomplete/SimpleAutocomplete.js +3 -3
- package/components/autocomplete/_fixtures.d.ts +1 -1
- package/components/autocomplete/index.d.ts +6 -6
- package/components/autocomplete/index.js +6 -6
- package/components/autocomplete/useAutocompleteContext.d.ts +1 -1
- package/components/autocomplete/util.d.ts +1 -1
- package/components/badge/Badge.d.ts +1 -1
- package/components/badge/Badge.js +5 -5
- package/components/badge/Badge.stories.d.ts +1 -1
- package/components/badge/Badge.stories.js +1 -1
- package/components/badge/index.d.ts +1 -1
- package/components/badge/index.js +1 -1
- package/components/button/Button.d.ts +1 -1
- package/components/button/Button.js +2 -2
- package/components/button/Button.stories.d.ts +1 -1
- package/components/button/Button.stories.js +2 -2
- package/components/button/Button.test.js +1 -1
- package/components/button/ButtonGroup.stories.d.ts +1 -1
- package/components/button/ButtonGroup.stories.js +2 -2
- package/components/button/LinkButton.d.ts +1 -1
- package/components/button/LinkButton.js +2 -2
- package/components/button/index.d.ts +3 -3
- package/components/button/index.js +3 -3
- package/components/card/Card.stories.js +1 -1
- package/components/card/index.d.ts +1 -1
- package/components/card/index.js +1 -1
- package/components/code/index.d.ts +1 -1
- package/components/code/index.js +1 -1
- package/components/context-menu/ContextMenu.js +2 -2
- package/components/context-menu/ContextMenu.stories.js +2 -2
- package/components/context-menu/index.d.ts +2 -2
- package/components/context-menu/index.js +2 -2
- package/components/dialog/Dialog.d.ts +1 -1
- package/components/dialog/Dialog.stories.js +2 -2
- package/components/dialog/index.d.ts +1 -1
- package/components/dialog/index.js +1 -1
- package/components/dropdown-menu/DropdownMenu.d.ts +1 -1
- package/components/dropdown-menu/DropdownMenu.js +2 -2
- package/components/dropdown-menu/DropdownMenu.stories.d.ts +1 -1
- package/components/dropdown-menu/DropdownMenu.stories.js +1 -1
- package/components/dropdown-menu/DropdownMenuContent.js +2 -2
- package/components/dropdown-menu/DropdownMenuItem.js +1 -1
- package/components/dropdown-menu/DropdownMenuTrigger.js +2 -2
- package/components/dropdown-menu/index.d.ts +7 -7
- package/components/dropdown-menu/index.js +6 -6
- package/components/dropdown-menu/interface.d.ts +1 -1
- package/components/dropdown-menu/useDropdownMenu.d.ts +2 -2
- package/components/dropdown-menu/useDropdownMenuContext.d.ts +2 -2
- package/components/dropdown-menu-nested/DropdownMenuNested.d.ts +1 -1
- package/components/dropdown-menu-nested/DropdownMenuNested.js +1 -1
- package/components/dropdown-menu-nested/DropdownMenuNested.stories.d.ts +1 -1
- package/components/dropdown-menu-nested/DropdownMenuNested.stories.js +4 -4
- package/components/dropdown-menu-nested/MenuItem.js +1 -1
- package/components/dropdown-menu-nested/MenuItemWithChildren.d.ts +1 -1
- package/components/dropdown-menu-nested/MenuItemWithChildren.js +3 -3
- package/components/dropdown-menu-nested/index.d.ts +3 -3
- package/components/dropdown-menu-nested/index.js +3 -3
- package/components/flash/Flash.d.ts +1 -1
- package/components/flash/Flash.js +1 -1
- package/components/flash/Flash.stories.d.ts +1 -1
- package/components/flash/Flash.stories.js +1 -1
- package/components/flash/index.d.ts +1 -1
- package/components/flash/index.js +1 -1
- package/components/highlight/Highlight.stories.d.ts +1 -1
- package/components/highlight/Highlight.stories.js +3 -3
- package/components/highlight/index.d.ts +1 -1
- package/components/highlight/index.js +1 -1
- package/components/href/Href.stories.d.ts +1 -1
- package/components/href/Href.stories.js +1 -1
- package/components/href/index.d.ts +1 -1
- package/components/href/index.js +1 -1
- package/components/input/Checkbox.d.ts +1 -1
- package/components/input/Checkbox.js +1 -1
- package/components/input/Checkbox.stories.d.ts +1 -1
- package/components/input/Checkbox.stories.js +1 -1
- package/components/input/Color.d.ts +1 -1
- package/components/input/Color.js +1 -1
- package/components/input/Color.stories.d.ts +1 -1
- package/components/input/Color.stories.js +1 -1
- package/components/input/Input.d.ts +1 -1
- package/components/input/Input.stories.d.ts +1 -1
- package/components/input/Input.stories.js +3 -3
- package/components/input/Input.test.js +1 -1
- package/components/input/RadioGroup.d.ts +1 -1
- package/components/input/RadioGroup.js +1 -1
- package/components/input/RadioGroup.stories.d.ts +1 -1
- package/components/input/RadioGroup.stories.js +1 -1
- package/components/input/Range.d.ts +1 -1
- package/components/input/Range.stories.d.ts +1 -1
- package/components/input/Range.stories.js +1 -1
- package/components/input/Toggle.d.ts +1 -1
- package/components/input/Toggle.js +1 -1
- package/components/input/Toggle.stories.d.ts +1 -1
- package/components/input/Toggle.stories.js +1 -1
- package/components/input/index.d.ts +6 -6
- package/components/input/index.js +6 -6
- package/components/input-field/InputField.d.ts +1 -1
- package/components/input-field/InputField.js +1 -1
- package/components/input-field/InputField.stories.d.ts +1 -1
- package/components/input-field/InputField.stories.js +4 -4
- package/components/input-field/index.d.ts +1 -1
- package/components/input-field/index.js +1 -1
- package/components/loader/Loader.d.ts +1 -1
- package/components/loader/Loader.js +1 -1
- package/components/loader/Loader.stories.d.ts +1 -1
- package/components/loader/Loader.stories.js +1 -1
- package/components/loader/index.d.ts +1 -1
- package/components/loader/index.js +1 -1
- package/components/modal/Components.js +3 -3
- package/components/modal/Modal.d.ts +1 -1
- package/components/modal/Modal.js +2 -2
- package/components/modal/Modal.stories.d.ts +1 -1
- package/components/modal/Modal.stories.js +6 -6
- package/components/modal/ModalContent.js +2 -2
- package/components/modal/ModalTrigger.js +2 -2
- package/components/modal/index.d.ts +7 -7
- package/components/modal/index.js +6 -6
- package/components/modal/interface.d.ts +1 -1
- package/components/modal/useModal.d.ts +2 -2
- package/components/modal/useModalContext.d.ts +2 -2
- package/components/notification/Notification.stories.d.ts +1 -1
- package/components/notification/Notification.stories.js +4 -4
- package/components/notification/NotificationsContext.d.ts +1 -1
- package/components/notification/NotificationsContext.js +1 -1
- package/components/notification/NotificationsProvider.js +2 -2
- package/components/notification/index.d.ts +4 -4
- package/components/notification/index.js +4 -4
- package/components/notification/useContextNotifications.d.ts +1 -1
- package/components/notification/useContextNotifications.js +1 -1
- package/components/notification/useFetch.d.ts +1 -1
- package/components/notification/useFetch.js +2 -2
- package/components/popover/Components.js +2 -2
- package/components/popover/Popover.d.ts +1 -1
- package/components/popover/Popover.js +1 -1
- package/components/popover/Popover.stories.d.ts +1 -1
- package/components/popover/Popover.stories.js +4 -4
- package/components/popover/Popover.test.js +1 -1
- package/components/popover/PopoverContent.js +3 -3
- package/components/popover/PopoverTrigger.js +2 -2
- package/components/popover/index.d.ts +7 -7
- package/components/popover/index.js +6 -6
- package/components/popover/interface.d.ts +1 -1
- package/components/popover/usePopover.d.ts +2 -2
- package/components/popover/usePopoverContext.d.ts +2 -2
- package/components/portal/index.d.ts +1 -1
- package/components/portal/index.js +1 -1
- package/components/quick-settings/QuickSettings.stories.js +4 -4
- package/components/resize-area/ResizeArea.stories.d.ts +1 -1
- package/components/resize-area/ResizeArea.stories.js +1 -1
- package/components/resize-area/index.d.ts +1 -1
- package/components/resize-area/index.js +1 -1
- package/components/scroll/Scroll.stories.d.ts +1 -1
- package/components/scroll/Scroll.stories.js +1 -1
- package/components/scroll/index.d.ts +1 -1
- package/components/scroll/index.js +1 -1
- package/components/select/Select.d.ts +2 -2
- package/components/select/Select.js +6 -6
- package/components/select/Select.stories.d.ts +3 -3
- package/components/select/Select.stories.js +2 -2
- package/components/select/Select.test.js +1 -1
- package/components/select/SelectOption.d.ts +1 -1
- package/components/select/SelectOption.js +1 -1
- package/components/select/SelectSelection.d.ts +1 -1
- package/components/select/SelectSelection.js +1 -1
- package/components/select/_fixtures.d.ts +1 -1
- package/components/select/_fixtures.js +1 -1
- package/components/select/index.d.ts +5 -5
- package/components/select/index.js +4 -4
- package/components/snack/Snack.d.ts +1 -1
- package/components/snack/Snack.js +4 -4
- package/components/snack/Snack.stories.d.ts +1 -1
- package/components/snack/Snack.stories.js +1 -1
- package/components/snack/index.d.ts +1 -1
- package/components/snack/index.js +1 -1
- package/components/sortable/Sortable.js +1 -1
- package/components/sortable/Sortable.stories.d.ts +1 -1
- package/components/sortable/Sortable.stories.js +3 -3
- package/components/sortable/index.d.ts +2 -2
- package/components/sortable/index.js +1 -1
- package/components/steps/Steps.stories.d.ts +1 -1
- package/components/steps/Steps.stories.js +3 -3
- package/components/steps/index.d.ts +2 -2
- package/components/steps/index.js +2 -2
- package/components/table/Table.stories.js +6 -6
- package/components/table/index.d.ts +7 -7
- package/components/table/index.js +7 -7
- package/components/tabs/Tabs.stories.d.ts +1 -1
- package/components/tabs/Tabs.stories.js +2 -2
- package/components/tabs/index.d.ts +1 -1
- package/components/tabs/index.js +1 -1
- package/components/textarea/Textarea.d.ts +1 -1
- package/components/textarea/Textarea.stories.d.ts +1 -1
- package/components/textarea/Textarea.stories.js +1 -1
- package/components/textarea/index.d.ts +1 -1
- package/components/textarea/index.js +1 -1
- package/components/tooltip/SimpleTooltip.d.ts +1 -1
- package/components/tooltip/SimpleTooltip.js +3 -3
- package/components/tooltip/Tooltip.d.ts +1 -1
- package/components/tooltip/Tooltip.js +2 -2
- package/components/tooltip/Tooltip.stories.d.ts +1 -1
- package/components/tooltip/Tooltip.stories.js +2 -2
- package/components/tooltip/Tooltip.test.js +1 -1
- package/components/tooltip/TooltipContent.js +3 -3
- package/components/tooltip/TooltipTrigger.js +1 -1
- package/components/tooltip/index.d.ts +6 -6
- package/components/tooltip/index.js +6 -6
- package/components/tooltip/interface.d.ts +1 -1
- package/components/tooltip/useTooltip.d.ts +2 -2
- package/components/tooltip/useTooltipContext.d.ts +2 -2
- package/hooks/index.d.ts +11 -11
- package/hooks/index.js +11 -11
- package/hooks/useCombinedRefs.test.js +1 -1
- package/hooks/useEventListener.js +1 -1
- package/hooks/useOnClickOutside.js +1 -1
- package/hooks/useRipple.js +1 -1
- package/hooks/useRipple.test.js +1 -1
- package/index.d.ts +33 -33
- package/index.js +32 -32
- package/lib/error.d.ts +1 -1
- package/lib/fetch.js +11 -6
- package/lib/fetch.test.js +17 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.js +4 -4
- package/lib/tailwindVariants.d.ts +1 -1
- package/package.json +1 -1
- package/redux/index.d.ts +1 -1
- package/redux/index.js +1 -1
- package/redux/notification/NotificationConsumer.js +2 -2
- package/redux/notification/errorCatcherMiddleware.js +4 -4
- package/redux/notification/index.d.ts +5 -5
- package/redux/notification/index.js +5 -5
- package/redux/notification/notificationSlice.d.ts +3 -3
- package/redux/notification/notificationSlice.js +1 -1
- package/redux/notification/useReduxNotifications.d.ts +1 -1
- package/redux/notification/useReduxNotifications.js +2 -2
- package/styles/Animation.stories.js +1 -1
- package/styles/Icons.stories.js +1 -1
- package/styles/Shadow.stories.js +1 -1
- package/styles/Typography.stories.js +3 -3
- package/tailwind/index.d.ts +2 -2
- package/tailwind/index.js +2 -2
- package/tailwind/pentatrionTw.js +5 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
import type { OptionLike, Option } from "../select";
|
|
3
|
-
import { AutocompleteOptionProps } from "./AutocompleteOption";
|
|
2
|
+
import type { OptionLike, Option } from "../select/index.js";
|
|
3
|
+
import { AutocompleteOptionProps } from "./AutocompleteOption.js";
|
|
4
4
|
import { Placement } from "@floating-ui/react";
|
|
5
|
-
import { ThemeColor } from "../../types";
|
|
5
|
+
import { ThemeColor } from "../../types.js";
|
|
6
6
|
export interface AutocompleteProps<O extends OptionLike = Option> {
|
|
7
7
|
className?: string;
|
|
8
8
|
icon?: boolean | ReactNode;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { createElement as _createElement } from "react";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useMemo, useRef, useState, forwardRef, } from "react";
|
|
4
|
-
import { AutocompleteOption } from "./AutocompleteOption";
|
|
4
|
+
import { AutocompleteOption } from "./AutocompleteOption.js";
|
|
5
5
|
import { FloatingFocusManager, FloatingList, FloatingPortal, autoUpdate, flip, offset, size, useDismiss, useFloating, useInteractions, useListNavigation, useRole, } from "@floating-ui/react";
|
|
6
|
-
import { AutocompleteContext } from "./useAutocompleteContext";
|
|
6
|
+
import { AutocompleteContext } from "./useAutocompleteContext.js";
|
|
7
7
|
import clsx from "clsx";
|
|
8
|
-
import { useEventCallback } from "../../hooks";
|
|
9
|
-
import { getOptionLabel, getOptionValue } from "./util";
|
|
10
|
-
import { Button } from "../button";
|
|
11
|
-
import { Dialog } from "../dialog";
|
|
12
|
-
import { Loader } from "../loader";
|
|
13
|
-
import { inputConfig } from "../input/Input";
|
|
8
|
+
import { useEventCallback } from "../../hooks/index.js";
|
|
9
|
+
import { getOptionLabel, getOptionValue } from "./util.js";
|
|
10
|
+
import { Button } from "../button/index.js";
|
|
11
|
+
import { Dialog } from "../dialog/index.js";
|
|
12
|
+
import { Loader } from "../loader/index.js";
|
|
13
|
+
import { inputConfig } from "../input/Input.js";
|
|
14
14
|
export const Autocomplete = forwardRef(function Autocomplete({ className, icon = true, color = "yellow", noSearchSuffix, suffix, placement = "bottom", placeholder = "Search...", selection = null, onChangeSelection, autocompleteOptionComponent, loading = false, clearSearchButton = false, searchValue, onChangeSearchValue, options, selectOnFocus = true, readOnly = false, }, inputRef) {
|
|
15
15
|
const [isOpen, setIsOpen] = useState(false);
|
|
16
16
|
const [activeIndex, setActiveIndex] = useState(null);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReactRenderer } from "@storybook/react";
|
|
2
|
-
import { Option } from "../select";
|
|
2
|
+
import { Option } from "../select/index.js";
|
|
3
3
|
import { PartialStoryFn } from "@storybook/types";
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
|
-
component: <O extends import("../select").OptionLike = Option>(props: import("./Autocomplete").AutocompleteProps<O> & import("react").RefAttributes<HTMLInputElement>) => React.ReactElement | null;
|
|
6
|
+
component: <O extends import("../select/index.js").OptionLike = Option>(props: import("./Autocomplete.js").AutocompleteProps<O> & import("react").RefAttributes<HTMLInputElement>) => React.ReactElement | null;
|
|
7
7
|
decorators: ((story: PartialStoryFn<ReactRenderer, any>) => JSX.Element)[];
|
|
8
8
|
};
|
|
9
9
|
export default meta;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import { NotificationsProvider } from "../notification";
|
|
4
|
-
import { Button } from "../button";
|
|
5
|
-
import { SimpleAutocomplete } from "./SimpleAutocomplete";
|
|
6
|
-
import { Autocomplete } from "./Autocomplete";
|
|
7
|
-
import { LazyAutocomplete } from "./LazyAutocomplete";
|
|
8
|
-
import { handleChangeSearchValue, options } from "./_fixtures";
|
|
3
|
+
import { NotificationsProvider } from "../notification/index.js";
|
|
4
|
+
import { Button } from "../button/index.js";
|
|
5
|
+
import { SimpleAutocomplete } from "./SimpleAutocomplete.js";
|
|
6
|
+
import { Autocomplete } from "./Autocomplete.js";
|
|
7
|
+
import { LazyAutocomplete } from "./LazyAutocomplete.js";
|
|
8
|
+
import { handleChangeSearchValue, options } from "./_fixtures.js";
|
|
9
9
|
const meta = {
|
|
10
10
|
title: "Components/Autocomplete",
|
|
11
11
|
component: Autocomplete,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { OptionLike } from "../select";
|
|
1
|
+
import { OptionLike } from "../select/index.js";
|
|
2
2
|
export type AutocompleteOptionProps<O extends OptionLike> = O;
|
|
3
3
|
export declare const AutocompleteOption: import("react").MemoExoticComponent<(<O extends OptionLike>(props: AutocompleteOptionProps<O>) => import("react/jsx-runtime").JSX.Element)>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useId } from "react";
|
|
3
3
|
import { useListItem } from "@floating-ui/react";
|
|
4
|
-
import { useAutocomplete } from "./useAutocompleteContext";
|
|
4
|
+
import { useAutocomplete } from "./useAutocompleteContext.js";
|
|
5
5
|
import clsx from "clsx";
|
|
6
|
-
import { getOptionLabel, getOptionValue } from "./util";
|
|
6
|
+
import { getOptionLabel, getOptionValue } from "./util.js";
|
|
7
7
|
export const AutocompleteOption = memo(function AutocompleteOption(props) {
|
|
8
8
|
const label = getOptionLabel(props);
|
|
9
9
|
const id = useId();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AutocompleteProps } from "./Autocomplete";
|
|
2
|
-
import { OptionLike, Option } from "../select";
|
|
1
|
+
import { AutocompleteProps } from "./Autocomplete.js";
|
|
2
|
+
import { OptionLike, Option } from "../select/index.js";
|
|
3
3
|
interface Props<O extends OptionLike = Option> extends Pick<AutocompleteProps<O>, "className" | "icon" | "color" | "suffix" | "noSearchSuffix" | "placement" | "placeholder" | "selection" | "onChangeSelection" | "autocompleteOptionComponent" | "loading" | "clearSearchButton" | "readOnly"> {
|
|
4
4
|
onChangeSearchValueCallback: (searchValue: string) => Promise<O[]>;
|
|
5
5
|
debounce?: number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
3
|
-
import { Autocomplete } from "./Autocomplete";
|
|
4
|
-
import { getOptionLabel } from "./util";
|
|
5
|
-
import { useStateDebounce, useEventCallback } from "../../hooks";
|
|
3
|
+
import { Autocomplete } from "./Autocomplete.js";
|
|
4
|
+
import { getOptionLabel } from "./util.js";
|
|
5
|
+
import { useStateDebounce, useEventCallback } from "../../hooks/index.js";
|
|
6
6
|
export function LazyAutocomplete({ onChangeSearchValueCallback, debounce = 5000, selection = null, onChangeSelection, ...rest }) {
|
|
7
7
|
const onChangeSelectionStable = useEventCallback(onChangeSelection);
|
|
8
8
|
const onChangeSearchValueCallbackStable = useEventCallback(onChangeSearchValueCallback);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AutocompleteProps } from "./Autocomplete";
|
|
2
|
-
import { Option, OptionLike } from "../select";
|
|
1
|
+
import { AutocompleteProps } from "./Autocomplete.js";
|
|
2
|
+
import { Option, OptionLike } from "../select/index.js";
|
|
3
3
|
interface Props<O extends OptionLike = Option> extends Pick<AutocompleteProps<O>, "className" | "icon" | "color" | "suffix" | "noSearchSuffix" | "placement" | "placeholder" | "selection" | "onChangeSelection" | "autocompleteOptionComponent" | "options" | "selection" | "readOnly"> {
|
|
4
4
|
}
|
|
5
5
|
export declare function SimpleAutocomplete<O extends OptionLike = Option>({ options, selection, onChangeSelection, ...rest }: Props<O>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useLayoutEffect, useRef, useState } from "react";
|
|
3
|
-
import { Autocomplete } from "./Autocomplete";
|
|
4
|
-
import { useEventCallback } from "../../hooks";
|
|
5
|
-
import { getOptionLabel } from "./util";
|
|
3
|
+
import { Autocomplete } from "./Autocomplete.js";
|
|
4
|
+
import { useEventCallback } from "../../hooks/index.js";
|
|
5
|
+
import { getOptionLabel } from "./util.js";
|
|
6
6
|
export function SimpleAutocomplete({ options, selection = null, onChangeSelection, ...rest }) {
|
|
7
7
|
const onChangeSelectionStable = useEventCallback(onChangeSelection);
|
|
8
8
|
const [searchValue, setSearchValue] = useState(selection ? getOptionLabel(selection) : "");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { Autocomplete, type AutocompleteProps } from "./Autocomplete";
|
|
2
|
-
export { SimpleAutocomplete } from "./SimpleAutocomplete";
|
|
3
|
-
export { AutocompleteOption } from "./AutocompleteOption";
|
|
4
|
-
export { LazyAutocomplete } from "./LazyAutocomplete";
|
|
5
|
-
export { useAutocomplete } from "./useAutocompleteContext";
|
|
6
|
-
export { getOptionValue, getOptionLabel } from "./util";
|
|
1
|
+
export { Autocomplete, type AutocompleteProps } from "./Autocomplete.js";
|
|
2
|
+
export { SimpleAutocomplete } from "./SimpleAutocomplete.js";
|
|
3
|
+
export { AutocompleteOption } from "./AutocompleteOption.js";
|
|
4
|
+
export { LazyAutocomplete } from "./LazyAutocomplete.js";
|
|
5
|
+
export { useAutocomplete } from "./useAutocompleteContext.js";
|
|
6
|
+
export { getOptionValue, getOptionLabel } from "./util.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { Autocomplete } from "./Autocomplete";
|
|
2
|
-
export { SimpleAutocomplete } from "./SimpleAutocomplete";
|
|
3
|
-
export { AutocompleteOption } from "./AutocompleteOption";
|
|
4
|
-
export { LazyAutocomplete } from "./LazyAutocomplete";
|
|
5
|
-
export { useAutocomplete } from "./useAutocompleteContext";
|
|
6
|
-
export { getOptionValue, getOptionLabel } from "./util";
|
|
1
|
+
export { Autocomplete } from "./Autocomplete.js";
|
|
2
|
+
export { SimpleAutocomplete } from "./SimpleAutocomplete.js";
|
|
3
|
+
export { AutocompleteOption } from "./AutocompleteOption.js";
|
|
4
|
+
export { LazyAutocomplete } from "./LazyAutocomplete.js";
|
|
5
|
+
export { useAutocomplete } from "./useAutocompleteContext.js";
|
|
6
|
+
export { getOptionValue, getOptionLabel } from "./util.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import { buttonVariants } from "../button/Button";
|
|
4
|
-
import { Href } from "../href";
|
|
5
|
-
import { Tooltip } from "../tooltip/Tooltip";
|
|
6
|
-
import { TooltipContent } from "../tooltip/TooltipContent";
|
|
7
|
-
import { TooltipTrigger } from "../tooltip/TooltipTrigger";
|
|
3
|
+
import { buttonVariants } from "../button/Button.js";
|
|
4
|
+
import { Href } from "../href/index.js";
|
|
5
|
+
import { Tooltip } from "../tooltip/Tooltip.js";
|
|
6
|
+
import { TooltipContent } from "../tooltip/TooltipContent.js";
|
|
7
|
+
import { TooltipTrigger } from "../tooltip/TooltipTrigger.js";
|
|
8
8
|
export function Badge({ children, className, onRemove, onClick, tooltip, url, color = "yellow", }) {
|
|
9
9
|
const badge = (_jsxs("span", { className: clsx("ll-badge", "inline-flex w-fit items-stretch overflow-hidden rounded-full text-xs shadow", buttonVariants.variant.contained(color),
|
|
10
10
|
// badgeVariants.color[color],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Badge } from ".";
|
|
2
|
+
import { Badge } from "./index.js";
|
|
3
3
|
import { action } from "@storybook/addon-actions";
|
|
4
4
|
const onClickAction = action("onClick");
|
|
5
5
|
const onRemoveAction = action("onRemove");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Badge } from "./Badge";
|
|
1
|
+
export { Badge } from "./Badge.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Badge } from "./Badge";
|
|
1
|
+
export { Badge } from "./Badge.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithRef } from "react";
|
|
2
|
-
import { ThemeColor } from "../../types";
|
|
2
|
+
import { ThemeColor } from "../../types.js";
|
|
3
3
|
export interface ButtonProps extends ComponentPropsWithRef<"button"> {
|
|
4
4
|
withRipple?: boolean;
|
|
5
5
|
variant?: "contained" | "light" | "outlined" | "text" | "ghost";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useImperativeHandle, useRef } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import { Loader } from "../loader";
|
|
5
|
-
import { useRipple } from "../../hooks";
|
|
4
|
+
import { Loader } from "../loader/index.js";
|
|
5
|
+
import { useRipple } from "../../hooks/index.js";
|
|
6
6
|
export const buttonVariants = {
|
|
7
7
|
size(icon, size) {
|
|
8
8
|
if (size === "custom") {
|
|
@@ -2,7 +2,7 @@ import type { StoryObj, ReactRenderer } from "@storybook/react";
|
|
|
2
2
|
import { PartialStoryFn } from "@storybook/types";
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: (props: import("./Button").ButtonProps & import("react").RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
|
|
5
|
+
component: (props: import("./Button.js").ButtonProps & import("react").RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
|
|
6
6
|
argTypes: {
|
|
7
7
|
variant: {
|
|
8
8
|
control: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Table, TableBody, TableCell, TableHeader, TableHeaderCell, TableRow } from "../table";
|
|
3
|
-
import { Button } from "./Button";
|
|
2
|
+
import { Table, TableBody, TableCell, TableHeader, TableHeaderCell, TableRow } from "../table/index.js";
|
|
3
|
+
import { Button } from "./Button.js";
|
|
4
4
|
const meta = {
|
|
5
5
|
title: "Components/Button",
|
|
6
6
|
component: Button,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cleanup, fireEvent, render } from "@testing-library/react";
|
|
3
3
|
import { describe, it, expect, vi, afterEach } from "vitest";
|
|
4
|
-
import { Button } from "./Button";
|
|
4
|
+
import { Button } from "./Button.js";
|
|
5
5
|
afterEach(cleanup);
|
|
6
6
|
describe("<Button />", () => {
|
|
7
7
|
it("forwards className", () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import { Button } from "./Button";
|
|
4
|
-
import { ButtonGroup } from "./ButtonGroup";
|
|
3
|
+
import { Button } from "./Button.js";
|
|
4
|
+
import { ButtonGroup } from "./ButtonGroup.js";
|
|
5
5
|
const meta = {
|
|
6
6
|
title: "Components/ButtonGroup",
|
|
7
7
|
component: ButtonGroup,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useImperativeHandle, useRef } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import { useRipple } from "../../hooks/useRipple";
|
|
5
|
-
import { buttonVariants } from "./Button";
|
|
4
|
+
import { useRipple } from "../../hooks/useRipple.js";
|
|
5
|
+
import { buttonVariants } from "./Button.js";
|
|
6
6
|
export const LinkButton = forwardRef(function LinkButton({ withRipple = true, variant = "contained", color = "yellow", size = "medium", focusable = true, fullWidth, className, children, selected = false, icon = false, href, ...props }, ref) {
|
|
7
7
|
const anchorRef = useRef(null);
|
|
8
8
|
useImperativeHandle(ref, () => anchorRef.current);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Button, type ButtonProps, buttonVariants } from "./Button";
|
|
2
|
-
export { ButtonGroup } from "./ButtonGroup";
|
|
3
|
-
export { LinkButton } from "./LinkButton";
|
|
1
|
+
export { Button, type ButtonProps, buttonVariants } from "./Button.js";
|
|
2
|
+
export { ButtonGroup } from "./ButtonGroup.js";
|
|
3
|
+
export { LinkButton } from "./LinkButton.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Button, buttonVariants } from "./Button";
|
|
2
|
-
export { ButtonGroup } from "./ButtonGroup";
|
|
3
|
-
export { LinkButton } from "./LinkButton";
|
|
1
|
+
export { Button, buttonVariants } from "./Button.js";
|
|
2
|
+
export { ButtonGroup } from "./ButtonGroup.js";
|
|
3
|
+
export { LinkButton } from "./LinkButton.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { cardConfig } from "./config";
|
|
1
|
+
export { cardConfig } from "./config.js";
|
package/components/card/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { cardConfig } from "./config";
|
|
1
|
+
export { cardConfig } from "./config.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Code } from "./Code";
|
|
1
|
+
export { Code } from "./Code.js";
|
package/components/code/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Code } from "./Code";
|
|
1
|
+
export { Code } from "./Code.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Children, cloneElement, isValidElement, useEffect, useRef, useState, } from "react";
|
|
3
3
|
import { FloatingFocusManager, FloatingPortal, autoUpdate, flip, offset, shift, size, useDismiss, useFloating, useInteractions, useListNavigation, useRole, useTypeahead, } from "@floating-ui/react";
|
|
4
|
-
import { Dialog } from "../dialog/Dialog";
|
|
5
|
-
import { useEventCallback, useRefDebounce } from "../../hooks";
|
|
4
|
+
import { Dialog } from "../dialog/Dialog.js";
|
|
5
|
+
import { useEventCallback, useRefDebounce } from "../../hooks/index.js";
|
|
6
6
|
export function ContextMenu({ targetRef, children, style, eventName = "contextmenu" }) {
|
|
7
7
|
const [activeIndex, setActiveIndex] = useState(null);
|
|
8
8
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ContextMenu } from "./ContextMenu";
|
|
3
|
-
import { ContextMenuItem } from "./ContextMenuItem";
|
|
2
|
+
import { ContextMenu } from "./ContextMenu.js";
|
|
3
|
+
import { ContextMenuItem } from "./ContextMenuItem.js";
|
|
4
4
|
import { action } from "@storybook/addon-actions";
|
|
5
5
|
const onChangeAction = action("onChange");
|
|
6
6
|
const meta = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ContextMenu } from "./ContextMenu";
|
|
2
|
-
export { ContextMenuItem, type ContextMenuItemMouseEvent } from "./ContextMenuItem";
|
|
1
|
+
export { ContextMenu } from "./ContextMenu.js";
|
|
2
|
+
export { ContextMenuItem, type ContextMenuItemMouseEvent } from "./ContextMenuItem.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ContextMenu } from "./ContextMenu";
|
|
2
|
-
export { ContextMenuItem } from "./ContextMenuItem";
|
|
1
|
+
export { ContextMenu } from "./ContextMenu.js";
|
|
2
|
+
export { ContextMenuItem } from "./ContextMenuItem.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Placement } from "@floating-ui/react";
|
|
2
2
|
import { ComponentProps, ReactNode } from "react";
|
|
3
|
-
import type { ThemeColor } from "../../types";
|
|
3
|
+
import type { ThemeColor } from "../../types.js";
|
|
4
4
|
interface Props extends ComponentProps<"div"> {
|
|
5
5
|
color?: ThemeColor;
|
|
6
6
|
placement?: Placement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Dialog } from "./Dialog";
|
|
3
|
-
import { Button } from "../button";
|
|
2
|
+
import { Dialog } from "./Dialog.js";
|
|
3
|
+
import { Button } from "../button/index.js";
|
|
4
4
|
const meta = {
|
|
5
5
|
title: "Components/Dialog",
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Dialog, dialogVariants } from "./Dialog";
|
|
1
|
+
export { Dialog, dialogVariants } from "./Dialog.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Dialog, dialogVariants } from "./Dialog";
|
|
1
|
+
export { Dialog, dialogVariants } from "./Dialog.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { DropdownMenuContext } from "./useDropdownMenuContext";
|
|
3
|
-
import { useDropdownMenu } from "./useDropdownMenu";
|
|
2
|
+
import { DropdownMenuContext } from "./useDropdownMenuContext.js";
|
|
3
|
+
import { useDropdownMenu } from "./useDropdownMenu.js";
|
|
4
4
|
export function DropdownMenu({ children, ...options }) {
|
|
5
5
|
const popover = useDropdownMenu(options);
|
|
6
6
|
return _jsx(DropdownMenuContext.Provider, { value: popover, children: children });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from ".";
|
|
2
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from "./index.js";
|
|
3
3
|
const meta = {
|
|
4
4
|
title: "Components/DropdownMenu",
|
|
5
5
|
component: DropdownMenu,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { useDropdownMenuContext } from "./useDropdownMenuContext";
|
|
3
|
+
import { useDropdownMenuContext } from "./useDropdownMenuContext.js";
|
|
4
4
|
import { FloatingFocusManager, FloatingList, FloatingPortal, useMergeRefs, } from "@floating-ui/react";
|
|
5
5
|
import clsx from "clsx";
|
|
6
|
-
import { Dialog } from "../dialog";
|
|
6
|
+
import { Dialog } from "../dialog/index.js";
|
|
7
7
|
export const DropdownMenuContent = forwardRef(({ style, children, ...props }, propRef) => {
|
|
8
8
|
const context = useDropdownMenuContext();
|
|
9
9
|
const floatingContext = context.context;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useListItem } from "@floating-ui/react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import { useDropdownMenuContext } from "./useDropdownMenuContext";
|
|
4
|
+
import { useDropdownMenuContext } from "./useDropdownMenuContext.js";
|
|
5
5
|
export function DropdownMenuItem({ children, onClick, ...rest }) {
|
|
6
6
|
const { activeIndex, getItemProps, handleSelect } = useDropdownMenuContext();
|
|
7
7
|
const { ref, index } = useListItem({ label: children?.toString() });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cloneElement, forwardRef, isValidElement } from "react";
|
|
3
|
-
import { useDropdownMenuContext } from "./useDropdownMenuContext";
|
|
3
|
+
import { useDropdownMenuContext } from "./useDropdownMenuContext.js";
|
|
4
4
|
import { useMergeRefs } from "@floating-ui/react";
|
|
5
|
-
import { Button } from "../button";
|
|
5
|
+
import { Button } from "../button/index.js";
|
|
6
6
|
export const DropdownMenuTrigger = forwardRef(({ children, asChild = false, ...props }, propRef) => {
|
|
7
7
|
const context = useDropdownMenuContext();
|
|
8
8
|
const childrenRef = children.ref;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { DropdownMenu } from "./DropdownMenu";
|
|
2
|
-
export { DropdownMenuContent } from "./DropdownMenuContent";
|
|
3
|
-
export { DropdownMenuTrigger } from "./DropdownMenuTrigger";
|
|
4
|
-
export { useDropdownMenu } from "./useDropdownMenu";
|
|
5
|
-
export { useDropdownMenuContext, DropdownMenuContext } from "./useDropdownMenuContext";
|
|
6
|
-
export { DropdownMenuItem } from "./DropdownMenuItem";
|
|
7
|
-
export type * from "./interface";
|
|
1
|
+
export { DropdownMenu } from "./DropdownMenu.js";
|
|
2
|
+
export { DropdownMenuContent } from "./DropdownMenuContent.js";
|
|
3
|
+
export { DropdownMenuTrigger } from "./DropdownMenuTrigger.js";
|
|
4
|
+
export { useDropdownMenu } from "./useDropdownMenu.js";
|
|
5
|
+
export { useDropdownMenuContext, DropdownMenuContext } from "./useDropdownMenuContext.js";
|
|
6
|
+
export { DropdownMenuItem } from "./DropdownMenuItem.js";
|
|
7
|
+
export type * from "./interface.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { DropdownMenu } from "./DropdownMenu";
|
|
2
|
-
export { DropdownMenuContent } from "./DropdownMenuContent";
|
|
3
|
-
export { DropdownMenuTrigger } from "./DropdownMenuTrigger";
|
|
4
|
-
export { useDropdownMenu } from "./useDropdownMenu";
|
|
5
|
-
export { useDropdownMenuContext, DropdownMenuContext } from "./useDropdownMenuContext";
|
|
6
|
-
export { DropdownMenuItem } from "./DropdownMenuItem";
|
|
1
|
+
export { DropdownMenu } from "./DropdownMenu.js";
|
|
2
|
+
export { DropdownMenuContent } from "./DropdownMenuContent.js";
|
|
3
|
+
export { DropdownMenuTrigger } from "./DropdownMenuTrigger.js";
|
|
4
|
+
export { useDropdownMenu } from "./useDropdownMenu.js";
|
|
5
|
+
export { useDropdownMenuContext, DropdownMenuContext } from "./useDropdownMenuContext.js";
|
|
6
|
+
export { DropdownMenuItem } from "./DropdownMenuItem.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { DropdownMenuOptions } from "./interface";
|
|
1
|
+
import type { DropdownMenuOptions } from "./interface.js";
|
|
2
2
|
export declare function useDropdownMenu({ initialOpen, placement, open: controlledOpen, onOpen: setControlledOpen, color, modal, }: DropdownMenuOptions): {
|
|
3
3
|
elementsRef: import("react").MutableRefObject<(HTMLElement | null)[]>;
|
|
4
4
|
labelsRef: import("react").MutableRefObject<(string | null)[]>;
|
|
5
|
-
color: import("
|
|
5
|
+
color: import("../../index.js").ThemeColor | "default";
|
|
6
6
|
modal: boolean;
|
|
7
7
|
activeIndex: number | null;
|
|
8
8
|
handleSelect: () => void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useDropdownMenu } from "./useDropdownMenu";
|
|
1
|
+
import { useDropdownMenu } from "./useDropdownMenu.js";
|
|
2
2
|
type ContextType = ReturnType<typeof useDropdownMenu> | null;
|
|
3
3
|
export declare const DropdownMenuContext: import("react").Context<ContextType>;
|
|
4
4
|
export declare function useDropdownMenuContext(): {
|
|
5
5
|
elementsRef: import("react").MutableRefObject<(HTMLElement | null)[]>;
|
|
6
6
|
labelsRef: import("react").MutableRefObject<(string | null)[]>;
|
|
7
|
-
color: import("
|
|
7
|
+
color: import("../../index.js").ThemeColor | "default";
|
|
8
8
|
modal: boolean;
|
|
9
9
|
activeIndex: number | null;
|
|
10
10
|
handleSelect: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { MenuItemWithChildren } from "./MenuItemWithChildren";
|
|
3
|
+
import { MenuItemWithChildren } from "./MenuItemWithChildren.js";
|
|
4
4
|
import { FloatingTree } from "@floating-ui/react";
|
|
5
5
|
export const DropdownMenuNested = forwardRef((props, ref) => {
|
|
6
6
|
return (_jsx(FloatingTree, { children: _jsx(MenuItemWithChildren, { ...props, ref: ref }) }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const meta: {
|
|
2
2
|
title: string;
|
|
3
|
-
component: (props: import("./DropdownMenuNested").Props & import("react").RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
|
|
3
|
+
component: (props: import("./DropdownMenuNested.js").Props & import("react").RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
|
|
4
4
|
};
|
|
5
5
|
export default meta;
|
|
6
6
|
export declare const Basic: () => import("react/jsx-runtime").JSX.Element;
|