feat(root): progress and accordion build size reduced by spliting aria utils

This commit is contained in:
Junior Garcia 2023-03-30 23:04:11 -03:00
parent dc59b1eb81
commit 564ec4ddef
90 changed files with 626 additions and 177 deletions

View File

@ -1,5 +1,19 @@
# @nextui-org/accordion
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/framer-transitions@0.0.0-dev-v2-20230331020226
- @nextui-org/shared-icons@0.0.0-dev-v2-20230331020226
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/aria-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/accordion",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Collapse display a list of high-level options that can expand/collapse to reveal more information.",
"keywords": [
"react",
@ -48,6 +48,7 @@
"@nextui-org/shared-icons": "workspace:*",
"@nextui-org/shared-utils": "workspace:*",
"@nextui-org/framer-transitions": "workspace:*",
"@nextui-org/use-aria-accordion-item": "workspace:*",
"@nextui-org/system": "workspace:*",
"@nextui-org/theme": "workspace:*",
"@react-aria/accordion": "3.0.0-alpha.15",

View File

@ -3,7 +3,8 @@ import {useFocusRing} from "@react-aria/focus";
import {accordionItem} from "@nextui-org/theme";
import {useDOMRef} from "@nextui-org/dom-utils";
import {clsx, ReactRef, callAllHandlers, dataAttr} from "@nextui-org/shared-utils";
import {NodeWithProps, useAccordionItem as useBaseAccordion} from "@nextui-org/aria-utils";
import {NodeWithProps} from "@nextui-org/aria-utils";
import {useAriaAccordionItem} from "@nextui-org/use-aria-accordion-item";
import {useCallback, useMemo} from "react";
import {mergeProps} from "@react-aria/utils";
@ -54,7 +55,7 @@ export function useAccordionItem<T extends object = {}>(props: UseAccordionItemP
const isDisabled = state.disabledKeys.has(item.key) || isDisabledProp || groupContext?.isDisabled;
const isOpen = state.selectionManager.isSelected(item.key);
const {buttonProps: buttonCompleteProps, regionProps} = useBaseAccordion(
const {buttonProps: buttonCompleteProps, regionProps} = useAriaAccordionItem(
{item, isDisabled},
{...state, focusedKey: groupContext.focusedKey},
domRef,

View File

@ -1,5 +1,17 @@
# @nextui-org/avatar
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/use-image@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/avatar",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "The Avatar component is used to represent a user, and displays the profile picture, initials or fallback icon.",
"keywords": [
"avatar"

View File

@ -1,5 +1,16 @@
# @nextui-org/badge
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/badge",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Badges are used as a small numerical value or status descriptor for UI elements.",
"keywords": [
"badge"

View File

@ -1,5 +1,18 @@
# @nextui-org/button
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/spinner@0.0.0-dev-v2-20230331020226
- @nextui-org/drip@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/button",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Buttons allow users to perform actions and choose with a single tap.",
"keywords": [
"button"

View File

@ -1,5 +1,17 @@
# @nextui-org/card
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/drip@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/card",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Card is a container for text, photos, and actions in the context of a single subject.",
"keywords": [
"card"

View File

@ -1,5 +1,16 @@
# @nextui-org/checkbox
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/checkbox",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Checkboxes allow users to select multiple items from a list of individual items, or to mark one individual item as selected.",
"keywords": [
"checkbox"

View File

@ -1,5 +1,17 @@
# @nextui-org/chip
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-icons@0.0.0-dev-v2-20230331020226
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/chip",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Chips help people enter information, make selections, filter content, or trigger actions.",
"keywords": [
"chip"

View File

@ -1,5 +1,16 @@
# @nextui-org/code
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/code",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Code is a component used to display inline code.",
"keywords": [
"code"

View File

@ -1,5 +1,16 @@
# @nextui-org/drip
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/drip",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "A ripple effect for ensuring that the user fells the system is reacting instantaneously",
"keywords": [
"drip"

View File

@ -1,5 +1,16 @@
# @nextui-org/link
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/link",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Links allow users to click their way from page to page. This component is styled to resemble a hyperlink and semantically renders an &lt;a&gt;",
"keywords": [
"link"

View File

@ -1,5 +1,18 @@
# @nextui-org/pagination
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-icons@0.0.0-dev-v2-20230331020226
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/use-pagination@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/pagination",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "The Pagination component allows you to display active page and navigate between multiple pages.",
"keywords": [
"pagination"

View File

@ -1,5 +1,17 @@
# @nextui-org/progress
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/use-is-mounted@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/progress",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Progress bars show either determinate or indeterminate progress of an operation over time.",
"keywords": [
"progress"
@ -37,10 +37,10 @@
"react": ">=18"
},
"dependencies": {
"@nextui-org/aria-utils": "workspace:*",
"@nextui-org/dom-utils": "workspace:*",
"@nextui-org/shared-utils": "workspace:*",
"@nextui-org/use-is-mounted": "workspace:*",
"@nextui-org/use-aria-label": "workspace:*",
"@nextui-org/system": "workspace:*",
"@nextui-org/theme": "workspace:*",
"@react-aria/i18n": "^3.7.0",

View File

@ -1,7 +1,7 @@
import {AriaProgressBarProps} from "@react-types/progress";
import {clamp, filterDOMProps, mergeProps} from "@react-aria/utils";
import {DOMAttributes} from "@react-types/shared";
import {useLabel} from "@nextui-org/aria-utils";
import {useAriaLabel} from "@nextui-org/use-aria-label";
import {useNumberFormatter} from "@react-aria/i18n";
export interface ProgressBarAria {
@ -29,7 +29,7 @@ export function useProgressBar(props: AriaProgressBarProps): ProgressBarAria {
} = props;
const domProps = filterDOMProps(props, {labelable: true});
const {labelProps, fieldProps} = useLabel({
const {labelProps, fieldProps} = useAriaLabel({
...props,
// Progress bar is not an HTML input element so it
// shouldn't be labeled by a <label> element.

View File

@ -1,5 +1,16 @@
# @nextui-org/radio
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/radio",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Radios allow users to select a single option from a list of mutually exclusive options.",
"keywords": [
"radio"

View File

@ -1,5 +1,18 @@
# @nextui-org/snippet
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/use-clipboard@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/tooltip@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/snippet",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Display a snippet of copyable code for the command line.",
"keywords": [
"snippet"

View File

@ -1,5 +1,16 @@
# @nextui-org/spinner
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/spinner",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Loaders express an unspecified wait time or display the length of a process.",
"keywords": [
"loading",

View File

@ -1,5 +1,16 @@
# @nextui-org/switch
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/switch",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "A switch is similar to a checkbox, but represents on/off values as opposed to selection.",
"keywords": [
"switch"

View File

@ -1,5 +1,18 @@
# @nextui-org/tooltip
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/framer-transitions@0.0.0-dev-v2-20230331020226
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/react-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/tooltip",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "A React Component for rendering dynamically positioned Tooltips",
"keywords": [
"tooltip"
@ -42,7 +42,6 @@
"@nextui-org/react-utils": "workspace:*",
"@nextui-org/system": "workspace:*",
"@nextui-org/theme": "workspace:*",
"@nextui-org/aria-utils": "workspace:*",
"@nextui-org/framer-transitions": "workspace:*",
"@react-aria/focus": "^3.11.0",
"@react-aria/overlays": "^3.13.0",

View File

@ -1,5 +1,17 @@
# @nextui-org/user
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/avatar@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/user",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Flexible User Profile Component.",
"keywords": [
"user"

View File

@ -1,5 +1,32 @@
# @nextui-org/react
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/pagination@0.0.0-dev-v2-20230331020226
- @nextui-org/accordion@0.0.0-dev-v2-20230331020226
- @nextui-org/checkbox@0.0.0-dev-v2-20230331020226
- @nextui-org/progress@0.0.0-dev-v2-20230331020226
- @nextui-org/snippet@0.0.0-dev-v2-20230331020226
- @nextui-org/spinner@0.0.0-dev-v2-20230331020226
- @nextui-org/tooltip@0.0.0-dev-v2-20230331020226
- @nextui-org/avatar@0.0.0-dev-v2-20230331020226
- @nextui-org/button@0.0.0-dev-v2-20230331020226
- @nextui-org/switch@0.0.0-dev-v2-20230331020226
- @nextui-org/badge@0.0.0-dev-v2-20230331020226
- @nextui-org/radio@0.0.0-dev-v2-20230331020226
- @nextui-org/card@0.0.0-dev-v2-20230331020226
- @nextui-org/chip@0.0.0-dev-v2-20230331020226
- @nextui-org/code@0.0.0-dev-v2-20230331020226
- @nextui-org/drip@0.0.0-dev-v2-20230331020226
- @nextui-org/link@0.0.0-dev-v2-20230331020226
- @nextui-org/user@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
- @nextui-org/theme@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/react",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "🚀 Beautiful and modern React UI library.",
"author": "Junior Garcia <jrgarciadev@gmail.com>",
"homepage": "https://nextui.org",

View File

@ -1,5 +1,11 @@
# @nextui-org/system
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/system",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "NextUI system primitives",
"keywords": [
"system"

View File

@ -1,5 +1,11 @@
# @nextui-org/theme
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/theme",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "The default theme for NextUI components",
"keywords": [
"theme",

View File

@ -0,0 +1,24 @@
# @nextui-org/use-aria-accordion-item
A Quick description of the component
> This is an internal utility, not intended for public usage.
## Installation
```sh
yarn add @nextui-org/use-aria-accordion-item
# or
npm i @nextui-org/use-aria-accordion-item
```
## Contribution
Yes please! See the
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
for details.
## Licence
This project is licensed under the terms of the
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).

View File

@ -0,0 +1,58 @@
{
"name": "@nextui-org/use-aria-accordion-item",
"version": "2.0.0-beta.1",
"description": "Internal impl for react aria accordion item",
"keywords": [
"use-aria-accordion-item"
],
"author": "Junior Garcia <jrgarciadev@gmail.com>",
"homepage": "https://nextui.org",
"license": "MIT",
"main": "src/index.ts",
"sideEffects": false,
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/nextui-org/nextui.git",
"directory": "packages/hooks/use-aria-accordion-item"
},
"bugs": {
"url": "https://github.com/nextui-org/nextui/issues"
},
"scripts": {
"build": "tsup src --dts",
"build:fast": "tsup src",
"dev": "yarn build:fast -- --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"prepack": "clean-package",
"postpack": "clean-package restore"
},
"dependencies": {
"@react-aria/focus": "^3.11.0",
"@react-stately/tree": "^3.5.0",
"@react-aria/button": "^3.7.0"
},
"peerDependencies": {
"react": ">=18"
},
"devDependencies": {
"@react-types/shared": "^3.17.0",
"clean-package": "2.2.0",
"react": "^18.0.0"
},
"clean-package": "../../../clean-package.config.json",
"tsup": {
"clean": true,
"target": "es2019",
"format": [
"cjs",
"esm"
]
}
}

View File

@ -24,7 +24,7 @@ export interface AccordionItemAria {
regionProps: DOMAttributes;
}
export function useAccordionItem<T>(
export function useAriaAccordionItem<T>(
props: AccordionItemAriaProps<T>,
state: TreeState<T> & {
focusedKey?: Key | null;

View File

@ -0,0 +1,4 @@
{
"extends": "../../../tsconfig.json",
"include": ["src", "index.ts"]
}

View File

@ -0,0 +1,24 @@
# @nextui-org/use-aria-label
A Quick description of the component
> This is an internal utility, not intended for public usage.
## Installation
```sh
yarn add @nextui-org/use-aria-label
# or
npm i @nextui-org/use-aria-label
```
## Contribution
Yes please! See the
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
for details.
## Licence
This project is licensed under the terms of the
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).

View File

@ -0,0 +1,56 @@
{
"name": "@nextui-org/use-aria-label",
"version": "2.0.0-beta.1",
"description": "Based on react-aria label hook, it provides the accessibility implementation for labels and their associated elements. Labels provide context for user inputs.",
"keywords": [
"use-aria-label"
],
"author": "Junior Garcia <jrgarciadev@gmail.com>",
"homepage": "https://nextui.org",
"license": "MIT",
"main": "src/index.ts",
"sideEffects": false,
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/nextui-org/nextui.git",
"directory": "packages/hooks/use-aria-label"
},
"bugs": {
"url": "https://github.com/nextui-org/nextui/issues"
},
"scripts": {
"build": "tsup src --dts",
"build:fast": "tsup src",
"dev": "yarn build:fast -- --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"prepack": "clean-package",
"postpack": "clean-package restore"
},
"dependencies": {
"@react-aria/utils": "^3.15.0"
},
"peerDependencies": {
"react": ">=18"
},
"devDependencies": {
"@react-types/shared": "^3.17.0",
"clean-package": "2.2.0",
"react": "^18.0.0"
},
"clean-package": "../../../clean-package.config.json",
"tsup": {
"clean": true,
"target": "es2019",
"format": [
"cjs",
"esm"
]
}
}

View File

@ -1,15 +1,3 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {useId} from "react";
import {AriaLabelingProps, DOMAttributes, DOMProps, LabelableProps} from "@react-types/shared";
import {ElementType, LabelHTMLAttributes} from "react";
@ -35,7 +23,7 @@ export interface LabelAria {
* Labels provide context for user inputs.
* @param props - The props for labels and fields.
*/
export function useLabel(props: LabelAriaProps): LabelAria {
export function useAriaLabel(props: LabelAriaProps): LabelAria {
let {
label,
id: idProp,

View File

@ -0,0 +1,4 @@
{
"extends": "../../../tsconfig.json",
"include": ["src", "index.ts"]
}

View File

@ -1,5 +1,11 @@
# @nextui-org/use-clipboard
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/use-clipboard",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Wrapper around navigator.clipboard with feedback timeout",
"keywords": [
"use-clipboard"

View File

@ -1,5 +1,13 @@
# @nextui-org/use-image
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/use-safe-layout-effect@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/use-image",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "React hook for progressing image loading",
"keywords": [
"use-image"

View File

@ -1,5 +1,11 @@
# @nextui-org/use-is-mounted
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/use-is-mounted",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "This hook can be used to render client-based components or run client logic",
"keywords": [
"use-is-mounted"

View File

@ -1,5 +1,13 @@
# @nextui-org/use-pagination
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/use-pagination",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "State management hook for Pagination component, it lets you manage pagination with controlled and uncontrolled state",
"keywords": [
"use-pagination"

View File

@ -1,5 +1,13 @@
# @nextui-org/use-real-shape
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/dom-utils@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/use-real-shape",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Hook that returns the real dimensions of an element",
"keywords": [
"use-real-shape"

View File

@ -1,5 +1,11 @@
# @nextui-org/use-ref-state
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/use-ref-state",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Hook for saving the state in a ref value",
"keywords": [
"use-ref-state"

View File

@ -1,5 +1,11 @@
# @nextui-org/use-resize
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/use-resize",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Hook that adds an event listener to the resize window event",
"keywords": [
"use-resize"

View File

@ -1,5 +1,11 @@
# @nextui-org/use-safe-layout-effect
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/use-safe-layout-effect",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "",
"keywords": [
"use-safe-layout-effect"

View File

@ -1,5 +1,11 @@
# @nextui-org/use-ssr
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/use-ssr",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "",
"keywords": [
"use-ssr"

View File

@ -1,5 +1,13 @@
# @nextui-org/aria-utils
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/system@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/aria-utils",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "A package for managing @react-aria nextui utils.",
"keywords": [
"aria-utils"
@ -38,17 +38,10 @@
},
"dependencies": {
"@nextui-org/system": "workspace:*",
"@react-aria/button": "^3.7.0",
"@react-aria/focus": "^3.11.0",
"@react-aria/interactions": "^3.14.0",
"@react-aria/selection": "^3.13.0",
"@react-aria/utils": "^3.15.0",
"@react-stately/collections": "^3.6.0",
"@react-stately/tree": "^3.5.0"
"@react-stately/collections": "^3.6.0"
},
"devDependencies": {
"@react-types/button": "^3.7.1",
"@react-types/overlays": "^3.7.0",
"@react-types/shared": "^3.17.0",
"clean-package": "2.2.0",
"react": "^18.0.0"

View File

@ -1 +0,0 @@
export * from "./use-accordion-item";

View File

@ -1,7 +1,3 @@
export * from "./accordion";
export * from "./collections";
export * from "./utils";
export * from "./interactions";
export * from "./type-utils";
export * from "./overlays";
export * from "./label";

View File

@ -1,11 +0,0 @@
import type {FocusRingAria} from "@react-aria/focus";
import type {PressResult} from "@react-aria/interactions";
import type {HTMLAttributes} from "react";
export interface IFocusRingAria<T extends object> extends FocusRingAria {
focusProps: Omit<HTMLAttributes<HTMLElement>, keyof T>;
}
export interface IPressResult<T extends object> extends PressResult {
pressProps: Omit<React.HTMLAttributes<HTMLElement>, keyof T>;
}

View File

@ -1,73 +0,0 @@
import {Placement, PlacementAxis} from "@react-types/overlays";
export type PopoverPlacement =
| "bottom"
| "bottom-left"
| "bottom-right"
| "top"
| "top-left"
| "top-right"
| "left"
| "left-top"
| "left-bottom"
| "right"
| "right-top"
| "right-bottom";
export const getAriaPlacement = (placement?: PopoverPlacement) => {
if (!placement) {
return "bottom" as Placement;
}
return placement.replace("-", " ") as Placement;
};
export const getPopoverPlacementFromAxis = (placementAxis?: PlacementAxis) => {
if (!placementAxis) {
return "bottom";
}
return placementAxis.replace("-", " ") as PopoverPlacement;
};
export const getPopoverPlacement = (ariaPlacement?: Placement) => {
if (!ariaPlacement) {
return "bottom" as Placement;
}
return ariaPlacement.replace(" ", "-") as PopoverPlacement;
};
export const getTransformOrigin = (placement?: PopoverPlacement) => {
if (!placement) {
return "bottom" as Placement;
}
switch (placement) {
case "bottom":
return "top center";
case "top":
return "bottom center";
case "left":
return "right center";
case "right":
return "left center";
case "bottom-left":
return "top left";
case "bottom-right":
return "top right";
case "top-left":
return "bottom left";
case "top-right":
return "bottom right";
case "left-top":
return "right top";
case "left-bottom":
return "right bottom";
case "right-top":
return "left top";
case "right-bottom":
return "left bottom";
default:
return "top center";
}
};

View File

@ -1,5 +1,11 @@
# @nextui-org/dom-utils
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/dom-utils",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "NextUI DOM Utilities",
"keywords": [
"dom-utils"

View File

@ -1,5 +1,14 @@
# @nextui-org/framer-transitions
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/framer-transitions",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "A set of framer motion transitions for react",
"keywords": [
"framer-transitions"

View File

@ -1,5 +1,14 @@
# @nextui-org/react-utils
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
- Updated dependencies
- @nextui-org/shared-utils@0.0.0-dev-v2-20230331020226
- @nextui-org/system@0.0.0-dev-v2-20230331020226
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/react-utils",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "A package for sharing react components and utilities",
"keywords": [
"react-utils"

View File

@ -1,5 +1,11 @@
# @nextui-org/shared-icons
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/shared-icons",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "Internal icons set, commonly used in the components stories",
"keywords": [
"icons-utils"

View File

@ -1,5 +1,11 @@
# @nextui-org/shared-utils
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/shared-utils",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "A set of NextUI utilities",
"keywords": [
"system"

View File

@ -1,5 +1,11 @@
# @nextui-org/test-utils
## 0.0.0-dev-v2-20230331020226
### Patch Changes
- Build size reduced avoiding import all react aria utils
## 0.0.0-dev-v2-20230331012309
### Patch Changes

View File

@ -1,6 +1,6 @@
{
"name": "@nextui-org/test-utils",
"version": "0.0.0-dev-v2-20230331012309",
"version": "0.0.0-dev-v2-20230331020226",
"description": "A set of utilities for react testing",
"keywords": [
"test-utils"

View File

@ -38,7 +38,7 @@
},
"devDependencies": {
"clean-package": "2.2.0",
"react": "^17.0.2
"react": "^18.0.0"
},
"clean-package": "../../../clean-package.config.json",
"tsup": {

67
pnpm-lock.yaml generated
View File

@ -468,6 +468,9 @@ importers:
'@nextui-org/theme':
specifier: workspace:*
version: link:../../core/theme
'@nextui-org/use-aria-accordion-item':
specifier: workspace:*
version: link:../../hooks/use-aria-accordion-item
'@react-aria/accordion':
specifier: 3.0.0-alpha.15
version: 3.0.0-alpha.15(react@18.2.0)
@ -902,6 +905,9 @@ importers:
'@nextui-org/theme':
specifier: workspace:*
version: link:../../core/theme
'@nextui-org/use-aria-label':
specifier: workspace:*
version: link:../../hooks/use-aria-label
'@nextui-org/use-is-mounted':
specifier: workspace:*
version: link:../../hooks/use-is-mounted
@ -1300,6 +1306,44 @@ importers:
specifier: 2.2.0
version: 2.2.0
packages/hooks/use-aria-accordion-item:
dependencies:
'@react-aria/button':
specifier: ^3.7.0
version: 3.7.0(react@18.2.0)
'@react-aria/focus':
specifier: ^3.11.0
version: 3.11.0(react@18.2.0)
'@react-stately/tree':
specifier: ^3.5.0
version: 3.5.0(react@18.2.0)
devDependencies:
'@react-types/shared':
specifier: ^3.17.0
version: 3.17.0(react@18.2.0)
clean-package:
specifier: 2.2.0
version: 2.2.0
react:
specifier: ^18.2.0
version: 18.2.0
packages/hooks/use-aria-label:
dependencies:
'@react-aria/utils':
specifier: ^3.15.0
version: 3.15.0(react@18.2.0)
devDependencies:
'@react-types/shared':
specifier: ^3.17.0
version: 3.17.0(react@18.2.0)
clean-package:
specifier: 2.2.0
version: 2.2.0
react:
specifier: ^18.2.0
version: 18.2.0
packages/hooks/use-clipboard:
devDependencies:
clean-package:
@ -1484,34 +1528,13 @@ importers:
'@nextui-org/system':
specifier: workspace:*
version: link:../../core/system
'@react-aria/button':
specifier: ^3.7.0
version: 3.7.0(react@18.2.0)
'@react-aria/focus':
specifier: ^3.11.0
version: 3.11.0(react@18.2.0)
'@react-aria/interactions':
specifier: ^3.14.0
version: 3.14.0(react@18.2.0)
'@react-aria/selection':
specifier: ^3.13.0
version: 3.13.0(react@18.2.0)
'@react-aria/utils':
specifier: ^3.15.0
version: 3.15.0(react@18.2.0)
'@react-stately/collections':
specifier: ^3.6.0
version: 3.6.0(react@18.2.0)
'@react-stately/tree':
specifier: ^3.5.0
version: 3.5.0(react@18.2.0)
devDependencies:
'@react-types/button':
specifier: ^3.7.1
version: 3.7.1(react@18.2.0)
'@react-types/overlays':
specifier: ^3.7.0
version: 3.7.0(react@18.2.0)
'@react-types/shared':
specifier: ^3.17.0
version: 3.17.0(react@18.2.0)
@ -3881,7 +3904,7 @@ packages:
dependencies:
'@babel/runtime': 7.21.0
'@types/react': 18.0.1
clsx: 1.1.0
clsx: 1.2.1
focus-lock: 0.8.1
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)