@nextui-org/react 1.0.0-beta.7 → 1.0.0-beta.8
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/cjs/avatar/avatar.js +1 -1
- package/cjs/avatar/avatar.styles.js +1 -1
- package/cjs/button/button-icon.js +1 -1
- package/cjs/button/button.js +1 -1
- package/cjs/button/button.styles.js +1 -1
- package/cjs/card/card.js +1 -1
- package/cjs/card/card.styles.js +1 -1
- package/cjs/card/index.js +1 -1
- package/cjs/card/use-card.js +1 -0
- package/cjs/checkbox/checkbox-group.js +1 -1
- package/cjs/checkbox/checkbox.styles.js +1 -1
- package/cjs/checkbox/use-checkbox-group.js +1 -1
- package/cjs/collapse/collapse.styles.js +1 -1
- package/cjs/css-baseline/css-baseline.js +1 -1
- package/cjs/dropdown/base/dropdown-item-base.js +1 -0
- package/cjs/dropdown/dropdown-button.js +1 -0
- package/cjs/dropdown/dropdown-context.js +1 -0
- package/cjs/dropdown/dropdown-icon.js +1 -0
- package/cjs/dropdown/dropdown-item.js +1 -0
- package/cjs/dropdown/dropdown-menu.js +1 -0
- package/cjs/dropdown/dropdown-section.js +1 -0
- package/cjs/dropdown/dropdown-trigger.js +1 -0
- package/cjs/dropdown/dropdown-types.js +1 -0
- package/cjs/dropdown/dropdown.js +1 -0
- package/cjs/dropdown/dropdown.styles.js +1 -0
- package/cjs/dropdown/index.js +1 -0
- package/cjs/dropdown/use-dropdown.js +1 -0
- package/cjs/image/image.js +1 -1
- package/cjs/image/image.styles.js +1 -1
- package/cjs/index.js +1 -1
- package/cjs/input/input.styles.js +1 -1
- package/cjs/modal/modal.styles.js +1 -1
- package/cjs/pagination/pagination.styles.js +1 -1
- package/cjs/popover/popover-content.js +1 -1
- package/cjs/popover/popover-trigger.js +1 -1
- package/cjs/popover/popover.js +1 -1
- package/cjs/popover/popover.styles.js +1 -1
- package/cjs/popover/use-popover.js +1 -1
- package/cjs/popover/utils.js +1 -1
- package/cjs/radio/index.js +1 -1
- package/cjs/radio/radio-context.js +1 -1
- package/cjs/radio/radio-group.js +1 -1
- package/cjs/radio/radio.js +1 -1
- package/cjs/radio/radio.styles.js +1 -1
- package/cjs/radio/use-radio-group.js +1 -0
- package/cjs/radio/use-radio.js +1 -0
- package/cjs/snippet/snippet.styles.js +1 -1
- package/cjs/switch/switch.styles.js +1 -1
- package/cjs/table/table.styles.js +1 -1
- package/cjs/theme/colors/gray.js +1 -1
- package/cjs/theme/common.js +1 -1
- package/cjs/theme/dark-theme.js +1 -1
- package/cjs/theme/light-theme.js +1 -1
- package/cjs/theme/shared-css.js +1 -0
- package/cjs/theme/stitches.config.js +1 -1
- package/cjs/tooltip/tooltip.styles.js +1 -1
- package/cjs/user/index.js +1 -1
- package/cjs/user/user-link.js +1 -1
- package/cjs/user/user.js +1 -1
- package/cjs/user/user.styles.js +1 -1
- package/cjs/utils/checkmark.js +1 -0
- package/cjs/utils/color.js +1 -1
- package/cjs/utils/dom.js +1 -1
- package/cjs/utils/icons.js +1 -1
- package/cjs/utils/prop-types.js +1 -1
- package/dropdown/package.json +6 -0
- package/esm/avatar/avatar.js +1 -1
- package/esm/avatar/avatar.styles.js +1 -1
- package/esm/button/button-icon.js +1 -1
- package/esm/button/button.js +1 -1
- package/esm/button/button.styles.js +1 -1
- package/esm/card/card.js +1 -1
- package/esm/card/card.styles.js +1 -1
- package/esm/card/index.js +1 -1
- package/esm/card/use-card.js +1 -0
- package/esm/checkbox/checkbox-group.js +1 -1
- package/esm/checkbox/checkbox.styles.js +1 -1
- package/esm/checkbox/use-checkbox-group.js +1 -1
- package/esm/collapse/collapse.styles.js +1 -1
- package/esm/css-baseline/css-baseline.js +1 -1
- package/esm/dropdown/base/dropdown-item-base.js +1 -0
- package/esm/dropdown/dropdown-button.js +1 -0
- package/esm/dropdown/dropdown-context.js +1 -0
- package/esm/dropdown/dropdown-icon.js +1 -0
- package/esm/dropdown/dropdown-item.js +1 -0
- package/esm/dropdown/dropdown-menu.js +1 -0
- package/esm/dropdown/dropdown-section.js +1 -0
- package/esm/dropdown/dropdown-trigger.js +1 -0
- package/esm/dropdown/dropdown-types.js +1 -0
- package/esm/dropdown/dropdown.js +1 -0
- package/esm/dropdown/dropdown.styles.js +1 -0
- package/esm/dropdown/index.js +1 -0
- package/esm/dropdown/use-dropdown.js +1 -0
- package/esm/image/image.js +1 -1
- package/esm/image/image.styles.js +1 -1
- package/esm/index.js +1 -1
- package/esm/input/input.styles.js +1 -1
- package/esm/modal/modal.styles.js +1 -1
- package/esm/pagination/pagination.styles.js +1 -1
- package/esm/popover/popover-content.js +1 -1
- package/esm/popover/popover-trigger.js +1 -1
- package/esm/popover/popover.js +1 -1
- package/esm/popover/popover.styles.js +1 -1
- package/esm/popover/use-popover.js +1 -1
- package/esm/popover/utils.js +1 -1
- package/esm/radio/index.js +1 -1
- package/esm/radio/radio-context.js +1 -1
- package/esm/radio/radio-group.js +1 -1
- package/esm/radio/radio.js +1 -1
- package/esm/radio/radio.styles.js +1 -1
- package/esm/radio/use-radio-group.js +1 -0
- package/esm/radio/use-radio.js +1 -0
- package/esm/snippet/snippet.styles.js +1 -1
- package/esm/switch/switch.styles.js +1 -1
- package/esm/table/table.styles.js +1 -1
- package/esm/theme/colors/gray.js +1 -1
- package/esm/theme/common.js +1 -1
- package/esm/theme/dark-theme.js +1 -1
- package/esm/theme/light-theme.js +1 -1
- package/esm/theme/shared-css.js +1 -0
- package/esm/theme/stitches.config.js +1 -1
- package/esm/tooltip/tooltip.styles.js +1 -1
- package/esm/user/index.js +1 -1
- package/esm/user/user-link.js +1 -1
- package/esm/user/user.js +1 -1
- package/esm/user/user.styles.js +1 -1
- package/esm/utils/checkmark.js +1 -0
- package/esm/utils/color.js +1 -1
- package/esm/utils/dom.js +1 -1
- package/esm/utils/icons.js +1 -1
- package/esm/utils/prop-types.js +1 -1
- package/package.json +6 -1
- package/types/avatar/avatar-group.styles.d.ts +150 -6
- package/types/avatar/avatar.d.ts +2372 -11
- package/types/avatar/avatar.styles.d.ts +2447 -14
- package/types/backdrop/backdrop.styles.d.ts +225 -9
- package/types/button/button-group.styles.d.ts +75 -3
- package/types/button/button-icon.d.ts +79 -5
- package/types/button/button.d.ts +5 -3
- package/types/button/button.styles.d.ts +1249 -7
- package/types/card/card.d.ts +8 -9
- package/types/card/card.styles.d.ts +2621 -24
- package/types/card/use-card.d.ts +301 -0
- package/types/checkbox/checkbox.styles.d.ts +751 -31
- package/types/checkbox/use-checkbox-group.d.ts +3 -2
- package/types/code/code.styles.d.ts +150 -6
- package/types/col/col.styles.d.ts +75 -3
- package/types/collapse/collapse.styles.d.ts +450 -18
- package/types/container/container.styles.d.ts +75 -3
- package/types/divider/divider.styles.d.ts +150 -6
- package/types/dropdown/base/dropdown-item-base.d.ts +19 -0
- package/types/dropdown/dropdown-button.d.ts +3689 -0
- package/types/dropdown/dropdown-context.d.ts +728 -0
- package/types/dropdown/dropdown-icon.d.ts +9 -0
- package/types/dropdown/dropdown-item.d.ts +31 -0
- package/types/dropdown/dropdown-menu.d.ts +30 -0
- package/types/dropdown/dropdown-section.d.ts +29 -0
- package/types/dropdown/dropdown-trigger.d.ts +11 -0
- package/types/dropdown/dropdown-types.d.ts +24 -0
- package/types/dropdown/dropdown.d.ts +24 -0
- package/types/dropdown/dropdown.styles.d.ts +11869 -0
- package/types/dropdown/index.d.ts +9 -0
- package/types/dropdown/use-dropdown.d.ts +389 -0
- package/types/grid/grid.styles.d.ts +150 -6
- package/types/image/image.d.ts +5 -18
- package/types/image/image.styles.d.ts +225 -9
- package/types/index.d.ts +4 -1
- package/types/input/input-password.d.ts +1 -1
- package/types/input/input-props.d.ts +2 -2
- package/types/input/input.styles.d.ts +825 -33
- package/types/link/link.styles.d.ts +150 -6
- package/types/loading/loading.styles.d.ts +450 -18
- package/types/modal/modal.styles.d.ts +450 -18
- package/types/pagination/pagination.styles.d.ts +450 -18
- package/types/popover/popover-content.d.ts +1147 -2
- package/types/popover/popover-context.d.ts +120 -0
- package/types/popover/popover.d.ts +4 -4
- package/types/popover/popover.styles.d.ts +1279 -7
- package/types/popover/use-popover.d.ts +83 -4
- package/types/popover/utils.d.ts +3 -1
- package/types/progress/progress.d.ts +1 -1
- package/types/progress/progress.styles.d.ts +150 -6
- package/types/radio/index.d.ts +2 -2
- package/types/radio/radio-context.d.ts +22 -13
- package/types/radio/radio-group.d.ts +9 -78
- package/types/radio/radio.d.ts +10 -66
- package/types/radio/radio.styles.d.ts +2574 -35
- package/types/radio/use-radio-group.d.ts +26 -0
- package/types/radio/use-radio.d.ts +31 -0
- package/types/row/row.styles.d.ts +75 -3
- package/types/snippet/snippet.styles.d.ts +300 -12
- package/types/spacer/spacer.styles.d.ts +75 -3
- package/types/switch/switch.d.ts +1 -1
- package/types/switch/switch.styles.d.ts +300 -12
- package/types/table/table-column-header.d.ts +75 -3
- package/types/table/table-sort-icon.d.ts +75 -3
- package/types/table/table.styles.d.ts +1278 -52
- package/types/text/text.styles.d.ts +75 -3
- package/types/textarea/textarea.d.ts +1 -1
- package/types/theme/common.d.ts +127 -6
- package/types/theme/dark-theme.d.ts +11 -0
- package/types/theme/light-theme.d.ts +7 -0
- package/types/theme/shared-css.d.ts +5237 -0
- package/types/theme/stitches.config.d.ts +643 -2964
- package/types/theme/types.d.ts +3 -0
- package/types/tooltip/tooltip.d.ts +1 -1
- package/types/tooltip/tooltip.styles.d.ts +300 -12
- package/types/user/index.d.ts +1 -1
- package/types/user/user-link.d.ts +4 -11
- package/types/user/user.styles.d.ts +298 -983
- package/types/utils/checkmark.d.ts +19 -0
- package/types/utils/color.d.ts +1 -0
- package/types/utils/dom.d.ts +5 -2
- package/types/utils/drip.d.ts +76 -4
- package/types/utils/prop-types.d.ts +4 -0
- package/umd/nextui.js +6269 -3172
- package/umd/nextui.min.js +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { ReactNode, Key } from 'react';
|
|
2
|
+
import { Node } from '@react-types/shared';
|
|
3
|
+
import { TreeState } from '@react-stately/tree';
|
|
4
|
+
import type { FocusableProps } from '@react-types/shared';
|
|
5
|
+
import { CSS } from '../theme/stitches.config';
|
|
6
|
+
import type { SimpleColors, NormalWeights, DropdownVariants } from '../utils/prop-types';
|
|
7
|
+
interface Props<T> extends FocusableProps {
|
|
8
|
+
item: Node<T>;
|
|
9
|
+
state: TreeState<T>;
|
|
10
|
+
color?: SimpleColors;
|
|
11
|
+
variant?: DropdownVariants;
|
|
12
|
+
textColor?: SimpleColors;
|
|
13
|
+
isVirtualized?: boolean;
|
|
14
|
+
withDivider?: boolean;
|
|
15
|
+
command?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
icon?: ReactNode;
|
|
18
|
+
dividerWeight?: NormalWeights;
|
|
19
|
+
as?: keyof JSX.IntrinsicElements;
|
|
20
|
+
onAction?: (key: Key) => void;
|
|
21
|
+
}
|
|
22
|
+
declare type NativeAttrs = Omit<React.HTMLAttributes<unknown>, keyof Props<object>>;
|
|
23
|
+
export declare type DropdownItemProps<T = object> = Props<T> & NativeAttrs & {
|
|
24
|
+
css?: CSS;
|
|
25
|
+
};
|
|
26
|
+
declare const DropdownItem: {
|
|
27
|
+
<T extends object>({ as, css, item, state, color, icon, command, description, textColor, variant, autoFocus, isVirtualized, withDivider, dividerWeight, onAction, className }: DropdownItemProps<T>): JSX.Element;
|
|
28
|
+
displayName: string;
|
|
29
|
+
toString(): string;
|
|
30
|
+
};
|
|
31
|
+
export default DropdownItem;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { RefAttributes, PropsWithoutRef } from 'react';
|
|
2
|
+
import { DOMProps, AriaLabelingProps } from '@react-types/shared';
|
|
3
|
+
import { AriaMenuProps } from '@react-types/menu';
|
|
4
|
+
import { CSS } from '../theme/stitches.config';
|
|
5
|
+
import type { SimpleColors, DropdownVariants } from '../utils/prop-types';
|
|
6
|
+
interface Props<T> extends AriaMenuProps<T>, DOMProps, AriaLabelingProps {
|
|
7
|
+
as?: keyof JSX.IntrinsicElements;
|
|
8
|
+
/**
|
|
9
|
+
* The color of the dropdown items on (focused, hovered)
|
|
10
|
+
* @default 'default'
|
|
11
|
+
*/
|
|
12
|
+
color?: SimpleColors;
|
|
13
|
+
/**
|
|
14
|
+
* The dropdowm item variation
|
|
15
|
+
* @default 'flat'
|
|
16
|
+
*/
|
|
17
|
+
variant?: DropdownVariants;
|
|
18
|
+
/**
|
|
19
|
+
* The text color of the dropdown items on (focused, hovered)
|
|
20
|
+
* @default 'default'
|
|
21
|
+
*/
|
|
22
|
+
textColor?: SimpleColors;
|
|
23
|
+
}
|
|
24
|
+
declare type NativeAttrs = Omit<React.HTMLAttributes<unknown>, keyof Props<object>>;
|
|
25
|
+
export declare type DropdownMenuProps<T = object> = Props<T> & NativeAttrs & {
|
|
26
|
+
css?: CSS;
|
|
27
|
+
};
|
|
28
|
+
declare type DropdownComponent<T, P = {}> = React.ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>>;
|
|
29
|
+
declare const _default: DropdownComponent<HTMLUListElement, DropdownMenuProps<object>>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { Key } from 'react';
|
|
2
|
+
import type { TreeState } from '@react-stately/tree';
|
|
3
|
+
import type { Node } from '@react-types/shared';
|
|
4
|
+
import type { CSS } from '../theme/stitches.config';
|
|
5
|
+
import type { SimpleColors, DropdownVariants } from '../utils/prop-types';
|
|
6
|
+
interface Props<T> {
|
|
7
|
+
item: Node<T>;
|
|
8
|
+
state: TreeState<T>;
|
|
9
|
+
color?: SimpleColors;
|
|
10
|
+
variant?: DropdownVariants;
|
|
11
|
+
textColor?: SimpleColors;
|
|
12
|
+
/**
|
|
13
|
+
* Shows a divider between sections
|
|
14
|
+
* @default true
|
|
15
|
+
*/
|
|
16
|
+
withDivider?: boolean;
|
|
17
|
+
as?: keyof JSX.IntrinsicElements;
|
|
18
|
+
css?: CSS;
|
|
19
|
+
className?: string;
|
|
20
|
+
onAction?: (key: Key) => void;
|
|
21
|
+
}
|
|
22
|
+
declare type NativeAttrs = Omit<React.HTMLAttributes<unknown>, keyof Props<object>>;
|
|
23
|
+
export declare type DropdownSectionProps<T> = Props<T> & NativeAttrs;
|
|
24
|
+
declare const DropdownSection: {
|
|
25
|
+
<T extends object>(props: DropdownSectionProps<T>): JSX.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
toString(): string;
|
|
28
|
+
};
|
|
29
|
+
export default DropdownSection;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* DropdownTrigger opens the popover's content. It must be an interactive element
|
|
4
|
+
* such as `button` or `a`.
|
|
5
|
+
*/
|
|
6
|
+
declare const DropdownTrigger: {
|
|
7
|
+
(props: React.PropsWithChildren<{}>): JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
toString(): string;
|
|
10
|
+
};
|
|
11
|
+
export default DropdownTrigger;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import { useMenuItem, useMenuSection } from '@react-aria/menu';
|
|
3
|
+
import type { FocusRingAria } from '@react-aria/focus';
|
|
4
|
+
export declare type MenuItemAria = ReturnType<typeof useMenuItem>;
|
|
5
|
+
export declare type MenuSectionAria = ReturnType<typeof useMenuSection>;
|
|
6
|
+
export interface IFocusRingAria extends FocusRingAria {
|
|
7
|
+
focusProps: Omit<HTMLAttributes<HTMLElement>, 'css'>;
|
|
8
|
+
}
|
|
9
|
+
export interface IMenuItemAria extends MenuItemAria {
|
|
10
|
+
/** Props for the main text element inside the menu item. */
|
|
11
|
+
labelProps: Omit<HTMLAttributes<HTMLElement>, 'css'>;
|
|
12
|
+
/** Props for the description text element inside the menu item, if any. */
|
|
13
|
+
descriptionProps: Omit<HTMLAttributes<HTMLElement>, 'css'>;
|
|
14
|
+
/** Props for the keyboard shortcut text element inside the item, if any. */
|
|
15
|
+
keyboardShortcutProps: Omit<HTMLAttributes<HTMLElement>, 'css'>;
|
|
16
|
+
}
|
|
17
|
+
export interface IMenuSectionAria extends MenuSectionAria {
|
|
18
|
+
/** Props for the wrapper list item. */
|
|
19
|
+
itemProps: Omit<HTMLAttributes<HTMLElement>, 'css'>;
|
|
20
|
+
/** Props for the heading element, if any. */
|
|
21
|
+
headingProps: Omit<HTMLAttributes<HTMLElement>, 'css'>;
|
|
22
|
+
/** Props for the group element. */
|
|
23
|
+
groupProps: Omit<HTMLAttributes<HTMLElement>, 'css'>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { Section } from '@react-stately/collections';
|
|
3
|
+
import DropdownItemBase from './base/dropdown-item-base';
|
|
4
|
+
import DropdownTrigger from './dropdown-trigger';
|
|
5
|
+
import DropdownMenu from './dropdown-menu';
|
|
6
|
+
import DropdownButton from './dropdown-button';
|
|
7
|
+
import { UseDropdownProps } from './use-dropdown';
|
|
8
|
+
interface Props extends UseDropdownProps {
|
|
9
|
+
/**
|
|
10
|
+
* The content of the dropdown. It is usually the `Dropdown.Trigger`,
|
|
11
|
+
* and `Dropdown.Menu`
|
|
12
|
+
*/
|
|
13
|
+
children: ReactNode[];
|
|
14
|
+
}
|
|
15
|
+
export declare type DropdownProps = Props;
|
|
16
|
+
declare type DropdownComponent<P = {}> = React.FC<P> & {
|
|
17
|
+
Trigger: typeof DropdownTrigger;
|
|
18
|
+
Button: typeof DropdownButton;
|
|
19
|
+
Menu: typeof DropdownMenu;
|
|
20
|
+
Item: typeof DropdownItemBase;
|
|
21
|
+
Section: typeof Section;
|
|
22
|
+
};
|
|
23
|
+
declare const _default: DropdownComponent<Props>;
|
|
24
|
+
export default _default;
|