@planningcenter/tapestry 4.15.0-rc.0 → 4.15.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/components/DataTable/ActiveFilterInstance.d.ts +6 -0
- package/dist/components/DataTable/ActiveFilterInstance.d.ts.map +1 -1
- package/dist/components/DataTable/ActiveFilterInstance.js +13 -0
- package/dist/components/DataTable/ActiveFilterInstance.js.map +1 -1
- package/dist/components/DataTable/CollectionEditorsLazy.d.ts +1 -1
- package/dist/components/DataTable/CollectionEditorsLazy.d.ts.map +1 -1
- package/dist/components/DataTable/CollectionEditorsLazy.js +2 -2
- package/dist/components/DataTable/CollectionEditorsLazy.js.map +1 -1
- package/dist/components/DataTable/CollectionEditorsShared.d.ts +4 -8
- package/dist/components/DataTable/CollectionEditorsShared.d.ts.map +1 -1
- package/dist/components/DataTable/CollectionEditorsShared.js +2 -2
- package/dist/components/DataTable/CollectionEditorsShared.js.map +1 -1
- package/dist/components/DataTable/CollectionEditorsStatic.d.ts +4 -5
- package/dist/components/DataTable/CollectionEditorsStatic.d.ts.map +1 -1
- package/dist/components/DataTable/CollectionEditorsStatic.js +9 -9
- package/dist/components/DataTable/CollectionEditorsStatic.js.map +1 -1
- package/dist/components/DataTable/DataTable.d.ts +27 -5
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.js +13 -2
- package/dist/components/DataTable/DataTable.js.map +1 -1
- package/dist/components/DataTable/DataTableRow.d.ts +2 -0
- package/dist/components/DataTable/DataTableRow.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableRow.js.map +1 -1
- package/dist/components/DataTable/RowActions.d.ts +7 -3
- package/dist/components/DataTable/RowActions.d.ts.map +1 -1
- package/dist/components/DataTable/RowActions.js +7 -2
- package/dist/components/DataTable/RowActions.js.map +1 -1
- package/dist/components/DataTable/collectionFilter.js +1 -1
- package/dist/components/DataTable/collectionFilter.js.map +1 -1
- package/dist/components/DataTable/dateFilter.js +5 -5
- package/dist/components/DataTable/dateFilter.js.map +1 -1
- package/dist/components/DataTable/dayFilter.js +4 -3
- package/dist/components/DataTable/dayFilter.js.map +1 -1
- package/dist/components/DataTable/index.d.ts +1 -1
- package/dist/components/DataTable/index.d.ts.map +1 -1
- package/dist/components/DataTable/numberFilter.js +3 -2
- package/dist/components/DataTable/numberFilter.js.map +1 -1
- package/dist/components/DataTable/scopedFilter.js +5 -1
- package/dist/components/DataTable/scopedFilter.js.map +1 -1
- package/dist/components/DataTable/textFilter.js +1 -1
- package/dist/components/DataTable/textFilter.js.map +1 -1
- package/dist/components/button/ActionsDropdownIconButton.js +2 -2
- package/dist/components/button/ActionsDropdownIconButton.js.map +1 -1
- package/dist/components/button/BaseButton.js +4 -4
- package/dist/components/button/BaseButton.js.map +1 -1
- package/dist/components/button/Button.js +2 -2
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button/DropdownButton.js +3 -3
- package/dist/components/button/DropdownButton.js.map +1 -1
- package/dist/components/button/DropdownIconButton.js +2 -2
- package/dist/components/button/DropdownIconButton.js.map +1 -1
- package/dist/components/button/IconButton.js +4 -4
- package/dist/components/button/IconButton.js.map +1 -1
- package/dist/components/button/LoadingButton.js +2 -2
- package/dist/components/button/LoadingButton.js.map +1 -1
- package/dist/components/button/PageHeaderActionsDropdownButton.js +3 -3
- package/dist/components/button/PageHeaderActionsDropdownButton.js.map +1 -1
- package/dist/components/combo-box/ComboBox.js +31 -31
- package/dist/components/combo-box/ComboBox.js.map +1 -1
- package/dist/components/date-picker/DatePicker.js +42 -42
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/dropdown/Dropdown.js +13 -13
- package/dist/components/dropdown/Dropdown.js.map +1 -1
- package/dist/components/field/Field.js +5 -5
- package/dist/components/field/Field.js.map +1 -1
- package/dist/components/internal/LoadingSpinner.js +2 -2
- package/dist/components/internal/LoadingSpinner.js.map +1 -1
- package/dist/components/internal/tooltip/Tooltip.js +8 -8
- package/dist/components/internal/tooltip/Tooltip.js.map +1 -1
- package/dist/components/link/BaseLink.js +3 -3
- package/dist/components/link/BaseLink.js.map +1 -1
- package/dist/components/link/IconLink.js +4 -4
- package/dist/components/link/IconLink.js.map +1 -1
- package/dist/components/link/Link.js +2 -2
- package/dist/components/link/Link.js.map +1 -1
- package/dist/components/number-stepper/NumberStepper.js +11 -11
- package/dist/components/number-stepper/NumberStepper.js.map +1 -1
- package/dist/components/page-header/PageHeader.js +10 -10
- package/dist/components/page-header/PageHeader.js.map +1 -1
- package/dist/components/search-input/SearchInput.js +6 -6
- package/dist/components/search-input/SearchInput.js.map +1 -1
- package/dist/components/select/Select.js +6 -6
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select/SelectNative.js +6 -6
- package/dist/components/select/SelectNative.js.map +1 -1
- package/dist/components/select/SelectOptions.js +9 -9
- package/dist/components/select/SelectOptions.js.map +1 -1
- package/dist/components/select/SelectPopover.js +14 -14
- package/dist/components/select/SelectPopover.js.map +1 -1
- package/dist/components/sidenav/Sidenav.js +6 -6
- package/dist/components/sidenav/Sidenav.js.map +1 -1
- package/dist/components/sidenav/SidenavItem.js +2 -2
- package/dist/components/sidenav/SidenavItem.js.map +1 -1
- package/dist/components/sidenav/SidenavSection.js +7 -7
- package/dist/components/sidenav/SidenavSection.js.map +1 -1
- package/dist/components/sidenav/private/SidenavResponsiveHeader.js +6 -6
- package/dist/components/sidenav/private/SidenavResponsiveHeader.js.map +1 -1
- package/dist/components/sidenav/private/withSlotChildrenAsActions.js +7 -7
- package/dist/components/sidenav/private/withSlotChildrenAsActions.js.map +1 -1
- package/dist/components/time-field/TimeField.js +8 -8
- package/dist/components/time-field/TimeField.js.map +1 -1
- package/dist/packages/tapestry-render/dist/buildComponent-DzY2PDMT.js +4 -4
- package/dist/packages/tapestry-render/dist/buildComponent-DzY2PDMT.js.map +1 -1
- package/dist/reactRender.css +696 -657
- package/dist/reactRender.css.map +1 -1
- package/dist/reactRenderLegacy.css +696 -657
- package/dist/reactRenderLegacy.css.map +1 -1
- package/dist/tapestryMount.css +696 -657
- package/dist/tapestryMount.css.map +1 -1
- package/dist/tapestryMountLegacy.css +696 -657
- package/dist/tapestryMountLegacy.css.map +1 -1
- package/dist/unstable.css +45 -6
- package/dist/unstable.css.map +1 -1
- package/dist/utilities/Icon.js +2 -2
- package/dist/utilities/Icon.js.map +1 -1
- package/dist/utilities/buttonLinkShared.js +2 -2
- package/dist/utilities/buttonLinkShared.js.map +1 -1
- package/dist/utilities/locale.js +34 -5
- package/dist/utilities/locale.js.map +1 -1
- package/docs/components/DataTable.md +23 -5
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectPopover.js","sources":["../../../src/components/select/SelectPopover.tsx"],"sourcesContent":["import {\n ComboboxAction,\n getComboboxActionFromKey,\n getUpdatedIndex,\n} from \"@utilities/keyboardUtils\"\nimport {\n getDataAttributes,\n getIndexByLetter,\n getSelectableOptionsFromSegments,\n normalizeOptions,\n type Segment,\n} from \"@utilities/selectUtils\"\nimport { useId } from \"@utilities/useId\"\nimport React, {\n forwardRef,\n type SelectHTMLAttributes,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\n\nimport type { SelectItem, SelectOption } from \"./Select\"\nimport { SelectOptions } from \"./SelectOptions\"\n\ninterface ToggleEvent extends Event {\n newState: \"closed\" | \"open\"\n oldState: \"closed\" | \"open\"\n}\n\nexport interface SelectPopoverProps {\n \"aria-describedby\"?: string\n \"aria-label\"?: string\n \"aria-labelledby\"?: string\n defaultValue?: string\n disabled?: boolean\n id?: string\n invalid?: boolean\n /** A flat or mixed array of options and option groups. */\n options: SelectItem[]\n /** Placeholder text shown in the trigger button when no option is selected. `null` suppresses the placeholder. */\n placeholder: string | null\n required?: boolean\n triggerRef?: React.RefObject<HTMLButtonElement>\n value?: string\n}\n\nexport type SelectPopoverElementProps = Omit<\n SelectHTMLAttributes<HTMLSelectElement>,\n keyof SelectPopoverProps | \"multiple\"\n> &\n SelectPopoverProps\n\nconst Group = ({\n children,\n disabled,\n id,\n label,\n}: {\n children: React.ReactNode\n disabled?: boolean\n id: string\n label: string\n}) => (\n <ul aria-disabled={disabled || undefined} aria-labelledby={id} role=\"group\">\n <li id={id} role=\"presentation\">\n <span>{label}</span>\n </li>\n {children}\n </ul>\n)\n\nfunction renderListSegments(\n segments: Segment[],\n baseId: string,\n renderItem: (option: SelectOption, index: number) => React.ReactNode\n) {\n let flatIndex = 0\n\n return segments.map((segment, segmentIndex) => {\n const startIndex = flatIndex\n flatIndex += segment.options.length\n\n if (segment.type === \"group\") {\n return (\n <Group\n key={`${segment.label}-${segmentIndex}`}\n disabled={segment.disabled}\n id={`${baseId}-group-${segmentIndex}`}\n label={segment.label}\n >\n {segment.options.map((opt, i) => renderItem(opt, startIndex + i))}\n </Group>\n )\n }\n\n return (\n <ul key={`options-${segmentIndex}`} role=\"presentation\">\n {segment.options.map((opt, i) => renderItem(opt, startIndex + i))}\n </ul>\n )\n })\n}\n\n/**\n * Internal component. Not intended for direct use — consume `Select` instead.\n *\n * The popover listbox implementation used by `Select` when `complex` is\n * true. Renders a button trigger and a custom listbox that supports rich\n * option content (icons, descriptions) along with keyboard navigation,\n * type-ahead, and option groups.\n *\n * @internal\n */\nexport const SelectPopover = forwardRef<\n HTMLSelectElement,\n SelectPopoverElementProps\n>(\n (\n {\n \"aria-describedby\": ariaDescribedBy,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n defaultValue,\n disabled,\n id,\n invalid,\n onBlur,\n onChange,\n onClick,\n onFocus,\n options,\n placeholder,\n required,\n triggerRef,\n value,\n ...props\n }: SelectPopoverElementProps,\n ref\n ) => {\n const stableId = useId()\n const baseId = id || `tds-select-popover-${stableId}`\n\n const [isOpen, setIsOpen] = useState(false)\n const [uncontrolledValue, setUncontrolledValue] = useState<string | null>(\n defaultValue ?? null\n )\n const [activeIndex, setActiveIndex] = useState(-1)\n\n const isControlled = value !== undefined\n const selectedValue = isControlled ? (value ?? null) : uncontrolledValue\n\n const { allOptions, segments } = useMemo(() => {\n const segments = normalizeOptions(options)\n const allOptions = getSelectableOptionsFromSegments(segments)\n return { allOptions, segments }\n }, [options])\n\n const selectedOption = allOptions.find((opt) => opt.value === selectedValue)\n\n const activeOption = activeIndex >= 0 ? allOptions[activeIndex] : undefined\n const activeOptionId = activeOption\n ? `${baseId}-option-${activeOption.value}`\n : undefined\n\n const popoverRef = useRef<HTMLDivElement>(null)\n const internalTriggerRef = useRef<HTMLButtonElement | null>(null)\n const resolvedTriggerRef = triggerRef ?? internalTriggerRef\n const hiddenSelectRef = useRef<HTMLSelectElement | null>(null)\n const pendingChangeValueRef = useRef<string | null>(null)\n const searchStringRef = useRef(\"\")\n const searchTimeoutRef = useRef<ReturnType<typeof setTimeout>>()\n\n const setHiddenSelectRef = useCallback(\n (element: HTMLSelectElement | null) => {\n hiddenSelectRef.current = element\n if (typeof ref === \"function\") {\n ref(element)\n } else if (ref) {\n ref.current = element\n }\n },\n [ref]\n )\n\n useEffect(() => {\n const popoverEl = popoverRef.current\n if (!popoverEl) return\n\n const handleToggle = (e: Event) => {\n const newIsOpen = (e as ToggleEvent).newState === \"open\"\n setIsOpen(newIsOpen)\n\n if (newIsOpen) {\n const index = allOptions.findIndex(\n (opt) => opt.value === selectedValue && !opt.disabled\n )\n if (index >= 0) {\n setActiveIndex(index)\n } else {\n // Find first non-disabled option\n const firstEnabledIndexOrFirstIndex = Math.max(\n allOptions.findIndex((opt) => !opt.disabled),\n 0\n )\n setActiveIndex(firstEnabledIndexOrFirstIndex)\n }\n } else {\n setActiveIndex(-1)\n }\n }\n\n popoverEl.addEventListener(\"toggle\", handleToggle)\n return () => popoverEl.removeEventListener(\"toggle\", handleToggle)\n }, [allOptions, selectedValue])\n\n useEffect(() => {\n if (activeOptionId) {\n document\n .getElementById(activeOptionId)\n ?.scrollIntoView({ behavior: \"instant\", block: \"center\" })\n }\n }, [activeOptionId])\n\n useEffect(\n () => () => {\n clearTimeout(searchTimeoutRef.current)\n },\n []\n )\n\n const openPopover = () =>\n popoverRef.current?.showPopover({ source: resolvedTriggerRef.current! })\n\n const closePopover = () => popoverRef.current?.hidePopover()\n\n const commitSelection = useCallback(\n (nextValue: string) => {\n if (nextValue === selectedValue) {\n closePopover()\n return\n }\n\n if (!isControlled) {\n setUncontrolledValue(nextValue)\n }\n\n const hiddenEl = hiddenSelectRef.current\n if (hiddenEl) {\n pendingChangeValueRef.current = nextValue\n hiddenEl.value = nextValue\n hiddenEl.dispatchEvent(new Event(\"change\", { bubbles: true }))\n if (isControlled) {\n hiddenEl.value = value ?? \"\"\n }\n }\n\n closePopover()\n },\n [isControlled, selectedValue, value]\n )\n\n const selectActiveOption = useCallback(() => {\n if (activeOption && !activeOption.disabled) {\n commitSelection(activeOption.value!)\n return true\n }\n return false\n }, [activeOption, commitSelection])\n\n const commitActiveOptionOrClose = useCallback(() => {\n if (!selectActiveOption()) {\n closePopover()\n }\n }, [selectActiveOption])\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n if (disabled) return\n\n // Tab must not be prevented — allow native focus movement\n if (e.key === \"Tab\" && isOpen) {\n commitActiveOptionOrClose()\n return\n }\n\n const action = getComboboxActionFromKey(e, isOpen)\n if (!action) return\n\n e.preventDefault()\n\n switch (action) {\n case ComboboxAction.OpenPopup:\n openPopover()\n break\n case ComboboxAction.CommitAndClose:\n commitActiveOptionOrClose()\n break\n case ComboboxAction.MoveFirst:\n case ComboboxAction.MoveLast:\n if (!isOpen) openPopover()\n setActiveIndex(getUpdatedIndex(activeIndex, action, allOptions))\n break\n case ComboboxAction.MoveNext:\n case ComboboxAction.MovePrevious:\n setActiveIndex(getUpdatedIndex(activeIndex, action, allOptions))\n break\n case ComboboxAction.TypeCharacter: {\n if (!isOpen) openPopover()\n\n clearTimeout(searchTimeoutRef.current)\n searchStringRef.current += e.key\n searchTimeoutRef.current = setTimeout(() => {\n searchStringRef.current = \"\"\n }, 500)\n\n const searchIndex = getIndexByLetter(\n allOptions,\n searchStringRef.current,\n activeIndex\n )\n if (searchIndex >= 0) {\n setActiveIndex(searchIndex)\n }\n break\n }\n case ComboboxAction.ClosePopup:\n closePopover()\n break\n }\n }\n\n const createStableEventTarget = (\n target: HTMLSelectElement,\n valueSnapshot: string\n ) => {\n const proxy = Object.create(target)\n Object.defineProperties(proxy, {\n disabled: {\n configurable: true,\n enumerable: true,\n value: target.disabled,\n },\n form: { configurable: true, enumerable: true, value: target.form },\n name: { configurable: true, enumerable: true, value: target.name },\n type: { configurable: true, enumerable: true, value: target.type },\n value: { configurable: true, enumerable: true, value: valueSnapshot },\n })\n return proxy as HTMLSelectElement\n }\n\n const withSelectTarget = useCallback(\n <\n SourceEvent extends React.SyntheticEvent,\n TargetEvent extends React.SyntheticEvent<HTMLSelectElement>,\n >(\n event: SourceEvent,\n target: HTMLSelectElement,\n currentTarget: HTMLSelectElement = target\n ) => {\n return Object.defineProperties(Object.create(event), {\n currentTarget: { value: currentTarget },\n target: { value: target },\n }) as TargetEvent\n },\n []\n )\n\n const handleHiddenSelectChange = useCallback(\n (event: React.ChangeEvent<HTMLSelectElement>) => {\n if (!onChange) return\n\n const valueSnapshot =\n pendingChangeValueRef.current ?? event.currentTarget.value\n pendingChangeValueRef.current = null\n\n const stableEvent = withSelectTarget<\n React.ChangeEvent<HTMLSelectElement>,\n React.ChangeEvent<HTMLSelectElement>\n >(\n event,\n createStableEventTarget(\n event.target as HTMLSelectElement,\n valueSnapshot\n ),\n createStableEventTarget(event.currentTarget, valueSnapshot)\n )\n\n onChange(stableEvent)\n },\n [onChange, withSelectTarget]\n )\n\n const forwardEventToSelect = useCallback(\n <\n ButtonEvent extends React.SyntheticEvent<HTMLButtonElement>,\n SelectEvent extends React.SyntheticEvent<HTMLSelectElement>,\n >(\n event: ButtonEvent,\n handler?: (event: SelectEvent) => void\n ) => {\n if (!handler) return\n\n const hiddenEl = hiddenSelectRef.current\n if (!hiddenEl) return\n\n const stableEvent = withSelectTarget<ButtonEvent, SelectEvent>(\n event,\n hiddenEl\n )\n\n handler(stableEvent)\n },\n [withSelectTarget]\n )\n\n const handleButtonBlur = useCallback(\n (event: React.FocusEvent<HTMLButtonElement>) => {\n forwardEventToSelect<\n React.FocusEvent<HTMLButtonElement>,\n React.FocusEvent<HTMLSelectElement>\n >(event, onBlur)\n },\n [forwardEventToSelect, onBlur]\n )\n\n const handleButtonClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n forwardEventToSelect<\n React.MouseEvent<HTMLButtonElement>,\n React.MouseEvent<HTMLSelectElement>\n >(event, onClick)\n },\n [forwardEventToSelect, onClick]\n )\n\n const handleButtonFocus = useCallback(\n (event: React.FocusEvent<HTMLButtonElement>) => {\n forwardEventToSelect<\n React.FocusEvent<HTMLButtonElement>,\n React.FocusEvent<HTMLSelectElement>\n >(event, onFocus)\n },\n [forwardEventToSelect, onFocus]\n )\n\n const renderListOption = (option: SelectOption, index: number) => {\n const { disabled, divider, label, value } = option\n if (divider) return <li key={index} role=\"separator\" />\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events -- keyboard events are handled on the combobox button\n <li\n key={value}\n {...getDataAttributes(option)}\n aria-disabled={disabled || undefined}\n aria-selected={value === selectedValue}\n className={\n value === activeOption?.value\n ? \"tds-select-option--active\"\n : undefined\n }\n id={`${baseId}-option-${value}`}\n onClick={disabled ? undefined : () => commitSelection(value!)}\n role=\"option\"\n >\n {label}\n </li>\n )\n }\n\n return (\n <>\n <button\n ref={resolvedTriggerRef}\n popovertarget={baseId}\n aria-activedescendant={activeOptionId}\n aria-controls={baseId}\n aria-describedby={ariaDescribedBy}\n aria-disabled={disabled ? \"true\" : undefined}\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n aria-invalid={invalid ? \"true\" : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-required={required ? \"true\" : undefined}\n disabled={disabled}\n onBlur={handleButtonBlur}\n onClick={handleButtonClick}\n onFocus={handleButtonFocus}\n onKeyDown={handleKeyDown}\n role=\"combobox\"\n type=\"button\"\n >\n {selectedOption ? selectedOption.label : placeholder}\n </button>\n <div\n ref={popoverRef}\n popover=\"\"\n id={baseId}\n role=\"listbox\"\n aria-describedby={ariaDescribedBy}\n aria-invalid={invalid ? \"true\" : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-required={required ? \"true\" : undefined}\n >\n {renderListSegments(segments, baseId, renderListOption)}\n </div>\n <select\n {...props}\n ref={setHiddenSelectRef}\n aria-hidden\n className=\"tds-select-hidden-select\"\n disabled={disabled}\n id={`${baseId}-control`}\n onChange={handleHiddenSelectChange}\n required={required}\n tabIndex={-1}\n value={selectedValue ?? \"\"}\n >\n <option value=\"\" />\n <SelectOptions items={options} />\n </select>\n </>\n )\n }\n)\n\nSelectPopover.displayName = \"SelectPopover\"\n"],"names":[],"mappings":";;;;;;AAsDA,MAAM,KAAK,GAAG,CAAC,EACb,QAAQ,EACR,QAAQ,EACR,EAAE,EACF,KAAK,GAMN,MACC,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,eAAA,EAAmB,QAAQ,IAAI,SAAS,EAAA,iBAAA,EAAmB,EAAE,EAAE,IAAI,EAAC,OAAO,EAAA;AACzE,IAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,EAAE,EAAE,EAAE,EAAE,IAAI,EAAC,cAAc,EAAA;QAC7B,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,IAAA,EAAO,KAAK,CAAQ,CACjB;IACJ,QAAQ,CACN,CACN;AAED,SAAS,kBAAkB,CACzB,QAAmB,EACnB,MAAc,EACd,UAAoE,EAAA;IAEpE,IAAI,SAAS,GAAG,CAAC;IAEjB,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,YAAY,KAAI;QAC5C,MAAM,UAAU,GAAG,SAAS;AAC5B,QAAA,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC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AA,EAE3C,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,CAAC,CACnD;AACN,QAAA,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAA,GACM,KAAK,EACT,GAAG,EAAE,kBAAkB,uBAEvB,SAAS,EAAC,0BAA0B,EACpC,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,CAAA,EAAG,MAAM,CAAA,QAAA,CAAU,EACvB,QAAQ,EAAE,wBAAwB,EAClC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,EAAE,EACZ,KAAK,EAAE,aAAa,IAAI,EAAE,EAAA;YAE1B,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAQ,KAAK,EAAC,EAAE,EAAA,CAAG;YACnB,KAAA,CAAA,aAAA,CAAC,aAAa,IAAC,KAAK,EAAE,OAAO,EAAA,CAAI,CAC1B,CACR;AAEP,CAAC;AAGH,aAAa,CAAC,WAAW,GAAG,eAAe;;;;"}
|
|
1
|
+
{"version":3,"file":"SelectPopover.js","sources":["../../../src/components/select/SelectPopover.tsx"],"sourcesContent":["import {\n ComboboxAction,\n getComboboxActionFromKey,\n getUpdatedIndex,\n} from \"@utilities/keyboardUtils\"\nimport {\n getDataAttributes,\n getIndexByLetter,\n getSelectableOptionsFromSegments,\n normalizeOptions,\n type Segment,\n} from \"@utilities/selectUtils\"\nimport { useId } from \"@utilities/useId\"\nimport React, {\n forwardRef,\n type SelectHTMLAttributes,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\n\nimport type { SelectItem, SelectOption } from \"./Select\"\nimport { SelectOptions } from \"./SelectOptions\"\n\ninterface ToggleEvent extends Event {\n newState: \"closed\" | \"open\"\n oldState: \"closed\" | \"open\"\n}\n\nexport interface SelectPopoverProps {\n \"aria-describedby\"?: string\n \"aria-label\"?: string\n \"aria-labelledby\"?: string\n defaultValue?: string\n disabled?: boolean\n id?: string\n invalid?: boolean\n /** A flat or mixed array of options and option groups. */\n options: SelectItem[]\n /** Placeholder text shown in the trigger button when no option is selected. `null` suppresses the placeholder. */\n placeholder: string | null\n required?: boolean\n triggerRef?: React.RefObject<HTMLButtonElement>\n value?: string\n}\n\nexport type SelectPopoverElementProps = Omit<\n SelectHTMLAttributes<HTMLSelectElement>,\n keyof SelectPopoverProps | \"multiple\"\n> &\n SelectPopoverProps\n\nconst Group = ({\n children,\n disabled,\n id,\n label,\n}: {\n children: React.ReactNode\n disabled?: boolean\n id: string\n label: string\n}) => (\n <ul aria-disabled={disabled || undefined} aria-labelledby={id} role=\"group\">\n <li id={id} role=\"presentation\">\n <span>{label}</span>\n </li>\n {children}\n </ul>\n)\n\nfunction renderListSegments(\n segments: Segment[],\n baseId: string,\n renderItem: (option: SelectOption, index: number) => React.ReactNode\n) {\n let flatIndex = 0\n\n return segments.map((segment, segmentIndex) => {\n const startIndex = flatIndex\n flatIndex += segment.options.length\n\n if (segment.type === \"group\") {\n return (\n <Group\n key={`${segment.label}-${segmentIndex}`}\n disabled={segment.disabled}\n id={`${baseId}-group-${segmentIndex}`}\n label={segment.label}\n >\n {segment.options.map((opt, i) => renderItem(opt, startIndex + i))}\n </Group>\n )\n }\n\n return (\n <ul key={`options-${segmentIndex}`} role=\"presentation\">\n {segment.options.map((opt, i) => renderItem(opt, startIndex + i))}\n </ul>\n )\n })\n}\n\n/**\n * Internal component. Not intended for direct use — consume `Select` instead.\n *\n * The popover listbox implementation used by `Select` when `complex` is\n * true. Renders a button trigger and a custom listbox that supports rich\n * option content (icons, descriptions) along with keyboard navigation,\n * type-ahead, and option groups.\n *\n * @internal\n */\nexport const SelectPopover = forwardRef<\n HTMLSelectElement,\n SelectPopoverElementProps\n>(\n (\n {\n \"aria-describedby\": ariaDescribedBy,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n defaultValue,\n disabled,\n id,\n invalid,\n onBlur,\n onChange,\n onClick,\n onFocus,\n options,\n placeholder,\n required,\n triggerRef,\n value,\n ...props\n }: SelectPopoverElementProps,\n ref\n ) => {\n const stableId = useId()\n const baseId = id || `tds-select-popover-${stableId}`\n\n const [isOpen, setIsOpen] = useState(false)\n const [uncontrolledValue, setUncontrolledValue] = useState<string | null>(\n defaultValue ?? null\n )\n const [activeIndex, setActiveIndex] = useState(-1)\n\n const isControlled = value !== undefined\n const selectedValue = isControlled ? (value ?? null) : uncontrolledValue\n\n const { allOptions, segments } = useMemo(() => {\n const segments = normalizeOptions(options)\n const allOptions = getSelectableOptionsFromSegments(segments)\n return { allOptions, segments }\n }, [options])\n\n const selectedOption = allOptions.find((opt) => opt.value === selectedValue)\n\n const activeOption = activeIndex >= 0 ? allOptions[activeIndex] : undefined\n const activeOptionId = activeOption\n ? `${baseId}-option-${activeOption.value}`\n : undefined\n\n const popoverRef = useRef<HTMLDivElement>(null)\n const internalTriggerRef = useRef<HTMLButtonElement | null>(null)\n const resolvedTriggerRef = triggerRef ?? internalTriggerRef\n const hiddenSelectRef = useRef<HTMLSelectElement | null>(null)\n const pendingChangeValueRef = useRef<string | null>(null)\n const searchStringRef = useRef(\"\")\n const searchTimeoutRef = useRef<ReturnType<typeof setTimeout>>()\n\n const setHiddenSelectRef = useCallback(\n (element: HTMLSelectElement | null) => {\n hiddenSelectRef.current = element\n if (typeof ref === \"function\") {\n ref(element)\n } else if (ref) {\n ref.current = element\n }\n },\n [ref]\n )\n\n useEffect(() => {\n const popoverEl = popoverRef.current\n if (!popoverEl) return\n\n const handleToggle = (e: Event) => {\n const newIsOpen = (e as ToggleEvent).newState === \"open\"\n setIsOpen(newIsOpen)\n\n if (newIsOpen) {\n const index = allOptions.findIndex(\n (opt) => opt.value === selectedValue && !opt.disabled\n )\n if (index >= 0) {\n setActiveIndex(index)\n } else {\n // Find first non-disabled option\n const firstEnabledIndexOrFirstIndex = Math.max(\n allOptions.findIndex((opt) => !opt.disabled),\n 0\n )\n setActiveIndex(firstEnabledIndexOrFirstIndex)\n }\n } else {\n setActiveIndex(-1)\n }\n }\n\n popoverEl.addEventListener(\"toggle\", handleToggle)\n return () => popoverEl.removeEventListener(\"toggle\", handleToggle)\n }, [allOptions, selectedValue])\n\n useEffect(() => {\n if (activeOptionId) {\n document\n .getElementById(activeOptionId)\n ?.scrollIntoView({ behavior: \"instant\", block: \"center\" })\n }\n }, [activeOptionId])\n\n useEffect(\n () => () => {\n clearTimeout(searchTimeoutRef.current)\n },\n []\n )\n\n const openPopover = () =>\n popoverRef.current?.showPopover({ source: resolvedTriggerRef.current! })\n\n const closePopover = () => popoverRef.current?.hidePopover()\n\n const commitSelection = useCallback(\n (nextValue: string) => {\n if (nextValue === selectedValue) {\n closePopover()\n return\n }\n\n if (!isControlled) {\n setUncontrolledValue(nextValue)\n }\n\n const hiddenEl = hiddenSelectRef.current\n if (hiddenEl) {\n pendingChangeValueRef.current = nextValue\n hiddenEl.value = nextValue\n hiddenEl.dispatchEvent(new Event(\"change\", { bubbles: true }))\n if (isControlled) {\n hiddenEl.value = value ?? \"\"\n }\n }\n\n closePopover()\n },\n [isControlled, selectedValue, value]\n )\n\n const selectActiveOption = useCallback(() => {\n if (activeOption && !activeOption.disabled) {\n commitSelection(activeOption.value!)\n return true\n }\n return false\n }, [activeOption, commitSelection])\n\n const commitActiveOptionOrClose = useCallback(() => {\n if (!selectActiveOption()) {\n closePopover()\n }\n }, [selectActiveOption])\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n if (disabled) return\n\n // Tab must not be prevented — allow native focus movement\n if (e.key === \"Tab\" && isOpen) {\n commitActiveOptionOrClose()\n return\n }\n\n const action = getComboboxActionFromKey(e, isOpen)\n if (!action) return\n\n e.preventDefault()\n\n switch (action) {\n case ComboboxAction.OpenPopup:\n openPopover()\n break\n case ComboboxAction.CommitAndClose:\n commitActiveOptionOrClose()\n break\n case ComboboxAction.MoveFirst:\n case ComboboxAction.MoveLast:\n if (!isOpen) openPopover()\n setActiveIndex(getUpdatedIndex(activeIndex, action, allOptions))\n break\n case ComboboxAction.MoveNext:\n case ComboboxAction.MovePrevious:\n setActiveIndex(getUpdatedIndex(activeIndex, action, allOptions))\n break\n case ComboboxAction.TypeCharacter: {\n if (!isOpen) openPopover()\n\n clearTimeout(searchTimeoutRef.current)\n searchStringRef.current += e.key\n searchTimeoutRef.current = setTimeout(() => {\n searchStringRef.current = \"\"\n }, 500)\n\n const searchIndex = getIndexByLetter(\n allOptions,\n searchStringRef.current,\n activeIndex\n )\n if (searchIndex >= 0) {\n setActiveIndex(searchIndex)\n }\n break\n }\n case ComboboxAction.ClosePopup:\n closePopover()\n break\n }\n }\n\n const createStableEventTarget = (\n target: HTMLSelectElement,\n valueSnapshot: string\n ) => {\n const proxy = Object.create(target)\n Object.defineProperties(proxy, {\n disabled: {\n configurable: true,\n enumerable: true,\n value: target.disabled,\n },\n form: { configurable: true, enumerable: true, value: target.form },\n name: { configurable: true, enumerable: true, value: target.name },\n type: { configurable: true, enumerable: true, value: target.type },\n value: { configurable: true, enumerable: true, value: valueSnapshot },\n })\n return proxy as HTMLSelectElement\n }\n\n const withSelectTarget = useCallback(\n <\n SourceEvent extends React.SyntheticEvent,\n TargetEvent extends React.SyntheticEvent<HTMLSelectElement>,\n >(\n event: SourceEvent,\n target: HTMLSelectElement,\n currentTarget: HTMLSelectElement = target\n ) => {\n return Object.defineProperties(Object.create(event), {\n currentTarget: { value: currentTarget },\n target: { value: target },\n }) as TargetEvent\n },\n []\n )\n\n const handleHiddenSelectChange = useCallback(\n (event: React.ChangeEvent<HTMLSelectElement>) => {\n if (!onChange) return\n\n const valueSnapshot =\n pendingChangeValueRef.current ?? event.currentTarget.value\n pendingChangeValueRef.current = null\n\n const stableEvent = withSelectTarget<\n React.ChangeEvent<HTMLSelectElement>,\n React.ChangeEvent<HTMLSelectElement>\n >(\n event,\n createStableEventTarget(\n event.target as HTMLSelectElement,\n valueSnapshot\n ),\n createStableEventTarget(event.currentTarget, valueSnapshot)\n )\n\n onChange(stableEvent)\n },\n [onChange, withSelectTarget]\n )\n\n const forwardEventToSelect = useCallback(\n <\n ButtonEvent extends React.SyntheticEvent<HTMLButtonElement>,\n SelectEvent extends React.SyntheticEvent<HTMLSelectElement>,\n >(\n event: ButtonEvent,\n handler?: (event: SelectEvent) => void\n ) => {\n if (!handler) return\n\n const hiddenEl = hiddenSelectRef.current\n if (!hiddenEl) return\n\n const stableEvent = withSelectTarget<ButtonEvent, SelectEvent>(\n event,\n hiddenEl\n )\n\n handler(stableEvent)\n },\n [withSelectTarget]\n )\n\n const handleButtonBlur = useCallback(\n (event: React.FocusEvent<HTMLButtonElement>) => {\n forwardEventToSelect<\n React.FocusEvent<HTMLButtonElement>,\n React.FocusEvent<HTMLSelectElement>\n >(event, onBlur)\n },\n [forwardEventToSelect, onBlur]\n )\n\n const handleButtonClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n forwardEventToSelect<\n React.MouseEvent<HTMLButtonElement>,\n React.MouseEvent<HTMLSelectElement>\n >(event, onClick)\n },\n [forwardEventToSelect, onClick]\n )\n\n const handleButtonFocus = useCallback(\n (event: React.FocusEvent<HTMLButtonElement>) => {\n forwardEventToSelect<\n React.FocusEvent<HTMLButtonElement>,\n React.FocusEvent<HTMLSelectElement>\n >(event, onFocus)\n },\n [forwardEventToSelect, onFocus]\n )\n\n const renderListOption = (option: SelectOption, index: number) => {\n const { disabled, divider, label, value } = option\n if (divider) return <li key={index} role=\"separator\" />\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events -- keyboard events are handled on the combobox button\n <li\n key={value}\n {...getDataAttributes(option)}\n aria-disabled={disabled || undefined}\n aria-selected={value === selectedValue}\n className={\n value === activeOption?.value\n ? \"tds-select-option--active\"\n : undefined\n }\n id={`${baseId}-option-${value}`}\n onClick={disabled ? undefined : () => commitSelection(value!)}\n role=\"option\"\n >\n {label}\n </li>\n )\n }\n\n return (\n <>\n <button\n ref={resolvedTriggerRef}\n popovertarget={baseId}\n aria-activedescendant={activeOptionId}\n aria-controls={baseId}\n aria-describedby={ariaDescribedBy}\n aria-disabled={disabled ? \"true\" : undefined}\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n aria-invalid={invalid ? \"true\" : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-required={required ? \"true\" : undefined}\n disabled={disabled}\n onBlur={handleButtonBlur}\n onClick={handleButtonClick}\n onFocus={handleButtonFocus}\n onKeyDown={handleKeyDown}\n role=\"combobox\"\n type=\"button\"\n >\n {selectedOption ? selectedOption.label : placeholder}\n </button>\n <div\n ref={popoverRef}\n popover=\"\"\n id={baseId}\n role=\"listbox\"\n aria-describedby={ariaDescribedBy}\n aria-invalid={invalid ? \"true\" : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-required={required ? \"true\" : undefined}\n >\n {renderListSegments(segments, baseId, renderListOption)}\n </div>\n <select\n {...props}\n ref={setHiddenSelectRef}\n aria-hidden\n className=\"tds-select-hidden-select\"\n disabled={disabled}\n id={`${baseId}-control`}\n onChange={handleHiddenSelectChange}\n required={required}\n tabIndex={-1}\n value={selectedValue ?? \"\"}\n >\n <option value=\"\" />\n <SelectOptions items={options} />\n </select>\n </>\n )\n }\n)\n\nSelectPopover.displayName = \"SelectPopover\"\n"],"names":["React"],"mappings":";;;;;;AAsDA,MAAM,KAAK,GAAG,CAAC,EACb,QAAQ,EACR,QAAQ,EACR,EAAE,EACF,KAAK,GAMN,MACCA,cAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,eAAA,EAAmB,QAAQ,IAAI,SAAS,EAAA,iBAAA,EAAmB,EAAE,EAAE,IAAI,EAAC,OAAO,EAAA;AACzE,IAAAA,cAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,EAAE,EAAE,EAAE,EAAE,IAAI,EAAC,cAAc,EAAA;QAC7BA,cAAA,CAAA,aAAA,CAAA,MAAA,EAAA,IAAA,EAAO,KAAK,CAAQ,CACjB;IACJ,QAAQ,CACN,CACN;AAED,SAAS,kBAAkB,CACzB,QA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O,EAAC,EAAE,EACV,EAAE,EAAE,MAAM,EACV,IAAI,EAAC,SAAS,EAAA,kBAAA,EACI,eAAe,EAAA,cAAA,EACnB,OAAO,GAAG,MAAM,GAAG,SAAS,EAAA,YAAA,EAC9B,SAAS,EAAA,iBAAA,EACJ,cAAc,mBAChB,QAAQ,GAAG,MAAM,GAAG,SAAS,EAAA,EAE3C,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,CAAC,CACnD;AACN,QAAAA,cAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAA,GACM,KAAK,EACT,GAAG,EAAE,kBAAkB,uBAEvB,SAAS,EAAC,0BAA0B,EACpC,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,CAAA,EAAG,MAAM,CAAA,QAAA,CAAU,EACvB,QAAQ,EAAE,wBAAwB,EAClC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,EAAE,EACZ,KAAK,EAAE,aAAa,IAAI,EAAE,EAAA;YAE1BA,cAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAQ,KAAK,EAAC,EAAE,EAAA,CAAG;YACnBA,cAAA,CAAA,aAAA,CAAC,aAAa,IAAC,KAAK,EAAE,OAAO,EAAA,CAAI,CAC1B,CACR;AAEP,CAAC;AAGH,aAAa,CAAC,WAAW,GAAG,eAAe;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useId } from '../../utilities/useId.js';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import
|
|
3
|
+
import React__default from 'react';
|
|
4
4
|
import { SidenavResponsiveHeader } from './private/SidenavResponsiveHeader.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -21,11 +21,11 @@ function Sidenav({ children, label = "Secondary", selectedItemLabel, className,
|
|
|
21
21
|
const resolvedPopoverId = popoverId?.trim() || `${menuId}-popover`;
|
|
22
22
|
// `tds-sidenav-collapse` takes the place of Stencil's
|
|
23
23
|
// `tds-popover-container`, so Rails can render the same markup without React.
|
|
24
|
-
return (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
return (React__default.createElement("div", { className: classNames("tds-sidenav", className) },
|
|
25
|
+
React__default.createElement("nav", { id: menuId, className: "tds-sidenav-nav", "aria-label": label },
|
|
26
|
+
React__default.createElement(SidenavResponsiveHeader, { label: selectedItemLabel, popoverId: resolvedPopoverId }),
|
|
27
|
+
React__default.createElement("tds-sidenav-collapse", { id: resolvedPopoverId, class: "tds-sidenav-collapse" },
|
|
28
|
+
React__default.createElement("div", { className: "tds-sidenav-scroll-container" }, children)))));
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export { Sidenav };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidenav.js","sources":["../../../src/components/sidenav/Sidenav.tsx"],"sourcesContent":["import { useId } from \"@utilities/useId\"\nimport classnames from \"classnames\"\nimport React from \"react\"\n\nimport { SidenavResponsiveHeader } from \"./private/SidenavResponsiveHeader\"\n\n/**\n * The sidenav lets users navigate through subsets of data pertaining to a resource.\n * It can be nested under the page header navigation, as secondary navigation.\n *\n * The expected structure of a `Sidenav` is:\n * `<Sidenav> <SidenavSection> <SidenavItem /> </SidenavSection> </Sidenav>`\n *\n * Please refer to each component's documentation for more information on how to use them.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/application-admin-sidenav--docs | Storybook Documentation}\n */\nexport function Sidenav({\n children,\n label = \"Secondary\",\n selectedItemLabel,\n className,\n popoverId,\n}: {\n /**\n * Default slot used to nest `SidenavSection` components.\n */\n children: React.ReactNode\n className?: string\n /**\n * Label for the sidenav, used for accessibility.\n */\n label?: string\n /**\n * The id of the popover container.\n */\n popoverId?: string\n /**\n * Label displayed in the responsive header of the sidenav.\n */\n selectedItemLabel?: string\n}) {\n const id = useId()\n const menuId = `tds-sidenav-menu-${id}`\n const resolvedPopoverId = popoverId?.trim() || `${menuId}-popover`\n\n // `tds-sidenav-collapse` takes the place of Stencil's\n // `tds-popover-container`, so Rails can render the same markup without React.\n return (\n <div className={classnames(\"tds-sidenav\", className)}>\n <nav id={menuId} className=\"tds-sidenav-nav\" aria-label={label}>\n <SidenavResponsiveHeader\n label={selectedItemLabel}\n popoverId={resolvedPopoverId}\n />\n <tds-sidenav-collapse\n id={resolvedPopoverId}\n class=\"tds-sidenav-collapse\"\n >\n <div className=\"tds-sidenav-scroll-container\">{children}</div>\n </tds-sidenav-collapse>\n </nav>\n </div>\n )\n}\n"],"names":["classnames"],"mappings":";;;;;AAMA;;;;;;;;;;;AAWG;AACG,SAAU,OAAO,CAAC,EACtB,QAAQ,EACR,KAAK,GAAG,WAAW,EACnB,iBAAiB,EACjB,SAAS,EACT,SAAS,GAmBV,EAAA;AACC,IAAA,MAAM,EAAE,GAAG,KAAK,EAAE;AAClB,IAAA,MAAM,MAAM,GAAG,CAAA,iBAAA,EAAoB,EAAE,EAAE;IACvC,MAAM,iBAAiB,GAAG,SAAS,EAAE,IAAI,EAAE,IAAI,CAAA,EAAG,MAAM,CAAA,QAAA,CAAU;;;IAIlE,
|
|
1
|
+
{"version":3,"file":"Sidenav.js","sources":["../../../src/components/sidenav/Sidenav.tsx"],"sourcesContent":["import { useId } from \"@utilities/useId\"\nimport classnames from \"classnames\"\nimport React from \"react\"\n\nimport { SidenavResponsiveHeader } from \"./private/SidenavResponsiveHeader\"\n\n/**\n * The sidenav lets users navigate through subsets of data pertaining to a resource.\n * It can be nested under the page header navigation, as secondary navigation.\n *\n * The expected structure of a `Sidenav` is:\n * `<Sidenav> <SidenavSection> <SidenavItem /> </SidenavSection> </Sidenav>`\n *\n * Please refer to each component's documentation for more information on how to use them.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/application-admin-sidenav--docs | Storybook Documentation}\n */\nexport function Sidenav({\n children,\n label = \"Secondary\",\n selectedItemLabel,\n className,\n popoverId,\n}: {\n /**\n * Default slot used to nest `SidenavSection` components.\n */\n children: React.ReactNode\n className?: string\n /**\n * Label for the sidenav, used for accessibility.\n */\n label?: string\n /**\n * The id of the popover container.\n */\n popoverId?: string\n /**\n * Label displayed in the responsive header of the sidenav.\n */\n selectedItemLabel?: string\n}) {\n const id = useId()\n const menuId = `tds-sidenav-menu-${id}`\n const resolvedPopoverId = popoverId?.trim() || `${menuId}-popover`\n\n // `tds-sidenav-collapse` takes the place of Stencil's\n // `tds-popover-container`, so Rails can render the same markup without React.\n return (\n <div className={classnames(\"tds-sidenav\", className)}>\n <nav id={menuId} className=\"tds-sidenav-nav\" aria-label={label}>\n <SidenavResponsiveHeader\n label={selectedItemLabel}\n popoverId={resolvedPopoverId}\n />\n <tds-sidenav-collapse\n id={resolvedPopoverId}\n class=\"tds-sidenav-collapse\"\n >\n <div className=\"tds-sidenav-scroll-container\">{children}</div>\n </tds-sidenav-collapse>\n </nav>\n </div>\n )\n}\n"],"names":["React","classnames"],"mappings":";;;;;AAMA;;;;;;;;;;;AAWG;AACG,SAAU,OAAO,CAAC,EACtB,QAAQ,EACR,KAAK,GAAG,WAAW,EACnB,iBAAiB,EACjB,SAAS,EACT,SAAS,GAmBV,EAAA;AACC,IAAA,MAAM,EAAE,GAAG,KAAK,EAAE;AAClB,IAAA,MAAM,MAAM,GAAG,CAAA,iBAAA,EAAoB,EAAE,EAAE;IACvC,MAAM,iBAAiB,GAAG,SAAS,EAAE,IAAI,EAAE,IAAI,CAAA,EAAG,MAAM,CAAA,QAAA,CAAU;;;IAIlE,QACEA,sCAAK,SAAS,EAAEC,UAAU,CAAC,aAAa,EAAE,SAAS,CAAC,EAAA;QAClDD,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAC,iBAAiB,gBAAa,KAAK,EAAA;YAC5DA,cAAA,CAAA,aAAA,CAAC,uBAAuB,IACtB,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,iBAAiB,EAAA,CAC5B;AACF,YAAAA,cAAA,CAAA,aAAA,CAAA,sBAAA,EAAA,EACE,EAAE,EAAE,iBAAiB,EACrB,KAAK,EAAC,sBAAsB,EAAA;gBAE5BA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,8BAA8B,EAAA,EAAE,QAAQ,CAAO,CACzC,CACnB,CACF;AAEV;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The `SidenavItem` component is used to display a single item in the sidenav.
|
|
@@ -24,7 +24,7 @@ import React from 'react';
|
|
|
24
24
|
function SidenavItem({ children, className, selected, }) {
|
|
25
25
|
// `tds-sidenav-collapse` sets `aria-current="page"` on the selected item's
|
|
26
26
|
// link or button, so React and Rails render the same markup.
|
|
27
|
-
return (
|
|
27
|
+
return (React__default.createElement("li", { className: classNames("tds-sidenav-item", className, { selected }) }, children));
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export { SidenavItem };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidenavItem.js","sources":["../../../src/components/sidenav/SidenavItem.tsx"],"sourcesContent":["import classnames from \"classnames\"\nimport React from \"react\"\n\n/**\n * The `SidenavItem` component is used to display a single item in the sidenav.\n *\n * @example\n * ```html\n * <SidenavItem>\n * <a href=\"#\">Home</a>\n * </SidenavItem>\n *\n * <SidenavItem>\n * <button>Foo</button>\n * <SidenavSection subnav>\n * <SidenavItem><a href=\"#\">Nested Link</a></SidenavItem>\n * </SidenavSection>\n * </SidenavItem>\n * ```\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/application-admin-sidenav--docs | Storybook Documentation}\n */\nexport function SidenavItem({\n children,\n className,\n selected,\n}: {\n /**\n * Should be a link or button without any classes or styles applied.\n */\n children: React.ReactNode\n className?: string\n /**\n * Whether the sidenav item is selected.\n */\n selected?: boolean\n}) {\n // `tds-sidenav-collapse` sets `aria-current=\"page\"` on the selected item's\n // link or button, so React and Rails render the same markup.\n return (\n <li className={classnames(\"tds-sidenav-item\", className, { selected })}>\n {children}\n </li>\n )\n}\n"],"names":["classnames"],"mappings":";;;AAGA;;;;;;;;;;;;;;;;;;;AAmBG;AACG,SAAU,WAAW,CAAC,EAC1B,QAAQ,EACR,SAAS,EACT,QAAQ,GAWT,EAAA;;;AAGC,IAAA,
|
|
1
|
+
{"version":3,"file":"SidenavItem.js","sources":["../../../src/components/sidenav/SidenavItem.tsx"],"sourcesContent":["import classnames from \"classnames\"\nimport React from \"react\"\n\n/**\n * The `SidenavItem` component is used to display a single item in the sidenav.\n *\n * @example\n * ```html\n * <SidenavItem>\n * <a href=\"#\">Home</a>\n * </SidenavItem>\n *\n * <SidenavItem>\n * <button>Foo</button>\n * <SidenavSection subnav>\n * <SidenavItem><a href=\"#\">Nested Link</a></SidenavItem>\n * </SidenavSection>\n * </SidenavItem>\n * ```\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/application-admin-sidenav--docs | Storybook Documentation}\n */\nexport function SidenavItem({\n children,\n className,\n selected,\n}: {\n /**\n * Should be a link or button without any classes or styles applied.\n */\n children: React.ReactNode\n className?: string\n /**\n * Whether the sidenav item is selected.\n */\n selected?: boolean\n}) {\n // `tds-sidenav-collapse` sets `aria-current=\"page\"` on the selected item's\n // link or button, so React and Rails render the same markup.\n return (\n <li className={classnames(\"tds-sidenav-item\", className, { selected })}>\n {children}\n </li>\n )\n}\n"],"names":["React","classnames"],"mappings":";;;AAGA;;;;;;;;;;;;;;;;;;;AAmBG;AACG,SAAU,WAAW,CAAC,EAC1B,QAAQ,EACR,SAAS,EACT,QAAQ,GAWT,EAAA;;;AAGC,IAAA,QACEA,cAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAEC,UAAU,CAAC,kBAAkB,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,IACnE,QAAQ,CACN;AAET;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useId } from '../../utilities/useId.js';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import
|
|
3
|
+
import React__default from 'react';
|
|
4
4
|
import { withSlotChildrenAsActions } from './private/withSlotChildrenAsActions.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -17,12 +17,12 @@ function SidenavSection(props) {
|
|
|
17
17
|
const { children, className, label, labelActions, sectionActions, subnav } = withSlotChildrenAsActions(props);
|
|
18
18
|
const id = useId();
|
|
19
19
|
const headerId = `tds-sidenav-section-header-${id}`;
|
|
20
|
-
return (
|
|
21
|
-
label && (
|
|
22
|
-
|
|
23
|
-
labelActions && (
|
|
24
|
-
|
|
25
|
-
sectionActions && (
|
|
20
|
+
return (React__default.createElement("div", { className: classNames("tds-sidenav-section", className), slot: subnav ? "subnav" : undefined },
|
|
21
|
+
label && (React__default.createElement("div", { className: "tds-sidenav-section-header" },
|
|
22
|
+
React__default.createElement("h2", { id: headerId }, label),
|
|
23
|
+
labelActions && (React__default.createElement("div", { className: "tds-sidenav-section-label-actions" }, labelActions)))),
|
|
24
|
+
React__default.createElement("ul", { className: "tds-sidenav-section-list", "aria-labelledby": label ? headerId : undefined }, children),
|
|
25
|
+
sectionActions && (React__default.createElement("div", { className: "tds-sidenav-section-actions" }, sectionActions))));
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export { SidenavSection };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidenavSection.js","sources":["../../../src/components/sidenav/SidenavSection.tsx"],"sourcesContent":["import { useId } from \"@utilities/useId\"\nimport classnames from \"classnames\"\nimport React from \"react\"\n\nimport { withSlotChildrenAsActions } from \"./private/withSlotChildrenAsActions\"\n\ntype SidenavSectionProps = {\n /**\n * Default slot used to nest `SidenavItem` components.\n */\n children: React.ReactNode\n className?: string\n /**\n * Label for the section.\n */\n label?: string\n /**\n * Actions shown next to the section label. Only rendered when `label` is set.\n */\n labelActions?: React.ReactNode\n /**\n * Actions shown below the section's items.\n */\n sectionActions?: React.ReactNode\n /**\n * Add subnav if this section is a subnav of a SidenavItem.\n */\n subnav?: boolean\n}\n\n/**\n * The `SidenavSection` component is used to display a section of the sidenav.\n * All `SidenavItem` components should be nested within a `SidenavSection`.\n *\n * If the `label` prop is provided, it will be used to generate a header for the section, and the section will be labelled by the `aria-labelledby` attribute.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/application-admin-sidenav--docs | Storybook Documentation}\n */\nexport function SidenavSection(props: SidenavSectionProps) {\n // Remove in DE-1292, along with withSlotChildrenAsActions.\n const { children, className, label, labelActions, sectionActions, subnav } =\n withSlotChildrenAsActions(props)\n const id = useId()\n const headerId = `tds-sidenav-section-header-${id}`\n\n return (\n <div\n className={classnames(\"tds-sidenav-section\", className)}\n slot={subnav ? \"subnav\" : undefined}\n >\n {label && (\n <div className=\"tds-sidenav-section-header\">\n <h2 id={headerId}>{label}</h2>\n {labelActions && (\n <div className=\"tds-sidenav-section-label-actions\">\n {labelActions}\n </div>\n )}\n </div>\n )}\n <ul\n className=\"tds-sidenav-section-list\"\n aria-labelledby={label ? headerId : undefined}\n >\n {children}\n </ul>\n {sectionActions && (\n <div className=\"tds-sidenav-section-actions\">{sectionActions}</div>\n )}\n </div>\n )\n}\n"],"names":["classnames"],"mappings":";;;;;AA8BA;;;;;;;;AAQG;AACG,SAAU,cAAc,CAAC,KAA0B,EAAA;;AAEvD,IAAA,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,EAAE,GACxE,yBAAyB,CAAC,KAAK,CAAC;AAClC,IAAA,MAAM,EAAE,GAAG,KAAK,EAAE;AAClB,IAAA,MAAM,QAAQ,GAAG,CAAA,2BAAA,EAA8B,EAAE,EAAE;IAEnD,
|
|
1
|
+
{"version":3,"file":"SidenavSection.js","sources":["../../../src/components/sidenav/SidenavSection.tsx"],"sourcesContent":["import { useId } from \"@utilities/useId\"\nimport classnames from \"classnames\"\nimport React from \"react\"\n\nimport { withSlotChildrenAsActions } from \"./private/withSlotChildrenAsActions\"\n\ntype SidenavSectionProps = {\n /**\n * Default slot used to nest `SidenavItem` components.\n */\n children: React.ReactNode\n className?: string\n /**\n * Label for the section.\n */\n label?: string\n /**\n * Actions shown next to the section label. Only rendered when `label` is set.\n */\n labelActions?: React.ReactNode\n /**\n * Actions shown below the section's items.\n */\n sectionActions?: React.ReactNode\n /**\n * Add subnav if this section is a subnav of a SidenavItem.\n */\n subnav?: boolean\n}\n\n/**\n * The `SidenavSection` component is used to display a section of the sidenav.\n * All `SidenavItem` components should be nested within a `SidenavSection`.\n *\n * If the `label` prop is provided, it will be used to generate a header for the section, and the section will be labelled by the `aria-labelledby` attribute.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/application-admin-sidenav--docs | Storybook Documentation}\n */\nexport function SidenavSection(props: SidenavSectionProps) {\n // Remove in DE-1292, along with withSlotChildrenAsActions.\n const { children, className, label, labelActions, sectionActions, subnav } =\n withSlotChildrenAsActions(props)\n const id = useId()\n const headerId = `tds-sidenav-section-header-${id}`\n\n return (\n <div\n className={classnames(\"tds-sidenav-section\", className)}\n slot={subnav ? \"subnav\" : undefined}\n >\n {label && (\n <div className=\"tds-sidenav-section-header\">\n <h2 id={headerId}>{label}</h2>\n {labelActions && (\n <div className=\"tds-sidenav-section-label-actions\">\n {labelActions}\n </div>\n )}\n </div>\n )}\n <ul\n className=\"tds-sidenav-section-list\"\n aria-labelledby={label ? headerId : undefined}\n >\n {children}\n </ul>\n {sectionActions && (\n <div className=\"tds-sidenav-section-actions\">{sectionActions}</div>\n )}\n </div>\n )\n}\n"],"names":["React","classnames"],"mappings":";;;;;AA8BA;;;;;;;;AAQG;AACG,SAAU,cAAc,CAAC,KAA0B,EAAA;;AAEvD,IAAA,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,EAAE,GACxE,yBAAyB,CAAC,KAAK,CAAC;AAClC,IAAA,MAAM,EAAE,GAAG,KAAK,EAAE;AAClB,IAAA,MAAM,QAAQ,GAAG,CAAA,2BAAA,EAA8B,EAAE,EAAE;IAEnD,QACEA,sCACE,SAAS,EAAEC,UAAU,CAAC,qBAAqB,EAAE,SAAS,CAAC,EACvD,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,EAAA;AAElC,QAAA,KAAK,KACJD,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,4BAA4B,EAAA;AACzC,YAAAA,cAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,EAAE,EAAE,QAAQ,EAAA,EAAG,KAAK,CAAM;YAC7B,YAAY,KACXA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,mCAAmC,EAAA,EAC/C,YAAY,CACT,CACP,CACG,CACP;AACD,QAAAA,cAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EACE,SAAS,EAAC,0BAA0B,EAAA,iBAAA,EACnB,KAAK,GAAG,QAAQ,GAAG,SAAS,EAAA,EAE5C,QAAQ,CACN;AACJ,QAAA,cAAc,KACbA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,6BAA6B,EAAA,EAAE,cAAc,CAAO,CACpE,CACG;AAEV;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
|
|
3
3
|
function SidenavResponsiveHeader({ label, popoverId, }) {
|
|
4
|
-
return (
|
|
5
|
-
label && (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
return (React__default.createElement("div", { className: "tds-sidenav-responsive-header" },
|
|
5
|
+
label && (React__default.createElement("h2", { className: "tds-sidenav-responsive-header-label" }, label)),
|
|
6
|
+
React__default.createElement("button", { type: "button", className: "tds-btn tds-btn--outline-neutral tds-btn--icononly tds-sidenav-responsive-header-toggle", "aria-label": "Menu", "aria-controls": popoverId, popovertarget: popoverId },
|
|
7
|
+
React__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" },
|
|
8
|
+
React__default.createElement("path", { d: "M0 6.91104H16V8.68904H0V6.91104ZM0 13.133H16V11.356H0V13.133ZM0 2.46704V4.24404H16V2.46704H0Z", fill: "currentColor" })))));
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export { SidenavResponsiveHeader };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidenavResponsiveHeader.js","sources":["../../../../src/components/sidenav/private/SidenavResponsiveHeader.tsx"],"sourcesContent":["import React from \"react\"\n\nexport function SidenavResponsiveHeader({\n label,\n popoverId,\n}: {\n label?: string\n popoverId: string\n}) {\n return (\n <div className=\"tds-sidenav-responsive-header\">\n {label && (\n <h2 className=\"tds-sidenav-responsive-header-label\">{label}</h2>\n )}\n <button\n type=\"button\"\n className=\"tds-btn tds-btn--outline-neutral tds-btn--icononly tds-sidenav-responsive-header-toggle\"\n aria-label=\"Menu\"\n aria-controls={popoverId}\n popovertarget={popoverId}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M0 6.91104H16V8.68904H0V6.91104ZM0 13.133H16V11.356H0V13.133ZM0 2.46704V4.24404H16V2.46704H0Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </div>\n )\n}\n"],"names":[],"mappings":";;SAEgB,uBAAuB,CAAC,EACtC,KAAK,EACL,SAAS,GAIV,EAAA;AACC,IAAA,
|
|
1
|
+
{"version":3,"file":"SidenavResponsiveHeader.js","sources":["../../../../src/components/sidenav/private/SidenavResponsiveHeader.tsx"],"sourcesContent":["import React from \"react\"\n\nexport function SidenavResponsiveHeader({\n label,\n popoverId,\n}: {\n label?: string\n popoverId: string\n}) {\n return (\n <div className=\"tds-sidenav-responsive-header\">\n {label && (\n <h2 className=\"tds-sidenav-responsive-header-label\">{label}</h2>\n )}\n <button\n type=\"button\"\n className=\"tds-btn tds-btn--outline-neutral tds-btn--icononly tds-sidenav-responsive-header-toggle\"\n aria-label=\"Menu\"\n aria-controls={popoverId}\n popovertarget={popoverId}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M0 6.91104H16V8.68904H0V6.91104ZM0 13.133H16V11.356H0V13.133ZM0 2.46704V4.24404H16V2.46704H0Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </div>\n )\n}\n"],"names":["React"],"mappings":";;SAEgB,uBAAuB,CAAC,EACtC,KAAK,EACL,SAAS,GAIV,EAAA;AACC,IAAA,QACEA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,+BAA+B,EAAA;QAC3C,KAAK,KACJA,cAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,qCAAqC,EAAA,EAAE,KAAK,CAAM,CACjE;AACD,QAAAA,cAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,yFAAyF,EAAA,YAAA,EACxF,MAAM,EAAA,eAAA,EACF,SAAS,EACxB,aAAa,EAAE,SAAS,EAAA;YAExBA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,iBACC,MAAM,EAAA;AAElB,gBAAAA,cAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACE,CAAC,EAAC,+FAA+F,EACjG,IAAI,EAAC,cAAc,EAAA,CACnB,CACE,CACC,CACL;AAEV;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
2
|
|
|
3
3
|
let warned = false;
|
|
4
4
|
/**
|
|
@@ -32,18 +32,18 @@ function withSlotChildrenAsActions(props) {
|
|
|
32
32
|
}
|
|
33
33
|
// Fragments render no DOM, so the web component slotted their children too.
|
|
34
34
|
function partitionSlotChildren(node, slotted, keyPrefix = "") {
|
|
35
|
-
return
|
|
36
|
-
if (!
|
|
35
|
+
return React__default.Children.toArray(node).flatMap((child) => {
|
|
36
|
+
if (!React__default.isValidElement(child))
|
|
37
37
|
return [child];
|
|
38
|
-
if (child.type ===
|
|
38
|
+
if (child.type === React__default.Fragment) {
|
|
39
39
|
const rest = partitionSlotChildren(child.props.children, slotted, `${keyPrefix}${child.key}`);
|
|
40
|
-
return [
|
|
40
|
+
return [React__default.cloneElement(child, undefined, ...rest)];
|
|
41
41
|
}
|
|
42
42
|
const { slot } = child.props;
|
|
43
43
|
if (slot !== "label-actions" && slot !== "section-actions")
|
|
44
44
|
return [child];
|
|
45
45
|
const keyed = keyPrefix
|
|
46
|
-
?
|
|
46
|
+
? React__default.cloneElement(child, { key: `${keyPrefix}${child.key}` })
|
|
47
47
|
: child;
|
|
48
48
|
if (slot === "label-actions")
|
|
49
49
|
slotted.labelActions.push(keyed);
|
|
@@ -55,7 +55,7 @@ function partitionSlotChildren(node, slotted, keyPrefix = "") {
|
|
|
55
55
|
function appendActions(actions, slotted) {
|
|
56
56
|
if (!slotted.length)
|
|
57
57
|
return actions;
|
|
58
|
-
return
|
|
58
|
+
return React__default.createElement(React__default.Fragment, null, actions, ...slotted);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
export { withSlotChildrenAsActions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withSlotChildrenAsActions.js","sources":["../../../../src/components/sidenav/private/withSlotChildrenAsActions.ts"],"sourcesContent":["import React from \"react\"\n\ntype SectionActionProps = {\n children: React.ReactNode\n labelActions?: React.ReactNode\n sectionActions?: React.ReactNode\n}\n\nlet warned = false\n\n/**\n * Backward compatibility for `SidenavSection` children marked with\n * `slot=\"label-actions\"` or `slot=\"section-actions\"`, from when it wrapped the\n * `tds-sidenav-section` web component. Moves them into the `labelActions` and\n * `sectionActions` props. Remove in DE-1292.\n */\nexport function withSlotChildrenAsActions<P extends SectionActionProps>(\n props: P\n): P {\n const labelActions: React.ReactNode[] = []\n const sectionActions: React.ReactNode[] = []\n const children = partitionSlotChildren(props.children, {\n labelActions,\n sectionActions,\n })\n\n if (!labelActions.length && !sectionActions.length) return props\n\n if (!warned) {\n warned = true\n console.warn(\n '[tapestry] SidenavSection children with slot=\"label-actions\" or ' +\n 'slot=\"section-actions\" are deprecated and will be removed in the ' +\n \"next major version. Pass them as the labelActions and \" +\n \"sectionActions props instead.\"\n )\n }\n\n return {\n ...props,\n children,\n labelActions: appendActions(props.labelActions, labelActions),\n sectionActions: appendActions(props.sectionActions, sectionActions),\n }\n}\n\ntype SlotChildren = {\n labelActions: React.ReactNode[]\n sectionActions: React.ReactNode[]\n}\n\n// Fragments render no DOM, so the web component slotted their children too.\nfunction partitionSlotChildren(\n node: React.ReactNode,\n slotted: SlotChildren,\n keyPrefix = \"\"\n): React.ReactNode[] {\n return React.Children.toArray(node).flatMap((child) => {\n if (\n !React.isValidElement<{ children?: React.ReactNode; slot?: string }>(\n child\n )\n )\n return [child]\n\n if (child.type === React.Fragment) {\n const rest = partitionSlotChildren(\n child.props.children,\n slotted,\n `${keyPrefix}${child.key}`\n )\n return [React.cloneElement(child, undefined, ...rest)]\n }\n\n const { slot } = child.props\n if (slot !== \"label-actions\" && slot !== \"section-actions\") return [child]\n\n const keyed = keyPrefix\n ? React.cloneElement(child, { key: `${keyPrefix}${child.key}` })\n : child\n if (slot === \"label-actions\") slotted.labelActions.push(keyed)\n else slotted.sectionActions.push(keyed)\n return []\n })\n}\n\nfunction appendActions(actions: React.ReactNode, slotted: React.ReactNode[]) {\n if (!slotted.length) return actions\n return React.createElement(React.Fragment, null, actions, ...slotted)\n}\n"],"names":[],"mappings":";;AAQA,IAAI,MAAM,GAAG,KAAK;AAElB;;;;;AAKG;AACG,SAAU,yBAAyB,CACvC,KAAQ,EAAA;IAER,MAAM,YAAY,GAAsB,EAAE;IAC1C,MAAM,cAAc,GAAsB,EAAE;AAC5C,IAAA,MAAM,QAAQ,GAAG,qBAAqB,CAAC,KAAK,CAAC,QAAQ,EAAE;QACrD,YAAY;QACZ,cAAc;AACf,KAAA,CAAC;IAEF,IAAI,CAAC,YAAY,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM;AAAE,QAAA,OAAO,KAAK;IAEhE,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,GAAG,IAAI;QACb,OAAO,CAAC,IAAI,CACV,kEAAkE;YAChE,mEAAmE;YACnE,wDAAwD;AACxD,YAAA,+BAA+B,CAClC;IACH;IAEA,OAAO;AACL,QAAA,GAAG,KAAK;QACR,QAAQ;QACR,YAAY,EAAE,aAAa,CAAC,KAAK,CAAC,YAAY,EAAE,YAAY,CAAC;QAC7D,cAAc,EAAE,aAAa,CAAC,KAAK,CAAC,cAAc,EAAE,cAAc,CAAC;KACpE;AACH;AAOA;AACA,SAAS,qBAAqB,CAC5B,IAAqB,EACrB,OAAqB,EACrB,SAAS,GAAG,EAAE,EAAA;AAEd,IAAA,
|
|
1
|
+
{"version":3,"file":"withSlotChildrenAsActions.js","sources":["../../../../src/components/sidenav/private/withSlotChildrenAsActions.ts"],"sourcesContent":["import React from \"react\"\n\ntype SectionActionProps = {\n children: React.ReactNode\n labelActions?: React.ReactNode\n sectionActions?: React.ReactNode\n}\n\nlet warned = false\n\n/**\n * Backward compatibility for `SidenavSection` children marked with\n * `slot=\"label-actions\"` or `slot=\"section-actions\"`, from when it wrapped the\n * `tds-sidenav-section` web component. Moves them into the `labelActions` and\n * `sectionActions` props. Remove in DE-1292.\n */\nexport function withSlotChildrenAsActions<P extends SectionActionProps>(\n props: P\n): P {\n const labelActions: React.ReactNode[] = []\n const sectionActions: React.ReactNode[] = []\n const children = partitionSlotChildren(props.children, {\n labelActions,\n sectionActions,\n })\n\n if (!labelActions.length && !sectionActions.length) return props\n\n if (!warned) {\n warned = true\n console.warn(\n '[tapestry] SidenavSection children with slot=\"label-actions\" or ' +\n 'slot=\"section-actions\" are deprecated and will be removed in the ' +\n \"next major version. Pass them as the labelActions and \" +\n \"sectionActions props instead.\"\n )\n }\n\n return {\n ...props,\n children,\n labelActions: appendActions(props.labelActions, labelActions),\n sectionActions: appendActions(props.sectionActions, sectionActions),\n }\n}\n\ntype SlotChildren = {\n labelActions: React.ReactNode[]\n sectionActions: React.ReactNode[]\n}\n\n// Fragments render no DOM, so the web component slotted their children too.\nfunction partitionSlotChildren(\n node: React.ReactNode,\n slotted: SlotChildren,\n keyPrefix = \"\"\n): React.ReactNode[] {\n return React.Children.toArray(node).flatMap((child) => {\n if (\n !React.isValidElement<{ children?: React.ReactNode; slot?: string }>(\n child\n )\n )\n return [child]\n\n if (child.type === React.Fragment) {\n const rest = partitionSlotChildren(\n child.props.children,\n slotted,\n `${keyPrefix}${child.key}`\n )\n return [React.cloneElement(child, undefined, ...rest)]\n }\n\n const { slot } = child.props\n if (slot !== \"label-actions\" && slot !== \"section-actions\") return [child]\n\n const keyed = keyPrefix\n ? React.cloneElement(child, { key: `${keyPrefix}${child.key}` })\n : child\n if (slot === \"label-actions\") slotted.labelActions.push(keyed)\n else slotted.sectionActions.push(keyed)\n return []\n })\n}\n\nfunction appendActions(actions: React.ReactNode, slotted: React.ReactNode[]) {\n if (!slotted.length) return actions\n return React.createElement(React.Fragment, null, actions, ...slotted)\n}\n"],"names":["React"],"mappings":";;AAQA,IAAI,MAAM,GAAG,KAAK;AAElB;;;;;AAKG;AACG,SAAU,yBAAyB,CACvC,KAAQ,EAAA;IAER,MAAM,YAAY,GAAsB,EAAE;I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5B,QAAA,IAAI,IAAI,KAAK,eAAe,IAAI,IAAI,KAAK,iBAAiB;YAAE,OAAO,CAAC,KAAK,CAAC;QAE1E,MAAM,KAAK,GAAG;AACZ,cAAEA,cAAK,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,CAAA,EAAG,SAAS,CAAA,EAAG,KAAK,CAAC,GAAG,CAAA,CAAE,EAAE;cAC7D,KAAK;QACT,IAAI,IAAI,KAAK,eAAe;AAAE,YAAA,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;;AACzD,YAAA,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC;AACvC,QAAA,OAAO,EAAE;AACX,IAAA,CAAC,CAAC;AACJ;AAEA,SAAS,aAAa,CAAC,OAAwB,EAAE,OAA0B,EAAA;IACzE,IAAI,CAAC,OAAO,CAAC,MAAM;AAAE,QAAA,OAAO,OAAO;AACnC,IAAA,OAAOA,cAAK,CAAC,aAAa,CAACA,cAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;AACvE;;;;"}
|
|
@@ -3,7 +3,7 @@ import Icon from '../../utilities/Icon.js';
|
|
|
3
3
|
import { useTapestryLocale } from '../../utilities/locale.js';
|
|
4
4
|
import { useDateFieldLocale } from '../../utilities/useDateFieldLocale.js';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
-
import
|
|
6
|
+
import React__default from 'react';
|
|
7
7
|
import { I18nProvider } from 'react-aria/I18nProvider';
|
|
8
8
|
import { TimeField as TimeField$1, Label, DateInput, DateSegment, Text } from 'react-aria-components/TimeField';
|
|
9
9
|
|
|
@@ -27,15 +27,15 @@ function TimeField({ className, defaultValue, description, disabled, forceLeadin
|
|
|
27
27
|
}, className);
|
|
28
28
|
const locale = useTapestryLocale();
|
|
29
29
|
const dateFieldLocale = useDateFieldLocale();
|
|
30
|
-
return (
|
|
31
|
-
|
|
32
|
-
!hideLabel &&
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
return (React__default.createElement(I18nProvider, { locale: locale },
|
|
31
|
+
React__default.createElement(TimeField$1, { ...restProps, "aria-label": hideLabel ? label : undefined, className: combinedClassName, defaultValue: asTimeFieldValue(defaultValue), granularity: "minute", isDisabled: disabled, isReadOnly: readOnly, isRequired: required, maxValue: asTimeFieldValue(max), minValue: asTimeFieldValue(min), shouldForceLeadingZeros: forceLeadingZeros },
|
|
32
|
+
!hideLabel && React__default.createElement(Label, { className: "tds-field-label" }, label),
|
|
33
|
+
React__default.createElement(I18nProvider, { locale: dateFieldLocale },
|
|
34
|
+
React__default.createElement(DateInput, { "aria-invalid": invalid || undefined, className: "tds-field-control tds-time-field-input" }, (segment) => (React__default.createElement(DateSegment, { "aria-invalid": invalid || undefined, className: segment.type === "literal"
|
|
35
35
|
? "tds-field-date-segment-separator"
|
|
36
36
|
: "tds-field-date-segment", segment: segment })))),
|
|
37
|
-
description && (
|
|
38
|
-
|
|
37
|
+
description && (React__default.createElement(Text, { elementType: "p", className: "tds-field-description", slot: "description" },
|
|
38
|
+
React__default.createElement(Icon, { "aria-hidden": true, className: "tds-field-description-invalid-icon", symbol: "general#exclamation-triangle" }),
|
|
39
39
|
description)))));
|
|
40
40
|
}
|
|
41
41
|
function asTimeFieldValue(value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeField.js","sources":["../../../src/components/time-field/TimeField.tsx"],"sourcesContent":["import \"../field/index.css\"\nimport \"./index.css\"\n\nimport {\n type CalendarDateTime,\n parseTime,\n type Time,\n type ZonedDateTime,\n} from \"@internationalized/date\"\nimport Icon from \"@utilities/Icon\"\nimport { useTapestryLocale } from \"@utilities/locale\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport { useDateFieldLocale } from \"@utilities/useDateFieldLocale\"\nimport classNames from \"classnames\"\nimport React from \"react\"\nimport { I18nProvider } from \"react-aria/I18nProvider\"\nimport {\n DateInput,\n DateSegment,\n Label,\n Text,\n TimeField as AriaTimeField,\n type TimeFieldProps as AriaTimeFieldProps,\n} from \"react-aria-components/TimeField\"\n\nexport type TimeFieldSize = \"md\" | \"lg\"\n\nexport type TimeFieldValue = CalendarDateTime | Time | ZonedDateTime\n\nexport interface TimeFieldProps {\n /** The default value for the field, as a `TimeFieldValue` or an ISO 8601 time string (e.g. `\"12:00\"`). */\n defaultValue?: TimeFieldValue | string\n /** Helper text displayed below the component. Styled as error text when `invalid` is `true`. */\n description?: React.ReactNode\n /** Disables the field. */\n disabled?: boolean\n /** If `true`, always shows leading zeros in the hour field. */\n forceLeadingZeros?: boolean\n /** If `true`, renders the label visually hidden. */\n hideLabel?: boolean\n /** If `true`, applies error styling to the field and description. */\n invalid?: boolean\n /** Accessible label for the field. */\n label: string\n /** The maximum allowed time, as a `TimeFieldValue` or an ISO 8601 time string (e.g. `\"17:00\"`). */\n max?: TimeFieldValue | string\n /** The minimum allowed time, as a `TimeFieldValue` or an ISO 8601 time string (e.g. `\"09:00\"`). */\n min?: TimeFieldValue | string\n /** Allows the value to be read but not changed. */\n readOnly?: boolean\n /** If `true`, appends an asterisk after the label text. */\n required?: boolean\n /** The size of the time field. */\n size?: TimeFieldSize\n}\n\ntype AriaTimeFieldPropsToOmit =\n | \"children\"\n | \"granularity\"\n | \"placeholderValue\"\n | \"shouldForceLeadingZeros\"\n | \"slot\"\n\ntype AriaTimeFieldPropsToInclude =\n | \"hideTimeZone\"\n | \"hourCycle\"\n | \"name\"\n | \"onChange\"\n | \"value\"\n\nexport type TimeFieldElementProps = CombineAriaPropsWithCustomProps<\n AriaTimeFieldProps<TimeFieldValue>,\n TimeFieldProps,\n AriaTimeFieldPropsToOmit,\n AriaTimeFieldPropsToInclude\n>\n\n/**\n * A time field component allows users to enter and edit time values as individual\n * segments. Each segment supports keyboard entry, increment/decrement\n * with arrow keys, and respects the user's locale (12- vs 24-hour clock),\n * which can be overridden with `hourCycle`.\n *\n * Values are `Time`, `CalendarDateTime`, or `ZonedDateTime` from\n * `@internationalized/date`. Restrict the allowed range with `min`/`max`.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-timefield--docs | Storybook Documentation}\n * @see {@link https://github.com/planningcenter/tapestry/tree/main/packages/tapestry-migration-cli | Migration CLI: Available}\n */\nexport function TimeField({\n className,\n defaultValue,\n description,\n disabled,\n forceLeadingZeros,\n hideLabel,\n invalid,\n label,\n max,\n min,\n readOnly,\n required,\n size = \"md\",\n ...restProps\n}: TimeFieldElementProps) {\n const combinedClassName = classNames(\n \"tds-field tds-time-field\",\n {\n \"tds-field--lg\": size === \"lg\",\n \"tds-time-field--lg\": size === \"lg\",\n },\n className\n )\n\n const locale = useTapestryLocale()\n const dateFieldLocale = useDateFieldLocale()\n\n return (\n <I18nProvider locale={locale}>\n <AriaTimeField\n {...restProps}\n aria-label={hideLabel ? label : undefined}\n className={combinedClassName}\n defaultValue={asTimeFieldValue(defaultValue)}\n granularity=\"minute\"\n isDisabled={disabled}\n isReadOnly={readOnly}\n isRequired={required}\n maxValue={asTimeFieldValue(max)}\n minValue={asTimeFieldValue(min)}\n shouldForceLeadingZeros={forceLeadingZeros}\n >\n {!hideLabel && <Label className=\"tds-field-label\">{label}</Label>}\n <I18nProvider locale={dateFieldLocale}>\n <DateInput\n aria-invalid={invalid || undefined}\n className=\"tds-field-control tds-time-field-input\"\n >\n {(segment) => (\n <DateSegment\n aria-invalid={invalid || undefined}\n className={\n segment.type === \"literal\"\n ? \"tds-field-date-segment-separator\"\n : \"tds-field-date-segment\"\n }\n segment={segment}\n />\n )}\n </DateInput>\n </I18nProvider>\n {description && (\n <Text\n elementType=\"p\"\n className=\"tds-field-description\"\n slot=\"description\"\n >\n <Icon\n aria-hidden\n className=\"tds-field-description-invalid-icon\"\n symbol=\"general#exclamation-triangle\"\n />\n {description}\n </Text>\n )}\n </AriaTimeField>\n </I18nProvider>\n )\n}\n\nfunction asTimeFieldValue(\n value: TimeFieldValue | string | undefined\n): TimeFieldValue | undefined {\n if (typeof value === \"string\") {\n return parseTime(value)\n }\n return value ?? undefined\n}\n"],"names":["AriaTimeField","parseTime"],"mappings":";;;;;;;;;AA6EA;;;;;;;;;;;;AAYG;AACG,SAAU,SAAS,CAAC,EACxB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT,OAAO,EACP,KAAK,EACL,GAAG,EACH,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,IAAI,GAAG,IAAI,EACX,GAAG,SAAS,EACU,EAAA;AACtB,IAAA,MAAM,iBAAiB,GAAG,UAAU,CAClC,0BAA0B,EAC1B;QACE,eAAe,EAAE,IAAI,KAAK,IAAI;QAC9B,oBAAoB,EAAE,IAAI,KAAK,IAAI;KACpC,EACD,SAAS,CACV;AAED,IAAA,MAAM,MAAM,GAAG,iBAAiB,EAAE;AAClC,IAAA,MAAM,eAAe,GAAG,kBAAkB,EAAE;AAE5C,IAAA,
|
|
1
|
+
{"version":3,"file":"TimeField.js","sources":["../../../src/components/time-field/TimeField.tsx"],"sourcesContent":["import \"../field/index.css\"\nimport \"./index.css\"\n\nimport {\n type CalendarDateTime,\n parseTime,\n type Time,\n type ZonedDateTime,\n} from \"@internationalized/date\"\nimport Icon from \"@utilities/Icon\"\nimport { useTapestryLocale } from \"@utilities/locale\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport { useDateFieldLocale } from \"@utilities/useDateFieldLocale\"\nimport classNames from \"classnames\"\nimport React from \"react\"\nimport { I18nProvider } from \"react-aria/I18nProvider\"\nimport {\n DateInput,\n DateSegment,\n Label,\n Text,\n TimeField as AriaTimeField,\n type TimeFieldProps as AriaTimeFieldProps,\n} from \"react-aria-components/TimeField\"\n\nexport type TimeFieldSize = \"md\" | \"lg\"\n\nexport type TimeFieldValue = CalendarDateTime | Time | ZonedDateTime\n\nexport interface TimeFieldProps {\n /** The default value for the field, as a `TimeFieldValue` or an ISO 8601 time string (e.g. `\"12:00\"`). */\n defaultValue?: TimeFieldValue | string\n /** Helper text displayed below the component. Styled as error text when `invalid` is `true`. */\n description?: React.ReactNode\n /** Disables the field. */\n disabled?: boolean\n /** If `true`, always shows leading zeros in the hour field. */\n forceLeadingZeros?: boolean\n /** If `true`, renders the label visually hidden. */\n hideLabel?: boolean\n /** If `true`, applies error styling to the field and description. */\n invalid?: boolean\n /** Accessible label for the field. */\n label: string\n /** The maximum allowed time, as a `TimeFieldValue` or an ISO 8601 time string (e.g. `\"17:00\"`). */\n max?: TimeFieldValue | string\n /** The minimum allowed time, as a `TimeFieldValue` or an ISO 8601 time string (e.g. `\"09:00\"`). */\n min?: TimeFieldValue | string\n /** Allows the value to be read but not changed. */\n readOnly?: boolean\n /** If `true`, appends an asterisk after the label text. */\n required?: boolean\n /** The size of the time field. */\n size?: TimeFieldSize\n}\n\ntype AriaTimeFieldPropsToOmit =\n | \"children\"\n | \"granularity\"\n | \"placeholderValue\"\n | \"shouldForceLeadingZeros\"\n | \"slot\"\n\ntype AriaTimeFieldPropsToInclude =\n | \"hideTimeZone\"\n | \"hourCycle\"\n | \"name\"\n | \"onChange\"\n | \"value\"\n\nexport type TimeFieldElementProps = CombineAriaPropsWithCustomProps<\n AriaTimeFieldProps<TimeFieldValue>,\n TimeFieldProps,\n AriaTimeFieldPropsToOmit,\n AriaTimeFieldPropsToInclude\n>\n\n/**\n * A time field component allows users to enter and edit time values as individual\n * segments. Each segment supports keyboard entry, increment/decrement\n * with arrow keys, and respects the user's locale (12- vs 24-hour clock),\n * which can be overridden with `hourCycle`.\n *\n * Values are `Time`, `CalendarDateTime`, or `ZonedDateTime` from\n * `@internationalized/date`. Restrict the allowed range with `min`/`max`.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/forms-timefield--docs | Storybook Documentation}\n * @see {@link https://github.com/planningcenter/tapestry/tree/main/packages/tapestry-migration-cli | Migration CLI: Available}\n */\nexport function TimeField({\n className,\n defaultValue,\n description,\n disabled,\n forceLeadingZeros,\n hideLabel,\n invalid,\n label,\n max,\n min,\n readOnly,\n required,\n size = \"md\",\n ...restProps\n}: TimeFieldElementProps) {\n const combinedClassName = classNames(\n \"tds-field tds-time-field\",\n {\n \"tds-field--lg\": size === \"lg\",\n \"tds-time-field--lg\": size === \"lg\",\n },\n className\n )\n\n const locale = useTapestryLocale()\n const dateFieldLocale = useDateFieldLocale()\n\n return (\n <I18nProvider locale={locale}>\n <AriaTimeField\n {...restProps}\n aria-label={hideLabel ? label : undefined}\n className={combinedClassName}\n defaultValue={asTimeFieldValue(defaultValue)}\n granularity=\"minute\"\n isDisabled={disabled}\n isReadOnly={readOnly}\n isRequired={required}\n maxValue={asTimeFieldValue(max)}\n minValue={asTimeFieldValue(min)}\n shouldForceLeadingZeros={forceLeadingZeros}\n >\n {!hideLabel && <Label className=\"tds-field-label\">{label}</Label>}\n <I18nProvider locale={dateFieldLocale}>\n <DateInput\n aria-invalid={invalid || undefined}\n className=\"tds-field-control tds-time-field-input\"\n >\n {(segment) => (\n <DateSegment\n aria-invalid={invalid || undefined}\n className={\n segment.type === \"literal\"\n ? \"tds-field-date-segment-separator\"\n : \"tds-field-date-segment\"\n }\n segment={segment}\n />\n )}\n </DateInput>\n </I18nProvider>\n {description && (\n <Text\n elementType=\"p\"\n className=\"tds-field-description\"\n slot=\"description\"\n >\n <Icon\n aria-hidden\n className=\"tds-field-description-invalid-icon\"\n symbol=\"general#exclamation-triangle\"\n />\n {description}\n </Text>\n )}\n </AriaTimeField>\n </I18nProvider>\n )\n}\n\nfunction asTimeFieldValue(\n value: TimeFieldValue | string | undefined\n): TimeFieldValue | undefined {\n if (typeof value === \"string\") {\n return parseTime(value)\n }\n return value ?? undefined\n}\n"],"names":["React","AriaTimeField","parseTime"],"mappings":";;;;;;;;;AA6EA;;;;;;;;;;;;AAYG;AACG,SAAU,SAAS,CAAC,EACxB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT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cAAA,EACI,OAAO,IAAI,SAAS,EAClC,SAAS,EACP,OAAO,CAAC,IAAI,KAAK;AACf,0BAAE;0BACA,wBAAwB,EAE9B,OAAO,EAAE,OAAO,EAAA,CAChB,CACH,CACS,CACC;AACd,YAAA,WAAW,KACVA,cAAA,CAAA,aAAA,CAAC,IAAI,IACH,WAAW,EAAC,GAAG,EACf,SAAS,EAAC,uBAAuB,EACjC,IAAI,EAAC,aAAa,EAAA;gBAElBA,cAAA,CAAA,aAAA,CAAC,IAAI,yBAEH,SAAS,EAAC,oCAAoC,EAC9C,MAAM,EAAC,8BAA8B,EAAA,CACrC;AACD,gBAAA,WAAW,CACP,CACR,CACa,CACH;AAEnB;AAEA,SAAS,gBAAgB,CACvB,KAA0C,EAAA;AAE1C,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,QAAA,OAAOE,yCAAS,CAAC,KAAK,CAAC;IACzB;IACA,OAAO,KAAK,IAAI,SAAS;AAC3B;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
import { getComponent as o } from './registry.js';
|
|
4
4
|
|
|
5
5
|
function Se(t) {
|
|
@@ -1692,7 +1692,7 @@ function ye() {
|
|
|
1692
1692
|
return c && c.__esModule ? c : { default: c };
|
|
1693
1693
|
};
|
|
1694
1694
|
Object.defineProperty(t, "__esModule", { value: true }), t.returnFirstArg = t.canTextBeChildOfNode = t.ELEMENTS_WITH_NO_TEXT_CHILDREN = t.PRESERVE_CUSTOM_ATTRIBUTES = void 0, t.isCustomComponent = p, t.setStyleProp = l;
|
|
1695
|
-
var u =
|
|
1695
|
+
var u = React__default, s = o(Me()), d = /* @__PURE__ */ new Set([
|
|
1696
1696
|
"annotation-xml",
|
|
1697
1697
|
"color-profile",
|
|
1698
1698
|
"font-face",
|
|
@@ -1789,7 +1789,7 @@ function Le() {
|
|
|
1789
1789
|
return l && l.__esModule ? l : { default: l };
|
|
1790
1790
|
};
|
|
1791
1791
|
Object.defineProperty(H, "__esModule", { value: true }), H.default = p;
|
|
1792
|
-
var o =
|
|
1792
|
+
var o = React__default, u = t(_e()), s = ye(), d = {
|
|
1793
1793
|
cloneElement: o.cloneElement,
|
|
1794
1794
|
createElement: o.createElement,
|
|
1795
1795
|
isValidElement: o.isValidElement
|
|
@@ -1881,7 +1881,7 @@ function Ge(t) {
|
|
|
1881
1881
|
return u.length === 1 ? u[0] : u;
|
|
1882
1882
|
}
|
|
1883
1883
|
function Ue(t) {
|
|
1884
|
-
return
|
|
1884
|
+
return React__default.isValidElement(t) && typeof t.type != "string";
|
|
1885
1885
|
}
|
|
1886
1886
|
function Te(t) {
|
|
1887
1887
|
return typeof t == "string" && t.trim() === "";
|