@ark-ui/react
Advanced tools
Comparing version 0.0.0-rc-20221111171644 to 0.0.0-rc-20221113160631
@@ -620,3 +620,4 @@ import * as _polymorphic_factory_react from '@polymorphic-factory/react'; | ||
declare type TabPanelProps = Assign<HTMLArkProps<'div'>, Parameters<ReturnType<typeof connect$2>['getContentProps']>[0]>; | ||
declare type GetContentProps = Parameters<ReturnType<typeof connect$2>['getContentProps']>[0]; | ||
declare type TabPanelProps = Assign<HTMLArkProps<'div'>, GetContentProps>; | ||
declare const TabPanel: _polymorphic_factory_react.ComponentWithAs<"div", TabPanelProps>; | ||
@@ -623,0 +624,0 @@ |
@@ -5,2 +5,14 @@ // src/accordion/accordion.tsx | ||
// src/create-split-props.ts | ||
var createSplitProps = () => (props, keys) => keys.reduce( | ||
(previousValue, currentValue) => { | ||
const [target, source] = previousValue; | ||
const key = currentValue; | ||
target[key] = source[key]; | ||
delete source[key]; | ||
return [target, source]; | ||
}, | ||
[{}, { ...props }] | ||
); | ||
// src/factory.tsx | ||
@@ -10,18 +22,2 @@ import { polymorphicFactory } from "@polymorphic-factory/react"; | ||
// src/split-props.ts | ||
function splitProps(props, ...keySelections) { | ||
const rest = { ...props }; | ||
const groups = keySelections.map((keys) => { | ||
return keys.reduce((previousValue, key) => { | ||
if (!(key in rest)) { | ||
return previousValue; | ||
} | ||
previousValue[key] = rest[key]; | ||
delete rest[key]; | ||
return previousValue; | ||
}, {}); | ||
}); | ||
return [...groups, rest]; | ||
} | ||
// src/createContext.ts | ||
@@ -83,3 +79,3 @@ import { createContext as createReactContext, useContext as useReactContext } from "react"; | ||
var Accordion = forwardRef((props, ref) => { | ||
const [useAccordionProps, divProps] = splitProps(props, [ | ||
const [useAccordionProps, divProps] = createSplitProps()(props, [ | ||
"collapsible", | ||
@@ -90,2 +86,3 @@ "defaultValue", | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
@@ -207,3 +204,3 @@ "multiple", | ||
var Checkbox = forwardRef6((props, ref) => { | ||
const [useCheckboxProps, labelprops] = splitProps(props, [ | ||
const [useCheckboxProps, labelprops] = createSplitProps()(props, [ | ||
"aria-describedby", | ||
@@ -219,2 +216,3 @@ "aria-invalid", | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
@@ -439,3 +437,3 @@ "indeterminate", | ||
var Editable = forwardRef16((props, ref) => { | ||
const [useEditableProps, divProps] = splitProps(props, [ | ||
const [useEditableProps, divProps] = createSplitProps()(props, [ | ||
"activationMode", | ||
@@ -447,2 +445,3 @@ "autoResize", | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
@@ -709,3 +708,3 @@ "invalid", | ||
var NumberInput = forwardRef29((props, ref) => { | ||
const [useNumberInputProps, divProps] = splitProps(props, [ | ||
const [useNumberInputProps, divProps] = createSplitProps()(props, [ | ||
"allowMouseWheel", | ||
@@ -720,2 +719,3 @@ "allowOverflow", | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
@@ -828,13 +828,17 @@ "inputMode", | ||
var Pagination = forwardRef33((props, ref) => { | ||
const [paginationProps, { children, ...navProps }] = splitProps(props, [ | ||
"count", | ||
"dir", | ||
"getRootNode", | ||
"ids", | ||
"onChange", | ||
"page", | ||
"pageSize", | ||
"siblingCount", | ||
"translations" | ||
]); | ||
const [paginationProps, { children, ...navProps }] = createSplitProps()( | ||
props, | ||
[ | ||
"count", | ||
"dir", | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
"onChange", | ||
"page", | ||
"pageSize", | ||
"siblingCount", | ||
"translations" | ||
] | ||
); | ||
const pagination2 = usePagination(paginationProps); | ||
@@ -858,4 +862,4 @@ const view = runIfFn(children, pagination2); | ||
var PaginationEllipsis = forwardRef34((props, ref) => { | ||
const { index, ...spanProps } = props; | ||
const { getEllipsisProps } = usePaginationContext(); | ||
const [{ index }, spanProps] = splitProps(props, ["index"]); | ||
const mergedProps = mergeProps32(getEllipsisProps({ index }), spanProps); | ||
@@ -873,4 +877,4 @@ return /* @__PURE__ */ jsx38(ark.span, { | ||
var PaginationItem = forwardRef35((props, ref) => { | ||
const { value, ...anchorProps } = props; | ||
const { getItemProps } = usePaginationContext(); | ||
const [{ value }, anchorProps] = splitProps(props, ["value"]); | ||
const mergedProps = mergeProps33(getItemProps({ type: "page", value }), anchorProps); | ||
@@ -944,3 +948,3 @@ return /* @__PURE__ */ jsx39(ark.a, { | ||
var PinInput = forwardRef38((props, ref) => { | ||
const [usePinInputProps, divProps] = splitProps(props, [ | ||
const [usePinInputProps, divProps] = createSplitProps()(props, [ | ||
"autoFocus", | ||
@@ -952,2 +956,3 @@ "blurOnComplete", | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
@@ -963,2 +968,3 @@ "invalid", | ||
"placeholder", | ||
"selectOnFocus", | ||
"translations", | ||
@@ -1143,3 +1149,3 @@ "type", | ||
var Pressable = forwardRef47((props, ref) => { | ||
const [usePressableProps, divProps] = splitProps(props, [ | ||
const [usePressableProps, divProps] = createSplitProps()(props, [ | ||
"allowTextSelectionOnPress", | ||
@@ -1150,2 +1156,3 @@ "cancelOnPointerExit", | ||
"getRootNode", | ||
"id", | ||
"onLongPress", | ||
@@ -1240,3 +1247,3 @@ "onPress", | ||
var RadioGroup = forwardRef50((props, ref) => { | ||
const [useRadioGroupProps, divProps] = splitProps(props, [ | ||
const [useRadioGroupProps, divProps] = createSplitProps()(props, [ | ||
"defaultValue", | ||
@@ -1246,2 +1253,3 @@ "dir", | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
@@ -1340,3 +1348,3 @@ "name", | ||
var Rating = forwardRef54((props, ref) => { | ||
const [useRatingProps, divProps] = splitProps(props, [ | ||
const [useRatingProps, divProps] = createSplitProps()(props, [ | ||
"allowHalf", | ||
@@ -1348,2 +1356,3 @@ "autoFocus", | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
@@ -1460,3 +1469,3 @@ "max", | ||
var Slider = forwardRef58((props, ref) => { | ||
const [useSliderProps, divProps] = splitProps(props, [ | ||
const [useSliderProps, divProps] = createSplitProps()(props, [ | ||
"aria-label", | ||
@@ -1469,2 +1478,3 @@ "aria-labelledby", | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
@@ -1601,5 +1611,5 @@ "invalid", | ||
var Tab = forwardRef66((props, ref) => { | ||
const [tabProps, buttonProps] = splitProps(props, ["disabled", "value"]); | ||
const { disabled, value, ...buttonProps } = props; | ||
const { getTriggerProps } = useTabsContext(); | ||
const mergedProps = mergeProps64(getTriggerProps(tabProps), buttonProps); | ||
const mergedProps = mergeProps64(getTriggerProps({ disabled, value }), buttonProps); | ||
return /* @__PURE__ */ jsx71(ark.button, { | ||
@@ -1642,3 +1652,3 @@ ...mergedProps, | ||
var TabPanel = forwardRef69((props, ref) => { | ||
const [tabContentProps, divProps] = splitProps(props, ["value"]); | ||
const [tabContentProps, divProps] = createSplitProps()(props, ["value"]); | ||
const { getContentProps } = useTabsContext(); | ||
@@ -1682,6 +1692,7 @@ const mergedProps = mergeProps67(getContentProps(tabContentProps), divProps); | ||
var Tabs = forwardRef71((props, ref) => { | ||
const [useTabsProps, divProps] = splitProps(props, [ | ||
const [useTabsProps, divProps] = createSplitProps()(props, [ | ||
"activationMode", | ||
"dir", | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
@@ -1722,3 +1733,3 @@ "isIndicatorRendered", | ||
var Tag = forwardRef72((props, ref) => { | ||
const [tagProps, divProps] = splitProps(props, ["index", "disabled", "value"]); | ||
const [tagProps, divProps] = createSplitProps()(props, ["index", "disabled", "value"]); | ||
const { getTagProps } = useTagsInputContext(); | ||
@@ -1738,3 +1749,7 @@ const mergedProps = mergeProps70(getTagProps(tagProps), divProps); | ||
const { getTagDeleteButtonProps } = useTagsInputContext(); | ||
const [tagProps, buttonProps] = splitProps(props, ["index", "disabled", "value"]); | ||
const [tagProps, buttonProps] = createSplitProps()(props, [ | ||
"index", | ||
"disabled", | ||
"value" | ||
]); | ||
const mergedProps = mergeProps71(getTagDeleteButtonProps(tagProps), buttonProps); | ||
@@ -1752,3 +1767,3 @@ return /* @__PURE__ */ jsx78(ark.button, { | ||
var TagInput = forwardRef74((props, ref) => { | ||
const [tagProps, inputProps] = splitProps(props, ["index", "disabled", "value"]); | ||
const [tagProps, inputProps] = createSplitProps()(props, ["index", "disabled", "value"]); | ||
const { getTagInputProps } = useTagsInputContext(); | ||
@@ -1789,28 +1804,32 @@ const mergedProps = mergeProps72(getTagInputProps(tagProps), inputProps); | ||
var TagsInput = forwardRef75((props, ref) => { | ||
const [useTagsInputProps, { children, ...inputProps }] = splitProps(props, [ | ||
"addOnPaste", | ||
"allowEditTag", | ||
"allowOverflow", | ||
"autoFocus", | ||
"blurBehavior", | ||
"defaultValue", | ||
"delimiter", | ||
"dir", | ||
"disabled", | ||
"getRootNode", | ||
"ids", | ||
"inputValue", | ||
"invalid", | ||
"max", | ||
"maxLength", | ||
"name", | ||
"onChange", | ||
"onHighlight", | ||
"onInvalid", | ||
"onTagUpdate", | ||
"readonly", | ||
"translations", | ||
"validate", | ||
"value" | ||
]); | ||
const [useTagsInputProps, { children, ...inputProps }] = createSplitProps()( | ||
props, | ||
[ | ||
"addOnPaste", | ||
"allowEditTag", | ||
"allowOverflow", | ||
"autoFocus", | ||
"blurBehavior", | ||
"defaultValue", | ||
"delimiter", | ||
"dir", | ||
"disabled", | ||
"getRootNode", | ||
"id", | ||
"ids", | ||
"inputValue", | ||
"invalid", | ||
"max", | ||
"maxLength", | ||
"name", | ||
"onChange", | ||
"onHighlight", | ||
"onInvalid", | ||
"onTagUpdate", | ||
"readonly", | ||
"translations", | ||
"validate", | ||
"value" | ||
] | ||
); | ||
const tagsInput2 = useTagsInput(useTagsInputProps); | ||
@@ -1817,0 +1836,0 @@ const mergedProps = mergeProps73(tagsInput2.rootProps, inputProps); |
{ | ||
"name": "@ark-ui/react", | ||
"version": "0.0.0-rc-20221111171644", | ||
"version": "0.0.0-rc-20221113160631", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
175881
4618