react-aria-components 1.10.1 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Breadcrumbs.main.js +9 -2
- package/dist/Breadcrumbs.main.js.map +1 -1
- package/dist/Breadcrumbs.mjs +10 -3
- package/dist/Breadcrumbs.module.js +10 -3
- package/dist/Breadcrumbs.module.js.map +1 -1
- package/dist/Button.main.js +7 -17
- package/dist/Button.main.js.map +1 -1
- package/dist/Button.mjs +7 -17
- package/dist/Button.module.js +7 -17
- package/dist/Button.module.js.map +1 -1
- package/dist/Calendar.main.js +36 -14
- package/dist/Calendar.main.js.map +1 -1
- package/dist/Calendar.mjs +38 -16
- package/dist/Calendar.module.js +38 -16
- package/dist/Calendar.module.js.map +1 -1
- package/dist/Checkbox.main.js +8 -3
- package/dist/Checkbox.main.js.map +1 -1
- package/dist/Checkbox.mjs +10 -5
- package/dist/Checkbox.module.js +10 -5
- package/dist/Checkbox.module.js.map +1 -1
- package/dist/Collection.main.js.map +1 -1
- package/dist/Collection.module.js.map +1 -1
- package/dist/ColorArea.main.js +4 -4
- package/dist/ColorArea.main.js.map +1 -1
- package/dist/ColorArea.mjs +5 -5
- package/dist/ColorArea.module.js +5 -5
- package/dist/ColorArea.module.js.map +1 -1
- package/dist/ColorField.main.js +14 -1
- package/dist/ColorField.main.js.map +1 -1
- package/dist/ColorField.mjs +14 -1
- package/dist/ColorField.module.js +14 -1
- package/dist/ColorField.module.js.map +1 -1
- package/dist/ColorSlider.main.js +3 -1
- package/dist/ColorSlider.main.js.map +1 -1
- package/dist/ColorSlider.mjs +3 -1
- package/dist/ColorSlider.module.js +3 -1
- package/dist/ColorSlider.module.js.map +1 -1
- package/dist/ColorSwatch.main.js +6 -2
- package/dist/ColorSwatch.main.js.map +1 -1
- package/dist/ColorSwatch.mjs +6 -2
- package/dist/ColorSwatch.module.js +6 -2
- package/dist/ColorSwatch.module.js.map +1 -1
- package/dist/ColorSwatchPicker.main.js.map +1 -1
- package/dist/ColorSwatchPicker.module.js.map +1 -1
- package/dist/ColorThumb.main.js +3 -1
- package/dist/ColorThumb.main.js.map +1 -1
- package/dist/ColorThumb.mjs +3 -1
- package/dist/ColorThumb.module.js +3 -1
- package/dist/ColorThumb.module.js.map +1 -1
- package/dist/ColorWheel.main.js +3 -1
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +3 -1
- package/dist/ColorWheel.module.js +3 -1
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/ComboBox.main.js +4 -1
- package/dist/ComboBox.main.js.map +1 -1
- package/dist/ComboBox.mjs +4 -1
- package/dist/ComboBox.module.js +4 -1
- package/dist/ComboBox.module.js.map +1 -1
- package/dist/DateField.main.js +16 -3
- package/dist/DateField.main.js.map +1 -1
- package/dist/DateField.mjs +16 -3
- package/dist/DateField.module.js +16 -3
- package/dist/DateField.module.js.map +1 -1
- package/dist/DatePicker.main.js +15 -8
- package/dist/DatePicker.main.js.map +1 -1
- package/dist/DatePicker.mjs +16 -9
- package/dist/DatePicker.module.js +16 -9
- package/dist/DatePicker.module.js.map +1 -1
- package/dist/Dialog.main.js +4 -3
- package/dist/Dialog.main.js.map +1 -1
- package/dist/Dialog.mjs +5 -4
- package/dist/Dialog.module.js +5 -4
- package/dist/Dialog.module.js.map +1 -1
- package/dist/Disclosure.main.js +12 -10
- package/dist/Disclosure.main.js.map +1 -1
- package/dist/Disclosure.mjs +13 -11
- package/dist/Disclosure.module.js +13 -11
- package/dist/Disclosure.module.js.map +1 -1
- package/dist/DragAndDrop.main.js +31 -3
- package/dist/DragAndDrop.main.js.map +1 -1
- package/dist/DragAndDrop.mjs +31 -3
- package/dist/DragAndDrop.module.js +31 -3
- package/dist/DragAndDrop.module.js.map +1 -1
- package/dist/DropZone.main.js +4 -3
- package/dist/DropZone.main.js.map +1 -1
- package/dist/DropZone.mjs +4 -3
- package/dist/DropZone.module.js +4 -3
- package/dist/DropZone.module.js.map +1 -1
- package/dist/FieldError.main.js +3 -1
- package/dist/FieldError.main.js.map +1 -1
- package/dist/FieldError.mjs +3 -1
- package/dist/FieldError.module.js +3 -1
- package/dist/FieldError.module.js.map +1 -1
- package/dist/FileTrigger.main.js +3 -1
- package/dist/FileTrigger.main.js.map +1 -1
- package/dist/FileTrigger.mjs +3 -1
- package/dist/FileTrigger.module.js +3 -1
- package/dist/FileTrigger.module.js.map +1 -1
- package/dist/Form.main.js.map +1 -1
- package/dist/Form.module.js.map +1 -1
- package/dist/GridList.main.js +20 -13
- package/dist/GridList.main.js.map +1 -1
- package/dist/GridList.mjs +21 -14
- package/dist/GridList.module.js +21 -14
- package/dist/GridList.module.js.map +1 -1
- package/dist/HiddenDateInput.main.js +118 -0
- package/dist/HiddenDateInput.main.js.map +1 -0
- package/dist/HiddenDateInput.mjs +109 -0
- package/dist/HiddenDateInput.module.js +109 -0
- package/dist/HiddenDateInput.module.js.map +1 -0
- package/dist/Link.main.js +7 -1
- package/dist/Link.main.js.map +1 -1
- package/dist/Link.mjs +7 -1
- package/dist/Link.module.js +7 -1
- package/dist/Link.module.js.map +1 -1
- package/dist/ListBox.main.js +22 -19
- package/dist/ListBox.main.js.map +1 -1
- package/dist/ListBox.mjs +23 -20
- package/dist/ListBox.module.js +23 -20
- package/dist/ListBox.module.js.map +1 -1
- package/dist/Menu.main.js +15 -8
- package/dist/Menu.main.js.map +1 -1
- package/dist/Menu.mjs +16 -9
- package/dist/Menu.module.js +16 -9
- package/dist/Menu.module.js.map +1 -1
- package/dist/Meter.main.js +6 -2
- package/dist/Meter.main.js.map +1 -1
- package/dist/Meter.mjs +6 -2
- package/dist/Meter.module.js +6 -2
- package/dist/Meter.module.js.map +1 -1
- package/dist/Modal.main.js +31 -6
- package/dist/Modal.main.js.map +1 -1
- package/dist/Modal.mjs +31 -6
- package/dist/Modal.module.js +31 -6
- package/dist/Modal.module.js.map +1 -1
- package/dist/NumberField.main.js +4 -1
- package/dist/NumberField.main.js.map +1 -1
- package/dist/NumberField.mjs +4 -1
- package/dist/NumberField.module.js +4 -1
- package/dist/NumberField.module.js.map +1 -1
- package/dist/Popover.main.js +3 -1
- package/dist/Popover.main.js.map +1 -1
- package/dist/Popover.mjs +3 -1
- package/dist/Popover.module.js +3 -1
- package/dist/Popover.module.js.map +1 -1
- package/dist/ProgressBar.main.js +6 -2
- package/dist/ProgressBar.main.js.map +1 -1
- package/dist/ProgressBar.mjs +6 -2
- package/dist/ProgressBar.module.js +6 -2
- package/dist/ProgressBar.module.js.map +1 -1
- package/dist/RadioGroup.main.js +8 -3
- package/dist/RadioGroup.main.js.map +1 -1
- package/dist/RadioGroup.mjs +9 -4
- package/dist/RadioGroup.module.js +9 -4
- package/dist/RadioGroup.module.js.map +1 -1
- package/dist/SearchField.main.js +3 -1
- package/dist/SearchField.main.js.map +1 -1
- package/dist/SearchField.mjs +3 -1
- package/dist/SearchField.module.js +3 -1
- package/dist/SearchField.module.js.map +1 -1
- package/dist/Select.main.js +12 -14
- package/dist/Select.main.js.map +1 -1
- package/dist/Select.mjs +13 -15
- package/dist/Select.module.js +13 -15
- package/dist/Select.module.js.map +1 -1
- package/dist/Separator.main.js +4 -2
- package/dist/Separator.main.js.map +1 -1
- package/dist/Separator.mjs +5 -3
- package/dist/Separator.module.js +5 -3
- package/dist/Separator.module.js.map +1 -1
- package/dist/Slider.main.js +7 -5
- package/dist/Slider.main.js.map +1 -1
- package/dist/Slider.mjs +8 -6
- package/dist/Slider.module.js +8 -6
- package/dist/Slider.module.js.map +1 -1
- package/dist/Switch.main.js +4 -1
- package/dist/Switch.main.js.map +1 -1
- package/dist/Switch.mjs +4 -1
- package/dist/Switch.module.js +4 -1
- package/dist/Switch.module.js.map +1 -1
- package/dist/Table.main.js +47 -26
- package/dist/Table.main.js.map +1 -1
- package/dist/Table.mjs +48 -27
- package/dist/Table.module.js +48 -27
- package/dist/Table.module.js.map +1 -1
- package/dist/Tabs.main.js +20 -10
- package/dist/Tabs.main.js.map +1 -1
- package/dist/Tabs.mjs +21 -11
- package/dist/Tabs.module.js +21 -11
- package/dist/Tabs.module.js.map +1 -1
- package/dist/TagGroup.main.js +14 -8
- package/dist/TagGroup.main.js.map +1 -1
- package/dist/TagGroup.mjs +14 -8
- package/dist/TagGroup.module.js +14 -8
- package/dist/TagGroup.module.js.map +1 -1
- package/dist/TextField.main.js +13 -1
- package/dist/TextField.main.js.map +1 -1
- package/dist/TextField.mjs +13 -1
- package/dist/TextField.module.js +13 -1
- package/dist/TextField.module.js.map +1 -1
- package/dist/Toast.main.js +9 -5
- package/dist/Toast.main.js.map +1 -1
- package/dist/Toast.mjs +9 -5
- package/dist/Toast.module.js +9 -5
- package/dist/Toast.module.js.map +1 -1
- package/dist/ToggleButton.main.js +8 -2
- package/dist/ToggleButton.main.js.map +1 -1
- package/dist/ToggleButton.mjs +8 -2
- package/dist/ToggleButton.module.js +8 -2
- package/dist/ToggleButton.module.js.map +1 -1
- package/dist/ToggleButtonGroup.main.js +6 -2
- package/dist/ToggleButtonGroup.main.js.map +1 -1
- package/dist/ToggleButtonGroup.mjs +6 -2
- package/dist/ToggleButtonGroup.module.js +6 -2
- package/dist/ToggleButtonGroup.module.js.map +1 -1
- package/dist/Toolbar.main.js +4 -3
- package/dist/Toolbar.main.js.map +1 -1
- package/dist/Toolbar.mjs +4 -3
- package/dist/Toolbar.module.js +4 -3
- package/dist/Toolbar.module.js.map +1 -1
- package/dist/Tooltip.main.js +5 -3
- package/dist/Tooltip.main.js.map +1 -1
- package/dist/Tooltip.mjs +5 -3
- package/dist/Tooltip.module.js +5 -3
- package/dist/Tooltip.module.js.map +1 -1
- package/dist/Tree.main.js +73 -26
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +74 -27
- package/dist/Tree.module.js +74 -27
- package/dist/Tree.module.js.map +1 -1
- package/dist/TreeDropTargetDelegate.main.js +8 -5
- package/dist/TreeDropTargetDelegate.main.js.map +1 -1
- package/dist/TreeDropTargetDelegate.mjs +8 -5
- package/dist/TreeDropTargetDelegate.module.js +8 -5
- package/dist/TreeDropTargetDelegate.module.js.map +1 -1
- package/dist/import.mjs +5 -5
- package/dist/main.js +4 -4
- package/dist/main.js.map +1 -1
- package/dist/module.js +5 -5
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +212 -203
- package/dist/types.d.ts.map +1 -1
- package/dist/useDragAndDrop.main.js.map +1 -1
- package/dist/useDragAndDrop.module.js.map +1 -1
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.module.js.map +1 -1
- package/i18n/de-DE.js +1 -1
- package/i18n/de-DE.mjs +1 -1
- package/package.json +25 -25
- package/src/Breadcrumbs.tsx +10 -6
- package/src/Button.tsx +8 -30
- package/src/Calendar.tsx +41 -24
- package/src/Checkbox.tsx +8 -6
- package/src/Collection.tsx +2 -2
- package/src/ColorArea.tsx +5 -6
- package/src/ColorField.tsx +6 -4
- package/src/ColorSlider.tsx +3 -2
- package/src/ColorSwatch.tsx +6 -3
- package/src/ColorSwatchPicker.tsx +3 -3
- package/src/ColorThumb.tsx +3 -3
- package/src/ColorWheel.tsx +6 -5
- package/src/ComboBox.tsx +4 -4
- package/src/DateField.tsx +15 -10
- package/src/DatePicker.tsx +14 -12
- package/src/Dialog.tsx +6 -6
- package/src/Disclosure.tsx +10 -14
- package/src/DragAndDrop.tsx +31 -1
- package/src/DropZone.tsx +4 -5
- package/src/FieldError.tsx +3 -3
- package/src/FileTrigger.tsx +4 -3
- package/src/Form.tsx +2 -1
- package/src/GridList.tsx +25 -18
- package/src/HiddenDateInput.tsx +142 -0
- package/src/Link.tsx +7 -3
- package/src/ListBox.tsx +30 -26
- package/src/Menu.tsx +15 -12
- package/src/Meter.tsx +6 -3
- package/src/Modal.tsx +16 -5
- package/src/NumberField.tsx +4 -4
- package/src/Popover.tsx +3 -3
- package/src/ProgressBar.tsx +6 -2
- package/src/RadioGroup.tsx +8 -6
- package/src/SearchField.tsx +3 -2
- package/src/Select.tsx +13 -16
- package/src/Separator.tsx +6 -4
- package/src/Slider.tsx +9 -11
- package/src/Switch.tsx +4 -3
- package/src/Table.tsx +58 -56
- package/src/Tabs.tsx +18 -15
- package/src/TagGroup.tsx +13 -12
- package/src/TextField.tsx +5 -2
- package/src/Toast.tsx +10 -8
- package/src/ToggleButton.tsx +8 -4
- package/src/ToggleButtonGroup.tsx +6 -4
- package/src/Toolbar.tsx +4 -5
- package/src/Tooltip.tsx +6 -5
- package/src/Tree.tsx +90 -42
- package/src/TreeDropTargetDelegate.ts +5 -1
- package/src/index.ts +8 -8
- package/src/useDragAndDrop.tsx +2 -2
- package/src/utils.tsx +9 -9
package/dist/Breadcrumbs.main.js
CHANGED
|
@@ -40,13 +40,16 @@ const $afa44b644f65ed30$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $l7mU3$react.
|
|
|
40
40
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $afa44b644f65ed30$export$65596d3621b0a4a0);
|
|
41
41
|
let { CollectionRoot: CollectionRoot } = (0, $l7mU3$react.useContext)((0, $3114c2382242bdc0$exports.CollectionRendererContext));
|
|
42
42
|
let { navProps: navProps } = (0, $l7mU3$reactaria.useBreadcrumbs)(props);
|
|
43
|
+
let DOMProps = (0, $l7mU3$reactariautils.filterDOMProps)(props, {
|
|
44
|
+
global: true
|
|
45
|
+
});
|
|
43
46
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($l7mU3$react))).createElement((0, $l7mU3$reactariacollections.CollectionBuilder), {
|
|
44
47
|
content: /*#__PURE__*/ (0, ($parcel$interopDefault($l7mU3$react))).createElement((0, $l7mU3$reactariacollections.Collection), props)
|
|
45
48
|
}, (collection)=>{
|
|
46
49
|
var _props_className;
|
|
47
50
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($l7mU3$react))).createElement("ol", {
|
|
48
51
|
ref: ref,
|
|
49
|
-
...navProps,
|
|
52
|
+
...(0, $l7mU3$reactariautils.mergeProps)(DOMProps, navProps),
|
|
50
53
|
slot: props.slot || undefined,
|
|
51
54
|
style: props.style,
|
|
52
55
|
className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : 'react-aria-Breadcrumbs'
|
|
@@ -75,8 +78,12 @@ const $afa44b644f65ed30$export$dabcc1ec9dd9d1cc = /*#__PURE__*/ (0, $l7mU3$react
|
|
|
75
78
|
},
|
|
76
79
|
defaultClassName: 'react-aria-Breadcrumb'
|
|
77
80
|
});
|
|
81
|
+
let DOMProps = (0, $l7mU3$reactariautils.filterDOMProps)(props, {
|
|
82
|
+
global: true
|
|
83
|
+
});
|
|
84
|
+
delete DOMProps.id;
|
|
78
85
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($l7mU3$react))).createElement("li", {
|
|
79
|
-
...
|
|
86
|
+
...DOMProps,
|
|
80
87
|
...renderProps,
|
|
81
88
|
ref: ref,
|
|
82
89
|
"data-disabled": isDisabled || isCurrent || undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAyD;AAKhG,MAAM,2CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,YAA8B,KAA0B,EAAE,GAAmC;IAC5K,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,mDAAwB;IAC1D,IAAI,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,+BAAa,EAAE;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAyD;AAKhG,MAAM,2CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,YAA8B,KAA0B,EAAE,GAAmC;IAC5K,CAAC,OAAO,I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AAS,EAAE;IAElB,qBACE,0DAAC;QACE,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,cAAc,aAAa;QAC1C,gBAAc,aAAa;qBAC3B,0DAAC,CAAA,GAAA,qCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Breadcrumbs.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {ContextValue, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\nimport {LinkContext} from './Link';\nimport {Node} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps, GlobalDOMAttributes<HTMLOListElement> {\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a breadcrumb is clicked. */\n onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nexport const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {navProps} = useBreadcrumbs(props);\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => (\n <ol\n ref={ref}\n {...mergeProps(DOMProps, navProps)}\n slot={props.slot || undefined}\n style={props.style}\n className={props.className ?? 'react-aria-Breadcrumbs'}>\n <BreadcrumbsContext.Provider value={props}>\n <CollectionRoot collection={collection} />\n </BreadcrumbsContext.Provider>\n </ol>\n )}\n </CollectionBuilder>\n );\n});\n\nexport interface BreadcrumbRenderProps {\n /**\n * Whether the breadcrumb is for the current page.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the breadcrumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps>, GlobalDOMAttributes<HTMLLIElement> {\n /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n id?: Key\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent('item', function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n let isCurrent = node.nextKey == null;\n let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n let linkProps = {\n 'aria-current': isCurrent ? 'page' : null,\n isDisabled: isDisabled || isCurrent,\n onPress: () => onAction?.(node.key)\n };\n\n let renderProps = useRenderProps({\n ...node.props,\n children: node.rendered,\n values: {isDisabled: isDisabled || isCurrent, isCurrent},\n defaultClassName: 'react-aria-Breadcrumb'\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n\n return (\n <li\n {...DOMProps}\n {...renderProps}\n ref={ref}\n data-disabled={isDisabled || isCurrent || undefined}\n data-current={isCurrent || undefined}>\n <LinkContext.Provider value={linkProps}>\n {renderProps.children}\n </LinkContext.Provider>\n </li>\n );\n});\n"],"names":[],"version":3,"file":"Breadcrumbs.main.js.map"}
|
package/dist/Breadcrumbs.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderP
|
|
|
3
3
|
import {LinkContext as $4f118338184dc1d9$export$e2509388b49734e7} from "./Link.mjs";
|
|
4
4
|
import {useBreadcrumbs as $c5cc5$useBreadcrumbs} from "react-aria";
|
|
5
5
|
import {CollectionBuilder as $c5cc5$CollectionBuilder, Collection as $c5cc5$Collection, createLeafComponent as $c5cc5$createLeafComponent} from "@react-aria/collections";
|
|
6
|
-
import {filterDOMProps as $c5cc5$filterDOMProps} from "@react-aria/utils";
|
|
6
|
+
import {filterDOMProps as $c5cc5$filterDOMProps, mergeProps as $c5cc5$mergeProps} from "@react-aria/utils";
|
|
7
7
|
import $c5cc5$react, {createContext as $c5cc5$createContext, forwardRef as $c5cc5$forwardRef, useContext as $c5cc5$useContext} from "react";
|
|
8
8
|
|
|
9
9
|
/*
|
|
@@ -28,13 +28,16 @@ const $778035c5624f61e7$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $c5cc5$forwar
|
|
|
28
28
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $778035c5624f61e7$export$65596d3621b0a4a0);
|
|
29
29
|
let { CollectionRoot: CollectionRoot } = (0, $c5cc5$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
30
30
|
let { navProps: navProps } = (0, $c5cc5$useBreadcrumbs)(props);
|
|
31
|
+
let DOMProps = (0, $c5cc5$filterDOMProps)(props, {
|
|
32
|
+
global: true
|
|
33
|
+
});
|
|
31
34
|
return /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$CollectionBuilder), {
|
|
32
35
|
content: /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$Collection), props)
|
|
33
36
|
}, (collection)=>{
|
|
34
37
|
var _props_className;
|
|
35
38
|
return /*#__PURE__*/ (0, $c5cc5$react).createElement("ol", {
|
|
36
39
|
ref: ref,
|
|
37
|
-
...navProps,
|
|
40
|
+
...(0, $c5cc5$mergeProps)(DOMProps, navProps),
|
|
38
41
|
slot: props.slot || undefined,
|
|
39
42
|
style: props.style,
|
|
40
43
|
className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : 'react-aria-Breadcrumbs'
|
|
@@ -63,8 +66,12 @@ const $778035c5624f61e7$export$dabcc1ec9dd9d1cc = /*#__PURE__*/ (0, $c5cc5$creat
|
|
|
63
66
|
},
|
|
64
67
|
defaultClassName: 'react-aria-Breadcrumb'
|
|
65
68
|
});
|
|
69
|
+
let DOMProps = (0, $c5cc5$filterDOMProps)(props, {
|
|
70
|
+
global: true
|
|
71
|
+
});
|
|
72
|
+
delete DOMProps.id;
|
|
66
73
|
return /*#__PURE__*/ (0, $c5cc5$react).createElement("li", {
|
|
67
|
-
...
|
|
74
|
+
...DOMProps,
|
|
68
75
|
...renderProps,
|
|
69
76
|
ref: ref,
|
|
70
77
|
"data-disabled": isDisabled || isCurrent || undefined,
|
|
@@ -3,7 +3,7 @@ import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderP
|
|
|
3
3
|
import {LinkContext as $4f118338184dc1d9$export$e2509388b49734e7} from "./Link.module.js";
|
|
4
4
|
import {useBreadcrumbs as $c5cc5$useBreadcrumbs} from "react-aria";
|
|
5
5
|
import {CollectionBuilder as $c5cc5$CollectionBuilder, Collection as $c5cc5$Collection, createLeafComponent as $c5cc5$createLeafComponent} from "@react-aria/collections";
|
|
6
|
-
import {filterDOMProps as $c5cc5$filterDOMProps} from "@react-aria/utils";
|
|
6
|
+
import {filterDOMProps as $c5cc5$filterDOMProps, mergeProps as $c5cc5$mergeProps} from "@react-aria/utils";
|
|
7
7
|
import $c5cc5$react, {createContext as $c5cc5$createContext, forwardRef as $c5cc5$forwardRef, useContext as $c5cc5$useContext} from "react";
|
|
8
8
|
|
|
9
9
|
/*
|
|
@@ -28,13 +28,16 @@ const $778035c5624f61e7$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $c5cc5$forwar
|
|
|
28
28
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $778035c5624f61e7$export$65596d3621b0a4a0);
|
|
29
29
|
let { CollectionRoot: CollectionRoot } = (0, $c5cc5$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
30
30
|
let { navProps: navProps } = (0, $c5cc5$useBreadcrumbs)(props);
|
|
31
|
+
let DOMProps = (0, $c5cc5$filterDOMProps)(props, {
|
|
32
|
+
global: true
|
|
33
|
+
});
|
|
31
34
|
return /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$CollectionBuilder), {
|
|
32
35
|
content: /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$Collection), props)
|
|
33
36
|
}, (collection)=>{
|
|
34
37
|
var _props_className;
|
|
35
38
|
return /*#__PURE__*/ (0, $c5cc5$react).createElement("ol", {
|
|
36
39
|
ref: ref,
|
|
37
|
-
...navProps,
|
|
40
|
+
...(0, $c5cc5$mergeProps)(DOMProps, navProps),
|
|
38
41
|
slot: props.slot || undefined,
|
|
39
42
|
style: props.style,
|
|
40
43
|
className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : 'react-aria-Breadcrumbs'
|
|
@@ -63,8 +66,12 @@ const $778035c5624f61e7$export$dabcc1ec9dd9d1cc = /*#__PURE__*/ (0, $c5cc5$creat
|
|
|
63
66
|
},
|
|
64
67
|
defaultClassName: 'react-aria-Breadcrumb'
|
|
65
68
|
});
|
|
69
|
+
let DOMProps = (0, $c5cc5$filterDOMProps)(props, {
|
|
70
|
+
global: true
|
|
71
|
+
});
|
|
72
|
+
delete DOMProps.id;
|
|
66
73
|
return /*#__PURE__*/ (0, $c5cc5$react).createElement("li", {
|
|
67
|
-
...
|
|
74
|
+
...DOMProps,
|
|
68
75
|
...renderProps,
|
|
69
76
|
ref: ref,
|
|
70
77
|
"data-disabled": isDisabled || isCurrent || undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAyD;AAKhG,MAAM,2CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,YAA8B,KAA0B,EAAE,GAAmC;IAC5K,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAwB;IAC1D,IAAI,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAyD;AAKhG,MAAM,2CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,YAA8B,KAA0B,EAAE,GAAmC;IAC5K,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAwB;IAC1D,IAAI,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;IAChC,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC,CAAA,GAAA,wBAAgB;QAAE,uBAAS,gCAAC,CAAA,GAAA,iBAAS,GAAM;OACzC,CAAA;YAMc;6BALb,gCAAC;YACC,KAAK;YACJ,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,SAAS;YAClC,MAAM,MAAM,IAAI,IAAI;YACpB,OAAO,MAAM,KAAK;YAClB,WAAW,CAAA,mBAAA,MAAM,SAAS,cAAf,8BAAA,mBAAmB;yBAC9B,gCAAC,0CAAmB,QAAQ;YAAC,OAAO;yBAClC,gCAAC;YAAe,YAAY;;;AAMxC;AAuBO,MAAM,4CAAa,WAAW,GAAG,CAAA,GAAA,0BAAkB,EAAE,QAAQ,SAAS,WAAW,KAAsB,EAAE,GAAgC,EAAE,IAAmB;IACnK,sGAAsG;IACtG,IAAI,YAAY,KAAK,OAAO,IAAI;IAChC,IAAI,cAAC,UAAU,YAAE,QAAQ,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE;IAC/C,IAAI,YAAY;QACd,gBAAgB,YAAY,SAAS;QACrC,YAAY,cAAc;QAC1B,SAAS,IAAM,qBAAA,+BAAA,SAAW,KAAK,GAAG;IACpC;IAEA,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK,KAAK;QACb,UAAU,KAAK,QAAQ;QACvB,QAAQ;YAAC,YAAY,cAAc;uBAAW;QAAS;QACvD,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAc;QAAC,QAAQ;IAAI;IACzD,OAAO,SAAS,EAAE;IAElB,qBACE,gCAAC;QACE,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,cAAc,aAAa;QAC1C,gBAAc,aAAa;qBAC3B,gCAAC,CAAA,GAAA,yCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Breadcrumbs.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {ContextValue, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\nimport {LinkContext} from './Link';\nimport {Node} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps, GlobalDOMAttributes<HTMLOListElement> {\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a breadcrumb is clicked. */\n onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nexport const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {navProps} = useBreadcrumbs(props);\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => (\n <ol\n ref={ref}\n {...mergeProps(DOMProps, navProps)}\n slot={props.slot || undefined}\n style={props.style}\n className={props.className ?? 'react-aria-Breadcrumbs'}>\n <BreadcrumbsContext.Provider value={props}>\n <CollectionRoot collection={collection} />\n </BreadcrumbsContext.Provider>\n </ol>\n )}\n </CollectionBuilder>\n );\n});\n\nexport interface BreadcrumbRenderProps {\n /**\n * Whether the breadcrumb is for the current page.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the breadcrumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps>, GlobalDOMAttributes<HTMLLIElement> {\n /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n id?: Key\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent('item', function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n let isCurrent = node.nextKey == null;\n let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n let linkProps = {\n 'aria-current': isCurrent ? 'page' : null,\n isDisabled: isDisabled || isCurrent,\n onPress: () => onAction?.(node.key)\n };\n\n let renderProps = useRenderProps({\n ...node.props,\n children: node.rendered,\n values: {isDisabled: isDisabled || isCurrent, isCurrent},\n defaultClassName: 'react-aria-Breadcrumb'\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n\n return (\n <li\n {...DOMProps}\n {...renderProps}\n ref={ref}\n data-disabled={isDisabled || isCurrent || undefined}\n data-current={isCurrent || undefined}>\n <LinkContext.Provider value={linkProps}>\n {renderProps.children}\n </LinkContext.Provider>\n </li>\n );\n});\n"],"names":[],"version":3,"file":"Breadcrumbs.module.js.map"}
|
package/dist/Button.main.js
CHANGED
|
@@ -34,16 +34,6 @@ $parcel$export(module.exports, "Button", () => $b856e6788a7ea5bf$export$353f5b6f
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
const $b856e6788a7ea5bf$var$additionalButtonHTMLAttributes = new Set([
|
|
38
|
-
'form',
|
|
39
|
-
'formAction',
|
|
40
|
-
'formEncType',
|
|
41
|
-
'formMethod',
|
|
42
|
-
'formNoValidate',
|
|
43
|
-
'formTarget',
|
|
44
|
-
'name',
|
|
45
|
-
'value'
|
|
46
|
-
]);
|
|
47
37
|
const $b856e6788a7ea5bf$export$24d547caef80ccd1 = /*#__PURE__*/ (0, $3vfYa$react.createContext)({});
|
|
48
38
|
const $b856e6788a7ea5bf$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $3vfYa$reactariacollections.createHideableComponent)(function Button(props, ref) {
|
|
49
39
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $b856e6788a7ea5bf$export$24d547caef80ccd1);
|
|
@@ -92,14 +82,14 @@ const $b856e6788a7ea5bf$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $3vfYa$react
|
|
|
92
82
|
ariaLabelledby,
|
|
93
83
|
buttonId
|
|
94
84
|
]);
|
|
95
|
-
|
|
96
|
-
|
|
85
|
+
let DOMProps = (0, $3vfYa$reactariautils.filterDOMProps)(props, {
|
|
86
|
+
global: true
|
|
87
|
+
});
|
|
88
|
+
delete DOMProps.onClick;
|
|
97
89
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($3vfYa$react))).createElement("button", {
|
|
98
|
-
...(0, $3vfYa$
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
...(0, $3vfYa$reactaria.mergeProps)(buttonProps, focusProps, hoverProps),
|
|
102
|
-
...renderProps,
|
|
90
|
+
...(0, $3vfYa$reactaria.mergeProps)(DOMProps, renderProps, buttonProps, focusProps, hoverProps),
|
|
91
|
+
// When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
|
|
92
|
+
// We do this by changing the button's type to button.
|
|
103
93
|
type: buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type,
|
|
104
94
|
id: butt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QAChB,MAAM,YAAY,GAAG;QACrB,MAAM,UAAU,GAAG;QACnB,MAAM,aAAa,GAAG;QACtB,MAAM,SAAS,GAAG;QAClB,MAAM,SAAS,GAAG;QAClB,MAAM,OAAO,GAAG;QAChB,MAAM,OAAO,GAAG;QAChB,MAAM,IAAI,GAAG;IACf;IACA,OAAO;AACT","sources":["packages/react-aria-components/src/Button.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {announce} from '@react-aria/live-announcer';\nimport {\n AriaButtonProps,\n HoverEvents,\n mergeProps,\n useButton,\n useFocusRing,\n useHover,\n useId\n} from 'react-aria';\nimport {\n ContextValue,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {ProgressBarContext} from './ProgressBar';\nimport React, {createContext, ForwardedRef, useEffect, useRef} from 'react';\n\nexport interface ButtonRenderProps {\n /**\n * Whether the button is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the button is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the button is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the button is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the button is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the button is currently in a pending state.\n * @selector [data-pending]\n */\n isPending: boolean\n}\n\nexport interface ButtonProps extends Omit<AriaButtonProps, 'children' | 'href' | 'target' | 'rel' | 'elementType'>, HoverEvents, SlotProps, RenderProps<ButtonRenderProps>, Omit<GlobalDOMAttributes<HTMLButtonElement>, 'onClick'> {\n /**\n * Whether the button is in a pending state. This disables press and hover events\n * while retaining focusability, and announces the pending state to screen readers.\n */\n isPending?: boolean\n}\n\ninterface ButtonContextValue extends ButtonProps {\n isPressed?: boolean\n}\n\nexport const ButtonContext = createContext<ContextValue<ButtonContextValue, HTMLButtonElement>>({});\n\n/**\n * A button allows a user to perform an action, with mouse, touch, and keyboard interactions.\n */\nexport const Button = /*#__PURE__*/ createHideableComponent(function Button(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ButtonContext);\n props = disablePendingProps(props);\n let ctx = props as ButtonContextValue;\n let {isPending} = ctx;\n let {buttonProps, isPressed} = useButton(props, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: props.isDisabled || isPending\n });\n let renderValues = {\n isHovered,\n isPressed: (ctx.isPressed || isPressed) && !isPending,\n isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isPending: isPending ?? false\n };\n\n let renderProps = useRenderProps({\n ...props,\n values: renderValues,\n defaultClassName: 'react-aria-Button'\n });\n\n let buttonId = useId(buttonProps.id);\n let progressId = useId();\n\n let ariaLabelledby = buttonProps['aria-labelledby'];\n if (isPending) {\n // aria-labelledby wins over aria-label\n // https://www.w3.org/TR/accname-1.2/#computation-steps\n if (ariaLabelledby) {\n ariaLabelledby = `${ariaLabelledby} ${progressId}`;\n } else if (buttonProps['aria-label']) {\n ariaLabelledby = `${buttonId} ${progressId}`;\n }\n }\n\n let wasPending = useRef(isPending);\n useEffect(() => {\n let message = {'aria-labelledby': ariaLabelledby || buttonId};\n if (!wasPending.current && isFocused && isPending) {\n announce(message, 'assertive');\n } else if (wasPending.current && isFocused && !isPending) {\n announce(message, 'assertive');\n }\n wasPending.current = isPending;\n }, [isPending, isFocused, ariaLabelledby, buttonId]);\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.onClick;\n\n return (\n <button\n {...mergeProps(DOMProps, renderProps, buttonProps, focusProps, hoverProps)}\n // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).\n // We do this by changing the button's type to button.\n type={buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type}\n id={buttonId}\n ref={ref}\n aria-labelledby={ariaLabelledby}\n slot={props.slot || undefined}\n aria-disabled={isPending ? 'true' : buttonProps['aria-disabled']}\n data-disabled={props.isDisabled || undefined}\n data-pressed={renderValues.isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-pending={isPending || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <ProgressBarContext.Provider value={{id: progressId}}>\n {renderProps.children}\n </ProgressBarContext.Provider>\n </button>\n );\n});\n\nfunction disablePendingProps(props) {\n // Don't allow interaction while isPending is true\n if (props.isPending) {\n props.onPress = undefined;\n props.onPressStart = undefined;\n props.onPressEnd = undefined;\n props.onPressChange = undefined;\n props.onPressUp = undefined;\n props.onKeyDown = undefined;\n props.onKeyUp = undefined;\n props.onClick = undefined;\n props.href = undefined;\n }\n return props;\n}\n"],"names":[],"version":3,"file":"Button.main.js.map"}
|
package/dist/Button.mjs
CHANGED
|
@@ -23,16 +23,6 @@ import $fM325$react, {createContext as $fM325$createContext, useRef as $fM325$us
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
const $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes = new Set([
|
|
27
|
-
'form',
|
|
28
|
-
'formAction',
|
|
29
|
-
'formEncType',
|
|
30
|
-
'formMethod',
|
|
31
|
-
'formNoValidate',
|
|
32
|
-
'formTarget',
|
|
33
|
-
'name',
|
|
34
|
-
'value'
|
|
35
|
-
]);
|
|
36
26
|
const $d2b4bc8c273e7be6$export$24d547caef80ccd1 = /*#__PURE__*/ (0, $fM325$createContext)({});
|
|
37
27
|
const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $fM325$createHideableComponent)(function Button(props, ref) {
|
|
38
28
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $d2b4bc8c273e7be6$export$24d547caef80ccd1);
|
|
@@ -81,14 +71,14 @@ const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $fM325$creat
|
|
|
81
71
|
ariaLabelledby,
|
|
82
72
|
buttonId
|
|
83
73
|
]);
|
|
84
|
-
|
|
85
|
-
|
|
74
|
+
let DOMProps = (0, $fM325$filterDOMProps)(props, {
|
|
75
|
+
global: true
|
|
76
|
+
});
|
|
77
|
+
delete DOMProps.onClick;
|
|
86
78
|
return /*#__PURE__*/ (0, $fM325$react).createElement("button", {
|
|
87
|
-
...(0, $fM325$
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
...(0, $fM325$mergeProps)(buttonProps, focusProps, hoverProps),
|
|
91
|
-
...renderProps,
|
|
79
|
+
...(0, $fM325$mergeProps)(DOMProps, renderProps, buttonProps, focusProps, hoverProps),
|
|
80
|
+
// When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
|
|
81
|
+
// We do this by changing the button's type to button.
|
|
92
82
|
type: buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type,
|
|
93
83
|
id: buttonId,
|
|
94
84
|
ref: ref,
|
package/dist/Button.module.js
CHANGED
|
@@ -23,16 +23,6 @@ import $fM325$react, {createContext as $fM325$createContext, useRef as $fM325$us
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
const $d2b4bc8c273e7be6$var$additionalButtonHTMLAttributes = new Set([
|
|
27
|
-
'form',
|
|
28
|
-
'formAction',
|
|
29
|
-
'formEncType',
|
|
30
|
-
'formMethod',
|
|
31
|
-
'formNoValidate',
|
|
32
|
-
'formTarget',
|
|
33
|
-
'name',
|
|
34
|
-
'value'
|
|
35
|
-
]);
|
|
36
26
|
const $d2b4bc8c273e7be6$export$24d547caef80ccd1 = /*#__PURE__*/ (0, $fM325$createContext)({});
|
|
37
27
|
const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $fM325$createHideableComponent)(function Button(props, ref) {
|
|
38
28
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $d2b4bc8c273e7be6$export$24d547caef80ccd1);
|
|
@@ -81,14 +71,14 @@ const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $fM325$creat
|
|
|
81
71
|
ariaLabelledby,
|
|
82
72
|
buttonId
|
|
83
73
|
]);
|
|
84
|
-
|
|
85
|
-
|
|
74
|
+
let DOMProps = (0, $fM325$filterDOMProps)(props, {
|
|
75
|
+
global: true
|
|
76
|
+
});
|
|
77
|
+
delete DOMProps.onClick;
|
|
86
78
|
return /*#__PURE__*/ (0, $fM325$react).createElement("button", {
|
|
87
|
-
...(0, $fM325$
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
...(0, $fM325$mergeProps)(buttonProps, focusProps, hoverProps),
|
|
91
|
-
...renderProps,
|
|
79
|
+
...(0, $fM325$mergeProps)(DOMProps, renderProps, buttonProps, focusProps, hoverProps),
|
|
80
|
+
// When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
|
|
81
|
+
// We do this by changing the button's type to button.
|
|
92
82
|
type: buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type,
|
|
93
83
|
id: buttonId,
|
|
94
84
|
ref: ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAsEM,MAAM,0DAAgB,CAAA,GAAA,oBAA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right 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {announce} from '@react-aria/live-announcer';\nimport {\n AriaButtonProps,\n HoverEvents,\n mergeProps,\n useButton,\n useFocusRing,\n useHover,\n useId\n} from 'react-aria';\nimport {\n ContextValue,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {ProgressBarContext} from './ProgressBar';\nimport React, {createContext, ForwardedRef, useEffect, useRef} from 'react';\n\nexport interface ButtonRenderProps {\n /**\n * Whether the button is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the button is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the button is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the button is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the button is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the button is currently in a pending state.\n * @selector [data-pending]\n */\n isPending: boolean\n}\n\nexport interface ButtonProps extends Omit<AriaButtonProps, 'children' | 'href' | 'target' | 'rel' | 'elementType'>, HoverEvents, SlotProps, RenderProps<ButtonRenderProps>, Omit<GlobalDOMAttributes<HTMLButtonElement>, 'onClick'> {\n /**\n * Whether the button is in a pending state. This disables press and hover events\n * while retaining focusability, and announces the pending state to screen readers.\n */\n isPending?: boolean\n}\n\ninterface ButtonContextValue extends ButtonProps {\n isPressed?: boolean\n}\n\nexport const ButtonContext = createContext<ContextValue<ButtonContextValue, HTMLButtonElement>>({});\n\n/**\n * A button allows a user to perform an action, with mouse, touch, and keyboard interactions.\n */\nexport const Button = /*#__PURE__*/ createHideableComponent(function Button(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ButtonContext);\n props = disablePendingProps(props);\n let ctx = props as ButtonContextValue;\n let {isPending} = ctx;\n let {buttonProps, isPressed} = useButton(props, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: props.isDisabled || isPending\n });\n let renderValues = {\n isHovered,\n isPressed: (ctx.isPressed || isPressed) && !isPending,\n isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isPending: isPending ?? false\n };\n\n let renderProps = useRenderProps({\n ...props,\n values: renderValues,\n defaultClassName: 'react-aria-Button'\n });\n\n let buttonId = useId(buttonProps.id);\n let progressId = useId();\n\n let ariaLabelledby = buttonProps['aria-labelledby'];\n if (isPending) {\n // aria-labelledby wins over aria-label\n // https://www.w3.org/TR/accname-1.2/#computation-steps\n if (ariaLabelledby) {\n ariaLabelledby = `${ariaLabelledby} ${progressId}`;\n } else if (buttonProps['aria-label']) {\n ariaLabelledby = `${buttonId} ${progressId}`;\n }\n }\n\n let wasPending = useRef(isPending);\n useEffect(() => {\n let message = {'aria-labelledby': ariaLabelledby || buttonId};\n if (!wasPending.current && isFocused && isPending) {\n announce(message, 'assertive');\n } else if (wasPending.current && isFocused && !isPending) {\n announce(message, 'assertive');\n }\n wasPending.current = isPending;\n }, [isPending, isFocused, ariaLabelledby, buttonId]);\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.onClick;\n\n return (\n <button\n {...mergeProps(DOMProps, renderProps, buttonProps, focusProps, hoverProps)}\n // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).\n // We do this by changing the button's type to button.\n type={buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type}\n id={buttonId}\n ref={ref}\n aria-labelledby={ariaLabelledby}\n slot={props.slot || undefined}\n aria-disabled={isPending ? 'true' : buttonProps['aria-disabled']}\n data-disabled={props.isDisabled || undefined}\n data-pressed={renderValues.isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-pending={isPending || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <ProgressBarContext.Provider value={{id: progressId}}>\n {renderProps.children}\n </ProgressBarContext.Provider>\n </button>\n );\n});\n\nfunction disablePendingProps(props) {\n // Don't allow interaction while isPending is true\n if (props.isPending) {\n props.onPress = undefined;\n props.onPressStart = undefined;\n props.onPressEnd = undefined;\n props.onPressChange = undefined;\n props.onPressUp = undefined;\n props.onKeyDown = undefined;\n props.onKeyUp = undefined;\n props.onClick = undefined;\n props.href = undefined;\n }\n return props;\n}\n"],"names":[],"version":3,"file":"Button.module.js.map"}
|
package/dist/Calendar.main.js
CHANGED
|
@@ -69,9 +69,11 @@ const $3f539f26b167ddde$export$e1aef45b828286de = /*#__PURE__*/ (0, $iJp6C$react
|
|
|
69
69
|
},
|
|
70
70
|
defaultClassName: 'react-aria-Calendar'
|
|
71
71
|
});
|
|
72
|
+
let DOMProps = (0, $iJp6C$reactariautils.filterDOMProps)(props, {
|
|
73
|
+
global: true
|
|
74
|
+
});
|
|
72
75
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("div", {
|
|
73
|
-
...renderProps,
|
|
74
|
-
...calendarProps,
|
|
76
|
+
...(0, $iJp6C$reactaria.mergeProps)(DOMProps, renderProps, calendarProps),
|
|
75
77
|
ref: ref,
|
|
76
78
|
slot: props.slot || undefined,
|
|
77
79
|
"data-disabled": props.isDisabled || undefined,
|
|
@@ -137,9 +139,11 @@ const $3f539f26b167ddde$export$a4f5c8b89d277a8d = /*#__PURE__*/ (0, $iJp6C$react
|
|
|
137
139
|
},
|
|
138
140
|
defaultClassName: 'react-aria-RangeCalendar'
|
|
139
141
|
});
|
|
142
|
+
let DOMProps = (0, $iJp6C$reactariautils.filterDOMProps)(props, {
|
|
143
|
+
global: true
|
|
144
|
+
});
|
|
140
145
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("div", {
|
|
141
|
-
...renderProps,
|
|
142
|
-
...calendarProps,
|
|
146
|
+
...(0, $iJp6C$reactaria.mergeProps)(renderProps, DOMProps, calendarProps),
|
|
143
147
|
ref: ref,
|
|
144
148
|
slot: props.slot || undefined,
|
|
145
149
|
"data-disabled": props.isDisabled || undefined,
|
|
@@ -204,6 +208,9 @@ const $3f539f26b167ddde$export$5bd780d491cfc46c = /*#__PURE__*/ (0, $iJp6C$react
|
|
|
204
208
|
weekdayStyle: props.weekdayStyle,
|
|
205
209
|
firstDayOfWeek: firstDayOfWeek
|
|
206
210
|
}, state);
|
|
211
|
+
let DOMProps = (0, $iJp6C$reactariautils.filterDOMProps)(props, {
|
|
212
|
+
global: true
|
|
213
|
+
});
|
|
207
214
|
var _props_className;
|
|
208
215
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement($3f539f26b167ddde$var$InternalCalendarGridContext.Provider, {
|
|
209
216
|
value: {
|
|
@@ -213,19 +220,21 @@ const $3f539f26b167ddde$export$5bd780d491cfc46c = /*#__PURE__*/ (0, $iJp6C$react
|
|
|
213
220
|
weeksInMonth: weeksInMonth
|
|
214
221
|
}
|
|
215
222
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("table", {
|
|
216
|
-
...(0, $iJp6C$
|
|
217
|
-
...gridProps,
|
|
223
|
+
...(0, $iJp6C$reactaria.mergeProps)(DOMProps, gridProps),
|
|
218
224
|
ref: ref,
|
|
219
225
|
style: props.style,
|
|
226
|
+
cellPadding: 0,
|
|
220
227
|
className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : 'react-aria-CalendarGrid'
|
|
221
228
|
}, typeof props.children !== 'function' ? props.children : /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement((0, ($parcel$interopDefault($iJp6C$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement($3f539f26b167ddde$export$22e2d15eaa4d2377, null, (day)=>/*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement($3f539f26b167ddde$export$ad2135cac3a11b3d, null, day)), /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement($3f539f26b167ddde$export$e11f8ba65d857bff, null, props.children))));
|
|
222
229
|
});
|
|
223
230
|
function $3f539f26b167ddde$var$CalendarGridHeader(props, ref) {
|
|
224
231
|
let { children: children, style: style, className: className } = props;
|
|
225
232
|
let { headerProps: headerProps, weekDays: weekDays } = (0, $iJp6C$react.useContext)($3f539f26b167ddde$var$InternalCalendarGridContext);
|
|
233
|
+
let DOMProps = (0, $iJp6C$reactariautils.filterDOMProps)(props, {
|
|
234
|
+
global: true
|
|
235
|
+
});
|
|
226
236
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("thead", {
|
|
227
|
-
...(0, $iJp6C$
|
|
228
|
-
...headerProps,
|
|
237
|
+
...(0, $iJp6C$reactaria.mergeProps)(DOMProps, headerProps),
|
|
229
238
|
ref: ref,
|
|
230
239
|
style: style,
|
|
231
240
|
className: className || 'react-aria-CalendarGridHeader'
|
|
@@ -238,8 +247,11 @@ function $3f539f26b167ddde$var$CalendarGridHeader(props, ref) {
|
|
|
238
247
|
*/ const $3f539f26b167ddde$export$22e2d15eaa4d2377 = /*#__PURE__*/ (0, $iJp6C$react.forwardRef)($3f539f26b167ddde$var$CalendarGridHeader);
|
|
239
248
|
function $3f539f26b167ddde$var$CalendarHeaderCell(props, ref) {
|
|
240
249
|
let { children: children, style: style, className: className } = props;
|
|
250
|
+
let DOMProps = (0, $iJp6C$reactariautils.filterDOMProps)(props, {
|
|
251
|
+
global: true
|
|
252
|
+
});
|
|
241
253
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("th", {
|
|
242
|
-
...
|
|
254
|
+
...DOMProps,
|
|
243
255
|
ref: ref,
|
|
244
256
|
style: style,
|
|
245
257
|
className: className || 'react-aria-CalendarHeaderCell'
|
|
@@ -254,8 +266,11 @@ function $3f539f26b167ddde$var$CalendarGridBody(props, ref) {
|
|
|
254
266
|
let rangeCalendarState = (0, $iJp6C$react.useContext)($3f539f26b167ddde$export$5e0fc348c00f87a0);
|
|
255
267
|
let state = calendarState !== null && calendarState !== void 0 ? calendarState : rangeCalendarState;
|
|
256
268
|
let { startDate: startDate, weeksInMonth: weeksInMonth } = (0, $iJp6C$react.useContext)($3f539f26b167ddde$var$InternalCalendarGridContext);
|
|
269
|
+
let DOMProps = (0, $iJp6C$reactariautils.filterDOMProps)(props, {
|
|
270
|
+
global: true
|
|
271
|
+
});
|
|
257
272
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("tbody", {
|
|
258
|
-
...
|
|
273
|
+
...DOMProps,
|
|
259
274
|
ref: ref,
|
|
260
275
|
style: style,
|
|
261
276
|
className: className || 'react-aria-CalendarGridBody'
|
|
@@ -280,9 +295,12 @@ const $3f539f26b167ddde$export$5d847498420df57b = /*#__PURE__*/ (0, $iJp6C$react
|
|
|
280
295
|
let { startDate: currentMonth } = (_useContext = (0, $iJp6C$react.useContext)($3f539f26b167ddde$var$InternalCalendarGridContext)) !== null && _useContext !== void 0 ? _useContext : {
|
|
281
296
|
startDate: state.visibleRange.start
|
|
282
297
|
};
|
|
298
|
+
let isOutsideMonth = !(0, $iJp6C$internationalizeddate.isSameMonth)(currentMonth, date);
|
|
299
|
+
let istoday = (0, $iJp6C$internationalizeddate.isToday)(date, state.timeZone);
|
|
283
300
|
let buttonRef = (0, $iJp6C$react.useRef)(null);
|
|
284
301
|
let { cellProps: cellProps, buttonProps: buttonProps, ...states } = (0, $iJp6C$reactaria.useCalendarCell)({
|
|
285
|
-
date: date
|
|
302
|
+
date: date,
|
|
303
|
+
isOutsideMonth: isOutsideMonth
|
|
286
304
|
}, state, buttonRef);
|
|
287
305
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $iJp6C$reactaria.useHover)({
|
|
288
306
|
...otherProps,
|
|
@@ -290,7 +308,6 @@ const $3f539f26b167ddde$export$5d847498420df57b = /*#__PURE__*/ (0, $iJp6C$react
|
|
|
290
308
|
});
|
|
291
309
|
let { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $iJp6C$reactaria.useFocusRing)();
|
|
292
310
|
isFocusVisible && (isFocusVisible = states.isFocused);
|
|
293
|
-
let isOutsideMonth = !(0, $iJp6C$internationalizeddate.isSameMonth)(currentMonth, date);
|
|
294
311
|
let isSelectionStart = false;
|
|
295
312
|
let isSelectionEnd = false;
|
|
296
313
|
if ('highlightedRange' in state && state.highlightedRange) {
|
|
@@ -308,6 +325,7 @@ const $3f539f26b167ddde$export$5d847498420df57b = /*#__PURE__*/ (0, $iJp6C$react
|
|
|
308
325
|
isFocusVisible: isFocusVisible,
|
|
309
326
|
isSelectionStart: isSelectionStart,
|
|
310
327
|
isSelectionEnd: isSelectionEnd,
|
|
328
|
+
isToday: istoday,
|
|
311
329
|
...states
|
|
312
330
|
}
|
|
313
331
|
});
|
|
@@ -323,13 +341,17 @@ const $3f539f26b167ddde$export$5d847498420df57b = /*#__PURE__*/ (0, $iJp6C$react
|
|
|
323
341
|
'data-selected': states.isSelected || undefined,
|
|
324
342
|
'data-selection-start': isSelectionStart || undefined,
|
|
325
343
|
'data-selection-end': isSelectionEnd || undefined,
|
|
326
|
-
'data-invalid': states.isInvalid || undefined
|
|
344
|
+
'data-invalid': states.isInvalid || undefined,
|
|
345
|
+
'data-today': istoday || undefined
|
|
327
346
|
};
|
|
347
|
+
let DOMProps = (0, $iJp6C$reactariautils.filterDOMProps)(otherProps, {
|
|
348
|
+
global: true
|
|
349
|
+
});
|
|
328
350
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("td", {
|
|
329
351
|
...cellProps,
|
|
330
352
|
ref: ref
|
|
331
353
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($iJp6C$react))).createElement("div", {
|
|
332
|
-
...(0, $iJp6C$reactaria.mergeProps)(
|
|
354
|
+
...(0, $iJp6C$reactaria.mergeProps)(DOMProps, buttonProps, focusProps, hoverProps, dataAttrs, renderProps),
|
|
333
355
|
ref: buttonRef
|
|
334
356
|
}));
|
|
335
357
|
});
|