tfy-web-components 0.0.34 → 0.0.35
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/README.md +49 -58
- package/dist/Button-C77b7jpW.js +284 -0
- package/dist/Button-C77b7jpW.js.map +1 -0
- package/dist/CompositeItem-BGwD51jI.js +33 -0
- package/dist/CompositeItem-BGwD51jI.js.map +1 -0
- package/dist/CompositeList-D4xmSZ5V.js +291 -0
- package/dist/CompositeList-D4xmSZ5V.js.map +1 -0
- package/dist/CompositeRoot-BxrPc7F6.js +351 -0
- package/dist/CompositeRoot-BxrPc7F6.js.map +1 -0
- package/dist/DirectionContext-Pb9yafF5.js +11 -0
- package/dist/DirectionContext-Pb9yafF5.js.map +1 -0
- package/dist/FieldItemContext-DRVgx-D1.js +13 -0
- package/dist/FieldItemContext-DRVgx-D1.js.map +1 -0
- package/dist/{Input-BvwIpntS.js → Input-Dhmo6L2n.js} +100 -78
- package/dist/Input-Dhmo6L2n.js.map +1 -0
- package/dist/Modal-C4MUy9GD.js +696 -0
- package/dist/Modal-C4MUy9GD.js.map +1 -0
- package/dist/{MonacoEditorCore-xfpJ6z-E.js → MonacoEditorCore-n-df5f7I.js} +2 -2
- package/dist/{MonacoEditorCore-xfpJ6z-E.js.map → MonacoEditorCore-n-df5f7I.js.map} +1 -1
- package/dist/Popover-eC_vX5By.js +1074 -0
- package/dist/Popover-eC_vX5By.js.map +1 -0
- package/dist/ToolbarRootContext-B_HxjkNI.js +11 -0
- package/dist/ToolbarRootContext-B_HxjkNI.js.map +1 -0
- package/dist/Tooltip-BuGLP-PU.js +4096 -0
- package/dist/Tooltip-BuGLP-PU.js.map +1 -0
- package/dist/classNames-B1XpQHle.js +44 -0
- package/dist/classNames-B1XpQHle.js.map +1 -0
- package/dist/components/atoms/Accordion.d.ts +19 -37
- package/dist/components/atoms/Accordion.es.js +847 -78
- package/dist/components/atoms/Accordion.es.js.map +1 -1
- package/dist/components/atoms/AudioPlayer.es.js +9 -9
- package/dist/components/atoms/AudioPlayer.es.js.map +1 -1
- package/dist/components/atoms/Avatar.d.ts +42 -9
- package/dist/components/atoms/Avatar.es.js +491 -36
- package/dist/components/atoms/Avatar.es.js.map +1 -1
- package/dist/components/atoms/Badge.d.ts +40 -35
- package/dist/components/atoms/Badge.es.js +163 -53
- package/dist/components/atoms/Badge.es.js.map +1 -1
- package/dist/components/atoms/Button.d.ts +37 -16
- package/dist/components/atoms/Button.es.js +16 -221
- package/dist/components/atoms/Button.es.js.map +1 -1
- package/dist/components/atoms/ButtonGroup.d.ts +53 -0
- package/dist/components/atoms/ButtonGroup.es.js +349 -0
- package/dist/components/atoms/ButtonGroup.es.js.map +1 -0
- package/dist/components/atoms/IconButton.d.ts +23 -9
- package/dist/components/atoms/IconButton.es.js +82 -16
- package/dist/components/atoms/IconButton.es.js.map +1 -1
- package/dist/components/atoms/IconProvider.d.ts +1 -1
- package/dist/components/atoms/IconProvider.es.js +48 -7
- package/dist/components/atoms/IconProvider.es.js.map +1 -1
- package/dist/components/atoms/Modal.d.ts +27 -3
- package/dist/components/atoms/Modal.es.js +15 -16
- package/dist/components/atoms/Modal.es.js.map +1 -1
- package/dist/components/atoms/Notification.d.ts +1 -1
- package/dist/components/atoms/Notification.es.js +26 -3
- package/dist/components/atoms/Notification.es.js.map +1 -1
- package/dist/components/atoms/OutlinedRadio.d.ts +6 -2
- package/dist/components/atoms/OutlinedRadio.es.js +12 -25
- package/dist/components/atoms/OutlinedRadio.es.js.map +1 -1
- package/dist/components/atoms/Progress.d.ts +48 -0
- package/dist/components/atoms/Progress.es.js +279 -0
- package/dist/components/atoms/Progress.es.js.map +1 -0
- package/dist/components/atoms/Skeleton.d.ts +9 -3
- package/dist/components/atoms/Skeleton.es.js +33 -3
- package/dist/components/atoms/Skeleton.es.js.map +1 -1
- package/dist/components/atoms/Spinner.d.ts +15 -4
- package/dist/components/atoms/Spinner.es.js +86 -22
- package/dist/components/atoms/Spinner.es.js.map +1 -1
- package/dist/components/atoms/Switch.d.ts +19 -7
- package/dist/components/atoms/Switch.es.js +288 -50
- package/dist/components/atoms/Switch.es.js.map +1 -1
- package/dist/components/atoms/TabButton.d.ts +17 -3
- package/dist/components/atoms/TabButton.es.js +647 -25
- package/dist/components/atoms/TabButton.es.js.map +1 -1
- package/dist/components/atoms/TabPanel.es.js +1 -1
- package/dist/components/atoms/Tag.d.ts +43 -0
- package/dist/components/atoms/Tag.es.js +219 -0
- package/dist/components/atoms/Tag.es.js.map +1 -0
- package/dist/components/atoms/Tooltip.d.ts +36 -14
- package/dist/components/atoms/Tooltip.es.js +7 -114
- package/dist/components/atoms/Tooltip.es.js.map +1 -1
- package/dist/components/molecules/Alert.d.ts +1 -1
- package/dist/components/molecules/Alert.es.js +13 -9
- package/dist/components/molecules/Alert.es.js.map +1 -1
- package/dist/components/molecules/CopyField.d.ts +2 -2
- package/dist/components/molecules/CopyField.es.js +3 -4
- package/dist/components/molecules/CopyField.es.js.map +1 -1
- package/dist/components/molecules/CustomDrawer.d.ts +5 -4
- package/dist/components/molecules/CustomDrawer.es.js +141 -82
- package/dist/components/molecules/CustomDrawer.es.js.map +1 -1
- package/dist/components/molecules/Dialog.d.ts +16 -8
- package/dist/components/molecules/Dialog.es.js +33 -31
- package/dist/components/molecules/Dialog.es.js.map +1 -1
- package/dist/components/molecules/ImagesPreview.es.js +15 -11
- package/dist/components/molecules/ImagesPreview.es.js.map +1 -1
- package/dist/components/molecules/Input.d.ts +1 -1
- package/dist/components/molecules/Input.es.js +3 -5
- package/dist/components/molecules/Input.es.js.map +1 -1
- package/dist/components/molecules/Markdown/ExpandableMarkdown.d.ts +8 -8
- package/dist/components/molecules/Markdown/components.d.ts +12 -11
- package/dist/components/molecules/Markdown.es.js +26 -49
- package/dist/components/molecules/Markdown.es.js.map +1 -1
- package/dist/components/molecules/Notify.d.ts +30 -1
- package/dist/components/molecules/Notify.es.js +91 -36
- package/dist/components/molecules/Notify.es.js.map +1 -1
- package/dist/components/molecules/SimpleCodeEditor.es.js +32 -19
- package/dist/components/molecules/SimpleCodeEditor.es.js.map +1 -1
- package/dist/components/molecules/ToggleButton.d.ts +3 -2
- package/dist/components/molecules/ToggleButton.es.js +155 -57
- package/dist/components/molecules/ToggleButton.es.js.map +1 -1
- package/dist/components/molecules/agent-chat/UserMessage.es.js +2 -2
- package/dist/components/molecules/agent-chat/UserMessage.es.js.map +1 -1
- package/dist/components/molecules/agent-chat/UserMessageEdit.es.js +5 -5
- package/dist/components/molecules/agent-chat/UserMessageEdit.es.js.map +1 -1
- package/dist/components/molecules/agent-chat/index.d.ts +0 -6
- package/dist/components/molecules/agent-chat.es.js +76 -407
- package/dist/components/molecules/agent-chat.es.js.map +1 -1
- package/dist/components/molecules/monacoEditorCore/MonacoEditorCore.d.ts +0 -1
- package/dist/components/theme/colors.d.ts +17 -53
- package/dist/components/theme/colors.es.js +384 -180
- package/dist/components/theme/colors.es.js.map +1 -1
- package/dist/components/theme/theme.d.ts +14 -11
- package/dist/components/theme/theme.es.js +3 -64
- package/dist/components/theme/theme.es.js.map +1 -1
- package/dist/components/theme/useTheme.es.js +1 -4
- package/dist/components/theme/useTheme.es.js.map +1 -1
- package/dist/composite-CrCQWAKA.js +108 -0
- package/dist/composite-CrCQWAKA.js.map +1 -0
- package/dist/composite-DCpXNxz9.js +66 -0
- package/dist/composite-DCpXNxz9.js.map +1 -0
- package/dist/conversions-CbWPvHRE.js +14 -0
- package/dist/conversions-CbWPvHRE.js.map +1 -0
- package/dist/error-FX4R42W-.js +6 -0
- package/dist/error-FX4R42W-.js.map +1 -0
- package/dist/fonts.css +7 -0
- package/dist/hooks/useContainerDimensions.d.ts +1 -1
- package/dist/index-B806bfA-.js +257 -0
- package/dist/index-B806bfA-.js.map +1 -0
- package/dist/index-DSVg79g-.js +45 -0
- package/dist/index-DSVg79g-.js.map +1 -0
- package/dist/index.d.ts +19 -4
- package/dist/index.es.js +56 -9
- package/dist/index.es.js.map +1 -1
- package/dist/inertValue-IJM5NA30.js +11 -0
- package/dist/inertValue-IJM5NA30.js.map +1 -0
- package/dist/lib/utils.d.ts +1 -0
- package/dist/markdown.css +13 -14
- package/dist/new-components/atoms/Checkbox.d.ts +6 -0
- package/dist/new-components/atoms/Checkbox.es.js +423 -0
- package/dist/new-components/atoms/Checkbox.es.js.map +1 -0
- package/dist/new-components/atoms/Chip.d.ts +38 -0
- package/dist/new-components/atoms/Chip.es.js +269 -0
- package/dist/new-components/atoms/Chip.es.js.map +1 -0
- package/dist/new-components/atoms/Popover.d.ts +87 -0
- package/dist/new-components/atoms/Popover.es.js +21 -0
- package/dist/new-components/atoms/Popover.es.js.map +1 -0
- package/dist/new-components/atoms/Radio.d.ts +14 -0
- package/dist/new-components/atoms/Radio.es.js +536 -0
- package/dist/new-components/atoms/Radio.es.js.map +1 -0
- package/dist/new-components/atoms/SegmentedControl.d.ts +28 -0
- package/dist/new-components/atoms/SegmentedControl.es.js +326 -0
- package/dist/new-components/atoms/SegmentedControl.es.js.map +1 -0
- package/dist/new-components/atoms/Slider.d.ts +8 -0
- package/dist/new-components/atoms/Slider.es.js +1415 -0
- package/dist/new-components/atoms/Slider.es.js.map +1 -0
- package/dist/new-components/atoms/Toggletip.d.ts +43 -0
- package/dist/new-components/atoms/Toggletip.es.js +216 -0
- package/dist/new-components/atoms/Toggletip.es.js.map +1 -0
- package/dist/new-components/atoms/stories/ThemeComparison.d.ts +8 -0
- package/dist/shadowDom-Bq4g0Qeu.js +52 -0
- package/dist/shadowDom-Bq4g0Qeu.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/theme.css +9 -154
- package/dist/tokens.css +1136 -0
- package/dist/useAnimationFrame-DwhymJoW.js +108 -0
- package/dist/useAnimationFrame-DwhymJoW.js.map +1 -0
- package/dist/useAriaLabelledBy-B6n92QBS.js +49 -0
- package/dist/useAriaLabelledBy-B6n92QBS.js.map +1 -0
- package/dist/useBaseUiId-Ch7ujXpo.js +281 -0
- package/dist/useBaseUiId-Ch7ujXpo.js.map +1 -0
- package/dist/useButton-PUBhT4Vo.js +235 -0
- package/dist/useButton-PUBhT4Vo.js.map +1 -0
- package/dist/useControlled-BSyYkg5C.js +65 -0
- package/dist/useControlled-BSyYkg5C.js.map +1 -0
- package/dist/useIsoLayoutEffect-e9VA-ICd.js +499 -0
- package/dist/useIsoLayoutEffect-e9VA-ICd.js.map +1 -0
- package/dist/useLabelableId-DCLzrdD-.js +241 -0
- package/dist/useLabelableId-DCLzrdD-.js.map +1 -0
- package/dist/useOpenInteractionType-DGWLoAqp.js +1086 -0
- package/dist/useOpenInteractionType-DGWLoAqp.js.map +1 -0
- package/dist/usePopupHandleStore-BdS-xYID.js +2372 -0
- package/dist/usePopupHandleStore-BdS-xYID.js.map +1 -0
- package/dist/useTimeout-BXf1hDIL.js +46 -0
- package/dist/useTimeout-BXf1hDIL.js.map +1 -0
- package/dist/useTransitionStatus-C9gg_XJ-.js +202 -0
- package/dist/useTransitionStatus-C9gg_XJ-.js.map +1 -0
- package/dist/useValueAsRef-BfFRcMg6.js +28 -0
- package/dist/useValueAsRef-BfFRcMg6.js.map +1 -0
- package/dist/utils/classNames.d.ts +3 -2
- package/dist/visuallyHidden-B6H2X3_Y.js +26 -0
- package/dist/visuallyHidden-B6H2X3_Y.js.map +1 -0
- package/dist/vite-env.d.ts +18 -0
- package/package.json +30 -22
- package/dist/Input-BvwIpntS.js.map +0 -1
- package/dist/Notification-BT4CZ69U.js +0 -39
- package/dist/Notification-BT4CZ69U.js.map +0 -1
- package/dist/RootFontSizeContext-7vgn7Y_k.js +0 -22
- package/dist/RootFontSizeContext-7vgn7Y_k.js.map +0 -1
- package/dist/classNames-Dy-RXSjS.js +0 -9
- package/dist/classNames-Dy-RXSjS.js.map +0 -1
- package/dist/components/molecules/DropdownMenu.d.ts +0 -18
- package/dist/components/molecules/DropdownMenu.es.js +0 -104
- package/dist/components/molecules/DropdownMenu.es.js.map +0 -1
- package/dist/components/molecules/ThumbsFeedback.d.ts +0 -13
- package/dist/components/molecules/ThumbsFeedback.es.js +0 -98
- package/dist/components/molecules/ThumbsFeedback.es.js.map +0 -1
- package/dist/components/molecules/agent-chat/SandboxToolCall.d.ts +0 -15
- package/dist/components/molecules/agent-chat/ToolCallCard.d.ts +0 -26
- package/dist/components/molecules/agent-chat/ToolCallContentBlock.d.ts +0 -17
- package/dist/components/theme/lightColorPlugin.d.ts +0 -1
- package/dist/components/theme/lightColorPlugin.es.js +0 -92
- package/dist/components/theme/lightColorPlugin.es.js.map +0 -1
- package/dist/tailwindPreset.d.ts +0 -144
- package/dist/tailwindPreset.es.js +0 -100
- package/dist/tailwindPreset.es.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompositeRoot-BxrPc7F6.js","sources":["../node_modules/@base-ui/react/internals/composite/constants.mjs","../node_modules/@base-ui/react/internals/composite/item/useCompositeItem.mjs","../node_modules/@base-ui/utils/isElementDisabled.mjs","../node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs","../node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs"],"sourcesContent":["export const ACTIVE_COMPOSITE_ITEM = 'data-composite-item-active';","'use client';\n\nimport * as React from 'react';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useCompositeRootContext } from \"../root/CompositeRootContext.mjs\";\nimport { useCompositeListItem } from \"../list/useCompositeListItem.mjs\";\nexport function useCompositeItem(params = {}) {\n const {\n highlightItemOnHover,\n highlightedIndex,\n onHighlightedIndexChange\n } = useCompositeRootContext();\n const {\n ref,\n index\n } = useCompositeListItem(params);\n const isHighlighted = highlightedIndex === index;\n const itemRef = React.useRef(null);\n const mergedRef = useMergedRefs(ref, itemRef);\n const compositeProps = {\n tabIndex: isHighlighted ? 0 : -1,\n onFocus() {\n onHighlightedIndexChange(index);\n },\n onMouseMove() {\n const item = itemRef.current;\n if (!highlightItemOnHover || !item) {\n return;\n }\n const disabled = item.hasAttribute('disabled') || item.ariaDisabled === 'true';\n if (!isHighlighted && !disabled) {\n item.focus();\n }\n }\n };\n return {\n compositeProps,\n compositeRef: mergedRef,\n index\n };\n}","export function isElementDisabled(element) {\n return element == null || element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true';\n}","'use client';\n\nimport * as React from 'react';\nimport { isElementDisabled } from '@base-ui/utils/isElementDisabled';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { EMPTY_ARRAY } from '@base-ui/utils/empty';\nimport { COMPOSITE_KEYS, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, END, HOME, MODIFIER_KEYS, findNonDisabledListIndex, getMaxListIndex, getMinListIndex, isListIndexDisabled, isIndexOutOfListBounds, isNativeInput, scrollIntoViewIfNeeded } from \"../composite.mjs\";\nimport { ACTIVE_COMPOSITE_ITEM } from \"../constants.mjs\";\nimport { getTarget } from \"../../../floating-ui-react/utils.mjs\";\nexport function useCompositeRoot(params) {\n const {\n loopFocus = true,\n orientation = 'both',\n grid,\n onLoop,\n direction,\n highlightedIndex: externalHighlightedIndex,\n onHighlightedIndexChange: externalSetHighlightedIndex,\n rootRef: externalRef,\n enableHomeAndEndKeys = false,\n stopEventPropagation,\n disabledIndices,\n modifierKeys = EMPTY_ARRAY\n } = params;\n const [internalHighlightedIndex, internalSetHighlightedIndex] = React.useState(0);\n const isGrid = grid != null;\n const rootRef = React.useRef(null);\n const mergedRef = useMergedRefs(rootRef, externalRef);\n const elementsRef = React.useRef([]);\n const hasSetDefaultIndexRef = React.useRef(false);\n const highlightedElementRef = React.useRef(null);\n const highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex;\n const onHighlightedIndexChange = useStableCallback((index, shouldScrollIntoView = false) => {\n highlightedElementRef.current = elementsRef.current[index] ?? null;\n (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index);\n if (shouldScrollIntoView) {\n const newActiveItem = elementsRef.current[index];\n scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation);\n }\n });\n const onMapChange = useStableCallback(map => {\n if (map.size === 0) {\n return;\n }\n if (hasSetDefaultIndexRef.current) {\n const elements = elementsRef.current;\n // Items added or removed around the highlighted one shift its index, so the tab stop would\n // otherwise move to a different item and navigation would resume from the wrong position.\n const nextIndex = elements.indexOf(highlightedElementRef.current);\n if (nextIndex === -1) {\n // A replacement at the same index can keep the tab stop. Otherwise move it to an\n // eligible item so a missing, hidden, or disabled replacement does not take the\n // composite out of the tab order.\n const replacement = elements[highlightedIndex];\n if (!replacement || isListIndexDisabled(elements, highlightedIndex, disabledIndices)) {\n onHighlightedIndexChange(getFallbackIndex(elements, disabledIndices));\n } else {\n highlightedElementRef.current = replacement;\n }\n } else if (nextIndex !== highlightedIndex) {\n onHighlightedIndexChange(nextIndex);\n }\n return;\n }\n hasSetDefaultIndexRef.current = true;\n const sortedElements = Array.from(map.keys());\n const activeItem = sortedElements.find(compositeElement => compositeElement?.hasAttribute(ACTIVE_COMPOSITE_ITEM)) ?? null;\n // Set the default highlighted index of an arbitrary composite item. The map value carries\n // the item's own index, which is not its position among the keys once a list mixes explicit\n // and automatic indexes and leaves gaps.\n const activeIndex = activeItem ? map.get(activeItem)?.index ?? -1 : -1;\n if (activeIndex !== -1) {\n onHighlightedIndexChange(activeIndex);\n } else if (isListIndexDisabled(sortedElements, highlightedIndex, disabledIndices)) {\n // The default highlighted item is disabled, so it should not hold the single\n // roving tab stop: a natively disabled element is removed from the tab order,\n // and an aria-disabled one should not be the entry point. Move the tab stop\n // to the first enabled item. If every item is disabled, keep the current\n // highlighted index.\n const firstEnabledIndex = findNonDisabledListIndex(sortedElements, {\n disabledIndices\n });\n if (!isIndexOutOfListBounds(sortedElements, firstEnabledIndex)) {\n onHighlightedIndexChange(firstEnabledIndex);\n }\n }\n scrollIntoViewIfNeeded(rootRef.current, activeItem, direction, orientation);\n });\n useIsoLayoutEffect(() => {\n // `disabledIndices` can resolve a render after the initial map population\n // (e.g. Toolbar derives it from item metadata through a state update), so the\n // default tab stop at index 0 may now point at a disabled item, leaving the\n // composite without a reachable tab stop. Re-validate and move it to the first\n // enabled item. Gated on `disabledIndices` being provided so composites that\n // rely on the DOM disabled fallback keep their existing behavior.\n if (disabledIndices == null || externalHighlightedIndex != null || !hasSetDefaultIndexRef.current) {\n return;\n }\n const elements = elementsRef.current;\n if (isListIndexDisabled(elements, highlightedIndex, disabledIndices)) {\n const firstEnabledIndex = findNonDisabledListIndex(elements, {\n disabledIndices\n });\n if (!isIndexOutOfListBounds(elements, firstEnabledIndex)) {\n onHighlightedIndexChange(firstEnabledIndex);\n }\n }\n }, [disabledIndices, externalHighlightedIndex, highlightedIndex, elementsRef, onHighlightedIndexChange]);\n const wrappedOnLoop = useStableCallback((event, prevIndex, nextIndex) => {\n if (!onLoop) {\n return nextIndex;\n }\n return onLoop(event, prevIndex, nextIndex, elementsRef);\n });\n\n // Stable so that `relayKeyboardEvent` does not invalidate identity-sensitive\n // consumers (the `CompositeRootContext` value and trigger data forwarding).\n const onKeyDown = useStableCallback(event => {\n const isHomeOrEnd = event.key === HOME || event.key === END;\n if (!COMPOSITE_KEYS.has(event.key) || !enableHomeAndEndKeys && isHomeOrEnd) {\n return;\n }\n if (isModifierKeySet(event, modifierKeys)) {\n return;\n }\n const element = rootRef.current;\n if (!element) {\n return;\n }\n const isRtl = direction === 'rtl';\n const horizontalForwardKey = isRtl ? ARROW_LEFT : ARROW_RIGHT;\n const horizontalBackwardKey = isRtl ? ARROW_RIGHT : ARROW_LEFT;\n const forwardKey = orientation === 'vertical' ? ARROW_DOWN : horizontalForwardKey;\n const backwardKey = orientation === 'vertical' ? ARROW_UP : horizontalBackwardKey;\n const target = getTarget(event.nativeEvent);\n if (target != null && isNativeInput(target) && !isElementDisabled(target)) {\n const selectionStart = target.selectionStart;\n const selectionEnd = target.selectionEnd;\n const textContent = target.value;\n // return to native textbox behavior when\n // 1 - Shift is held to make a text selection, or if there already is a text selection\n if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd) {\n return;\n }\n // 2 - arrow-ing forward and not in the last position of the text\n if (event.key !== backwardKey && selectionStart < textContent.length) {\n return;\n }\n // 3 -arrow-ing backward and not in the first position of the text\n if (event.key !== forwardKey && selectionStart > 0) {\n return;\n }\n }\n let nextIndex = highlightedIndex;\n const minIndex = getMinListIndex(elementsRef, disabledIndices);\n const maxIndex = getMaxListIndex(elementsRef, disabledIndices);\n if (grid != null) {\n nextIndex = grid({\n disabledIndices,\n elementsRef,\n event,\n highlightedIndex,\n loopFocus,\n maxIndex,\n minIndex,\n onLoop: wrappedOnLoop,\n orientation,\n rtl: isRtl\n });\n }\n const isForwardKey = orientation !== 'vertical' && event.key === horizontalForwardKey || orientation !== 'horizontal' && event.key === ARROW_DOWN;\n const isBackwardKey = orientation !== 'vertical' && event.key === horizontalBackwardKey || orientation !== 'horizontal' && event.key === ARROW_UP;\n if (enableHomeAndEndKeys) {\n if (event.key === HOME) {\n nextIndex = minIndex;\n } else if (event.key === END) {\n nextIndex = maxIndex;\n }\n }\n if (nextIndex === highlightedIndex && (isForwardKey || isBackwardKey)) {\n if (loopFocus && nextIndex === maxIndex && isForwardKey) {\n nextIndex = minIndex;\n if (onLoop) {\n nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);\n }\n } else if (loopFocus && nextIndex === minIndex && isBackwardKey) {\n nextIndex = maxIndex;\n if (onLoop) {\n nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);\n }\n } else {\n nextIndex = findNonDisabledListIndex(elementsRef.current, {\n startingIndex: nextIndex,\n decrement: isBackwardKey,\n disabledIndices\n });\n }\n }\n if (nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef.current, nextIndex)) {\n if (stopEventPropagation) {\n event.stopPropagation();\n }\n if (isGrid || isHomeOrEnd || isForwardKey || isBackwardKey) {\n event.preventDefault();\n }\n onHighlightedIndexChange(nextIndex, true);\n\n // Wait for FocusManager `returnFocus` to execute.\n queueMicrotask(() => {\n elementsRef.current[nextIndex]?.focus();\n });\n }\n });\n const props = {\n ref: mergedRef,\n onFocus(event) {\n const element = rootRef.current;\n const target = getTarget(event.nativeEvent);\n if (!element || target == null || !isNativeInput(target)) {\n return;\n }\n target.setSelectionRange(0, target.value.length);\n },\n onKeyDown\n };\n return {\n props,\n highlightedIndex,\n onHighlightedIndexChange,\n elementsRef,\n onMapChange,\n relayKeyboardEvent: onKeyDown\n };\n}\n\n// Resolves the item that should hold the tab stop: the active item when it can take focus,\n// otherwise the first item that can. Falls back to index 0 so an all-disabled composite keeps the\n// index in range and regains a tab stop as soon as one of its items becomes focusable.\nfunction getFallbackIndex(elements, disabledIndices) {\n let fallbackIndex = -1;\n for (let index = 0; index < elements.length; index += 1) {\n const element = elements[index];\n if (!element || isListIndexDisabled(elements, index, disabledIndices)) {\n continue;\n }\n if (element.hasAttribute(ACTIVE_COMPOSITE_ITEM)) {\n return index;\n }\n if (fallbackIndex === -1) {\n fallbackIndex = index;\n }\n }\n return Math.max(fallbackIndex, 0);\n}\nfunction isModifierKeySet(event, ignoredModifierKeys) {\n for (const key of MODIFIER_KEYS) {\n if (ignoredModifierKeys.includes(key)) {\n continue;\n }\n if (event.getModifierState(key)) {\n return true;\n }\n }\n return false;\n}","'use client';\n\nimport * as React from 'react';\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { CompositeList } from \"../list/CompositeList.mjs\";\nimport { useCompositeRoot } from \"./useCompositeRoot.mjs\";\nimport { CompositeRootContext } from \"./CompositeRootContext.mjs\";\nimport { useRenderElement } from \"../../useRenderElement.mjs\";\nimport { useDirection } from \"../../direction-context/DirectionContext.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function CompositeRoot(componentProps) {\n const {\n render,\n className,\n style,\n refs = EMPTY_ARRAY,\n props = EMPTY_ARRAY,\n state = EMPTY_OBJECT,\n stateAttributesMapping,\n highlightedIndex: highlightedIndexProp,\n onHighlightedIndexChange: onHighlightedIndexChangeProp,\n orientation,\n grid,\n loopFocus,\n onLoop,\n enableHomeAndEndKeys,\n onMapChange: onMapChangeProp,\n stopEventPropagation = true,\n rootRef,\n disabledIndices,\n modifierKeys,\n highlightItemOnHover = false,\n tag = 'div',\n ...elementProps\n } = componentProps;\n const direction = useDirection();\n const {\n props: defaultProps,\n highlightedIndex,\n onHighlightedIndexChange,\n elementsRef,\n onMapChange: onMapChangeUnwrapped,\n relayKeyboardEvent\n } = useCompositeRoot({\n grid,\n loopFocus,\n onLoop,\n orientation,\n highlightedIndex: highlightedIndexProp,\n onHighlightedIndexChange: onHighlightedIndexChangeProp,\n rootRef,\n stopEventPropagation,\n enableHomeAndEndKeys,\n direction,\n disabledIndices,\n modifierKeys\n });\n const element = useRenderElement(tag, componentProps, {\n state,\n ref: refs,\n props: [defaultProps, ...props, elementProps],\n stateAttributesMapping\n });\n const contextValue = React.useMemo(() => ({\n highlightedIndex,\n onHighlightedIndexChange,\n highlightItemOnHover,\n relayKeyboardEvent\n }), [highlightedIndex, onHighlightedIndexChange, highlightItemOnHover, relayKeyboardEvent]);\n return /*#__PURE__*/_jsx(CompositeRootContext.Provider, {\n value: contextValue,\n children: /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: elementsRef,\n onMapChange: newMap => {\n onMapChangeProp?.(newMap);\n onMapChangeUnwrapped(newMap);\n },\n children: element\n })\n });\n}"],"names":["_jsx"],"mappings":";;;;;;;;;AAAY,MAAC,wBAAwB;ACM9B,SAAS,iBAAiB,SAAS,IAAI;AAC5C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,EACJ,IAAM,wBAAuB;AAC3B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,EACJ,IAAM,qBAAqB,MAAM;AAC/B,QAAM,gBAAgB,qBAAqB;AAC3C,QAAM,UAAU,MAAM,OAAO,IAAI;AACjC,QAAM,YAAY,cAAc,KAAK,OAAO;AAC5C,QAAM,iBAAiB;AAAA,IACr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AAAA,IACR,QAAQ;AAAA,IACR;AAAA,IACA,kBAAkB;AAAA,IAClB,0BAA0B;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb,uBAAuB;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA,uBAAuB;AAAA,IACvB,MAAM;AAAA,IACN,GAAG;AAAA,EACP,IAAM;AACJ,QAAM,YAAY,aAAY;AAC9B,QAAM;AAAA,IACJ,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb;AAAA,EACJ,IAAM,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,IAClB,0BAA0B;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAG;AACD,QAAM,UAAU,iBAAiB,KAAK,gBAAgB;AAAA,IACpD;AAAA,IACA,KAAK;AAAA,IACL,OAAO,CAAC,cAAc,GAAG,OAAO,YAAY;AAAA,IAC5C;AAAA,EACJ,CAAG;AACD,QAAM,eAAe,MAAM,QAAQ,OAAO;AAAA,IACxC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ,IAAM,CAAC,kBAAkB,0BAA0B,sBAAsB,kBAAkB,CAAC;AAC1F,SAAoBA,oBAAK,qBAAqB,UAAU;AAAA,IACtD,OAAO;AAAA,IACP,UAAuBA,oBAAK,eAAe;AAAA,MACzC;AAAA,MACA,aAAa,YAAU;AACrB,2DAAkB;AAClB,6BAAqB,MAAM;AAAA,MAC7B;AAAA,MACA,UAAU;AAAA,IAChB,CAAK;AAAA,EACL,CAAG;AACH;","x_google_ignoreList":[0,1,2,3,4]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const DirectionContext = /* @__PURE__ */ React.createContext(void 0);
|
|
3
|
+
if (process.env.NODE_ENV !== "production") DirectionContext.displayName = "DirectionContext";
|
|
4
|
+
function useDirection() {
|
|
5
|
+
const context = React.useContext(DirectionContext);
|
|
6
|
+
return (context == null ? void 0 : context.direction) ?? "ltr";
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
useDirection as u
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=DirectionContext-Pb9yafF5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DirectionContext-Pb9yafF5.js","sources":["../node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nexport const DirectionContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DirectionContext.displayName = \"DirectionContext\";\nexport function useDirection() {\n const context = React.useContext(DirectionContext);\n return context?.direction ?? 'ltr';\n}"],"names":[],"mappings":";AAGO,MAAM,mBAAgC,sBAAM,cAAc,MAAS;AAC1E,IAAI,QAAQ,IAAI,aAAa,aAAc,kBAAiB,cAAc;AACnE,SAAS,eAAe;AAC7B,QAAM,UAAU,MAAM,WAAW,gBAAgB;AACjD,UAAO,mCAAS,cAAa;AAC/B;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const FieldItemContext = /* @__PURE__ */ React.createContext({
|
|
3
|
+
disabled: false
|
|
4
|
+
});
|
|
5
|
+
if (process.env.NODE_ENV !== "production") FieldItemContext.displayName = "FieldItemContext";
|
|
6
|
+
function useFieldItemContext() {
|
|
7
|
+
const context = React.useContext(FieldItemContext);
|
|
8
|
+
return context;
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
useFieldItemContext as u
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=FieldItemContext-DRVgx-D1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldItemContext-DRVgx-D1.js","sources":["../node_modules/@base-ui/react/field/item/FieldItemContext.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nexport const FieldItemContext = /*#__PURE__*/React.createContext({\n disabled: false\n});\nif (process.env.NODE_ENV !== \"production\") FieldItemContext.displayName = \"FieldItemContext\";\nexport function useFieldItemContext() {\n const context = React.useContext(FieldItemContext);\n return context;\n}"],"names":[],"mappings":";AAGO,MAAM,mBAAgC,sBAAM,cAAc;AAAA,EAC/D,UAAU;AACZ,CAAC;AACD,IAAI,QAAQ,IAAI,aAAa,aAAc,kBAAiB,cAAc;AACnE,SAAS,sBAAsB;AACpC,QAAM,UAAU,MAAM,WAAW,gBAAgB;AACjD,SAAO;AACT;","x_google_ignoreList":[0]}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import React__default, { useState, memo, useEffect, useMemo, useRef } from "react";
|
|
4
|
-
import
|
|
5
|
-
import { c as classNames } from "./classNames-Dy-RXSjS.js";
|
|
3
|
+
import React__default, { useState, memo, useEffect, useMemo, useRef, useId } from "react";
|
|
4
|
+
import { c as classNames } from "./classNames-B1XpQHle.js";
|
|
6
5
|
import IconProvider from "./components/atoms/IconProvider.es.js";
|
|
7
|
-
import { DarkTooltip } from "./
|
|
8
|
-
import {
|
|
9
|
-
import { Button } from "./components/atoms/Button.es.js";
|
|
6
|
+
import { D as DarkTooltip } from "./Tooltip-BuGLP-PU.js";
|
|
7
|
+
import { B as Button } from "./Button-C77b7jpW.js";
|
|
10
8
|
import { useTheme } from "./components/theme/useTheme.es.js";
|
|
11
9
|
import IconButton from "./components/atoms/IconButton.es.js";
|
|
12
10
|
import notify$1 from "./components/molecules/Notify.es.js";
|
|
11
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
12
|
+
function getDefaultExportFromCjs(x) {
|
|
13
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
14
|
+
}
|
|
13
15
|
var resizeObservers = [];
|
|
14
16
|
var hasActiveObservations = function() {
|
|
15
17
|
return resizeObservers.some(function(ro) {
|
|
@@ -617,7 +619,7 @@ const useContainerDimensions = (target) => {
|
|
|
617
619
|
var _a;
|
|
618
620
|
setSize((_a = target == null ? void 0 : target.current) == null ? void 0 : _a.getBoundingClientRect());
|
|
619
621
|
}, [target]);
|
|
620
|
-
useResizeObserver(target, (
|
|
622
|
+
useResizeObserver(target, () => {
|
|
621
623
|
var _a;
|
|
622
624
|
return setSize((_a = target.current) == null ? void 0 : _a.getBoundingClientRect());
|
|
623
625
|
});
|
|
@@ -1898,10 +1900,6 @@ function parse$1(value) {
|
|
|
1898
1900
|
function stringify(values) {
|
|
1899
1901
|
return values.join(" ").trim();
|
|
1900
1902
|
}
|
|
1901
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
1902
|
-
function getDefaultExportFromCjs(x) {
|
|
1903
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
1904
|
-
}
|
|
1905
1903
|
var cjs$2 = {};
|
|
1906
1904
|
var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
|
|
1907
1905
|
var NEWLINE_REGEX = /\n/g;
|
|
@@ -73701,7 +73699,7 @@ const CopyField = ({
|
|
|
73701
73699
|
tooltipTitle = "",
|
|
73702
73700
|
dataTestPrefix,
|
|
73703
73701
|
wrapperDataTestId,
|
|
73704
|
-
bgClass = "bg-
|
|
73702
|
+
bgClass = "bg-background-surface-page",
|
|
73705
73703
|
btnProps,
|
|
73706
73704
|
beforeCopy,
|
|
73707
73705
|
onCopy,
|
|
@@ -73715,9 +73713,9 @@ const CopyField = ({
|
|
|
73715
73713
|
const containerClasses = classNames("flex gap-1 items-center", {
|
|
73716
73714
|
[className]: className
|
|
73717
73715
|
});
|
|
73718
|
-
const buttonClasses = classNames("font-normal outline-
|
|
73716
|
+
const buttonClasses = classNames("font-normal outline-hidden mr-1", {
|
|
73719
73717
|
"text-sm": !btnClass,
|
|
73720
|
-
"text-
|
|
73718
|
+
"text-text-tertiary hover:text-text-on-solid": !btnTextClass,
|
|
73721
73719
|
"w-6 h-6": !initialText,
|
|
73722
73720
|
[btnClass]: btnClass,
|
|
73723
73721
|
[bgClass]: bgClass
|
|
@@ -73751,6 +73749,8 @@ const CopyField = ({
|
|
|
73751
73749
|
IconButton,
|
|
73752
73750
|
{
|
|
73753
73751
|
icon: hasCopied ? "check" : icon || "clone",
|
|
73752
|
+
variant: "ghost",
|
|
73753
|
+
size: "md",
|
|
73754
73754
|
onClick: handleCopy,
|
|
73755
73755
|
iconSize,
|
|
73756
73756
|
className: iconClass,
|
|
@@ -73804,7 +73804,7 @@ const CopyInputField = (props) => {
|
|
|
73804
73804
|
{
|
|
73805
73805
|
value: props.copyProps.rawValue,
|
|
73806
73806
|
className: classNames(
|
|
73807
|
-
"input-sm pr-10 border-
|
|
73807
|
+
"input-sm pr-10 border-border-subtle border-[0.5px] bg-background-surface-page text-xs font-jetbrains",
|
|
73808
73808
|
{
|
|
73809
73809
|
truncate: !inputHover
|
|
73810
73810
|
},
|
|
@@ -73835,7 +73835,7 @@ const CopyFieldHighlighted = ({ text: text2, wrapLongLines = false }) => {
|
|
|
73835
73835
|
padding: "0.5rem 1rem",
|
|
73836
73836
|
marginTop: "0.5rem",
|
|
73837
73837
|
fontSize: "0.8rem",
|
|
73838
|
-
background: isDark ?
|
|
73838
|
+
background: isDark ? "var(--background-surface-sunken)" : "var(--background-surface-selected)",
|
|
73839
73839
|
overflowX: wrapLongLines ? "visible" : "auto"
|
|
73840
73840
|
},
|
|
73841
73841
|
children: text2,
|
|
@@ -73846,6 +73846,19 @@ const CopyFieldHighlighted = ({ text: text2, wrapLongLines = false }) => {
|
|
|
73846
73846
|
/* @__PURE__ */ jsx(CopyField, { rawValue: text2, className: "absolute top-3.5 right-2" })
|
|
73847
73847
|
] });
|
|
73848
73848
|
};
|
|
73849
|
+
function InlineCode({ className, ...props }) {
|
|
73850
|
+
return /* @__PURE__ */ jsx(
|
|
73851
|
+
"code",
|
|
73852
|
+
{
|
|
73853
|
+
"data-slot": "code",
|
|
73854
|
+
className: classNames(
|
|
73855
|
+
"rounded-sm bg-background-surface-sunken px-1 py-0.5 font-mono text-code-sm text-text-code",
|
|
73856
|
+
className
|
|
73857
|
+
),
|
|
73858
|
+
...props
|
|
73859
|
+
}
|
|
73860
|
+
);
|
|
73861
|
+
}
|
|
73849
73862
|
const darkThemeCodeStyle = {
|
|
73850
73863
|
padding: "16px",
|
|
73851
73864
|
overflow: "auto",
|
|
@@ -73869,7 +73882,7 @@ const Code = ({
|
|
|
73869
73882
|
}) => {
|
|
73870
73883
|
const languageMatch = /language-(\w+)/.exec(className || "");
|
|
73871
73884
|
const codeValue = String(children).replace(/\n$/, "");
|
|
73872
|
-
const copyRef =
|
|
73885
|
+
const copyRef = React.useRef(null);
|
|
73873
73886
|
useEffect(() => {
|
|
73874
73887
|
var _a, _b, _c, _d;
|
|
73875
73888
|
if ((_b = (_a = copyRef.current) == null ? void 0 : _a.parentElement) == null ? void 0 : _b.parentElement) {
|
|
@@ -73880,57 +73893,66 @@ const Code = ({
|
|
|
73880
73893
|
}
|
|
73881
73894
|
}, []);
|
|
73882
73895
|
const isInlineCode = codeValue.split("\n").length === 1 && !/^[\s\t]+/.test(codeValue);
|
|
73883
|
-
return (languageMatch || skipLanguageMatch) && !rest.inline && !isInlineCode ? /* @__PURE__ */ jsxs(
|
|
73884
|
-
|
|
73885
|
-
|
|
73886
|
-
|
|
73887
|
-
|
|
73888
|
-
|
|
73889
|
-
|
|
73890
|
-
|
|
73891
|
-
|
|
73892
|
-
|
|
73893
|
-
|
|
73894
|
-
|
|
73895
|
-
|
|
73896
|
-
|
|
73897
|
-
|
|
73898
|
-
|
|
73899
|
-
|
|
73900
|
-
|
|
73901
|
-
|
|
73902
|
-
|
|
73903
|
-
|
|
73904
|
-
|
|
73905
|
-
|
|
73906
|
-
|
|
73907
|
-
|
|
73908
|
-
|
|
73909
|
-
|
|
73910
|
-
|
|
73911
|
-
|
|
73912
|
-
|
|
73913
|
-
|
|
73914
|
-
|
|
73915
|
-
|
|
73916
|
-
|
|
73896
|
+
return (languageMatch || skipLanguageMatch) && !rest.inline && !isInlineCode ? /* @__PURE__ */ jsxs(
|
|
73897
|
+
"div",
|
|
73898
|
+
{
|
|
73899
|
+
className: classNames(
|
|
73900
|
+
showCopyOutside ? "" : "relative",
|
|
73901
|
+
"not-prose overflow-hidden rounded-md border border-border-default bg-background-surface-sunken"
|
|
73902
|
+
),
|
|
73903
|
+
children: [
|
|
73904
|
+
/* @__PURE__ */ jsx(
|
|
73905
|
+
highlighter,
|
|
73906
|
+
{
|
|
73907
|
+
...rest,
|
|
73908
|
+
PreTag: "div",
|
|
73909
|
+
customStyle: {
|
|
73910
|
+
backgroundColor: "transparent",
|
|
73911
|
+
...darkTheme ? darkThemeCodeStyle : {}
|
|
73912
|
+
},
|
|
73913
|
+
language: languageMatch == null ? void 0 : languageMatch[1],
|
|
73914
|
+
codeTagProps: style2 ? {
|
|
73915
|
+
style: {
|
|
73916
|
+
fontFamily: style2.fontFamily,
|
|
73917
|
+
fontSize: style2.fontSize
|
|
73918
|
+
}
|
|
73919
|
+
} : {},
|
|
73920
|
+
style: darkTheme ? {
|
|
73921
|
+
...a11yDark,
|
|
73922
|
+
hljs: {
|
|
73923
|
+
display: "block",
|
|
73924
|
+
overflowX: "auto",
|
|
73925
|
+
background: "var(--border-default)",
|
|
73926
|
+
color: "#f8f8f2",
|
|
73927
|
+
padding: "0rem 0.5rem 1rem 0.5rem"
|
|
73928
|
+
}
|
|
73929
|
+
} : {
|
|
73930
|
+
...a11yLight,
|
|
73931
|
+
hljs: {
|
|
73932
|
+
display: "block",
|
|
73933
|
+
overflowX: "auto",
|
|
73934
|
+
background: "#fefefe",
|
|
73935
|
+
color: "#545454",
|
|
73936
|
+
padding: "0rem 0.5rem 1rem 0.5rem"
|
|
73937
|
+
}
|
|
73938
|
+
},
|
|
73939
|
+
children: codeValue
|
|
73917
73940
|
}
|
|
73918
|
-
|
|
73919
|
-
children:
|
|
73920
|
-
|
|
73921
|
-
|
|
73922
|
-
|
|
73923
|
-
|
|
73924
|
-
|
|
73925
|
-
|
|
73926
|
-
|
|
73927
|
-
|
|
73928
|
-
|
|
73929
|
-
|
|
73930
|
-
|
|
73931
|
-
|
|
73932
|
-
|
|
73933
|
-
] }) : /* @__PURE__ */ jsx("code", { ...rest, className: classNames(className), style: style2, children });
|
|
73941
|
+
),
|
|
73942
|
+
!showCopyOutside && enableCopy && /* @__PURE__ */ jsxs("span", { className: "absolute top-2 right-2 flex gap-1 items-center", ref: copyRef, children: [
|
|
73943
|
+
/* @__PURE__ */ jsx(CopyField, { rawValue: codeValue, btnClass: "mr-0", initialText: showCopyLabel ? "Copy" : "" }),
|
|
73944
|
+
codeFileName && /* @__PURE__ */ jsx(
|
|
73945
|
+
Button.Secondary,
|
|
73946
|
+
{
|
|
73947
|
+
icon: "download",
|
|
73948
|
+
iconClasses: "text-inherit",
|
|
73949
|
+
onClick: () => downloadTextFile(codeValue, codeFileName)
|
|
73950
|
+
}
|
|
73951
|
+
)
|
|
73952
|
+
] })
|
|
73953
|
+
]
|
|
73954
|
+
}
|
|
73955
|
+
) : /* @__PURE__ */ jsx(InlineCode, { ...rest, className: classNames(className), style: style2, children });
|
|
73934
73956
|
};
|
|
73935
73957
|
const PreComponent = ({ children }) => {
|
|
73936
73958
|
var _a, _b, _c;
|
|
@@ -73973,7 +73995,7 @@ const GetAnchorComponent = ({ customStyles }) => ({ children: linkChildren, node
|
|
|
73973
73995
|
rel: "noreferrer noopener",
|
|
73974
73996
|
className: "link docs-link underline font-medium leading-4",
|
|
73975
73997
|
children: [
|
|
73976
|
-
/* @__PURE__ */ jsx(IconProvider, { className: "mr-1
|
|
73998
|
+
/* @__PURE__ */ jsx(IconProvider, { className: "mr-1 text-icon-brand", icon: "circle-question" }),
|
|
73977
73999
|
linkChildren
|
|
73978
74000
|
]
|
|
73979
74001
|
}
|
|
@@ -74169,8 +74191,8 @@ const Input = React__default.forwardRef(
|
|
|
74169
74191
|
const fallbackId = useId();
|
|
74170
74192
|
const id = nativeProps.id || fallbackId;
|
|
74171
74193
|
const inputClasses = classNames(
|
|
74172
|
-
"input border-
|
|
74173
|
-
"
|
|
74194
|
+
"input border-border-default border w-full bg-background-surface-input focus:outline-hidden",
|
|
74195
|
+
"font-500 leading-4 font-lab p-3 placeholder:text-text-placeholder",
|
|
74174
74196
|
{
|
|
74175
74197
|
"hover:cursor-not-allowed": readOnly,
|
|
74176
74198
|
"field-error": validationError,
|
|
@@ -74205,15 +74227,15 @@ const Input = React__default.forwardRef(
|
|
|
74205
74227
|
"div",
|
|
74206
74228
|
{
|
|
74207
74229
|
className: classNames(
|
|
74208
|
-
"form-control text-
|
|
74230
|
+
"form-control text-text-primary",
|
|
74209
74231
|
wrapperClasses,
|
|
74210
|
-
|
|
74232
|
+
prefixSlot || suffixSlot ? "relative" : void 0
|
|
74211
74233
|
),
|
|
74212
74234
|
children: [
|
|
74213
74235
|
text2 && /* @__PURE__ */ jsxs(
|
|
74214
74236
|
"label",
|
|
74215
74237
|
{
|
|
74216
|
-
className: classNames("label font-weight-600
|
|
74238
|
+
className: classNames("label font-weight-600 text-text-secondary px-0", labelContainerClasses),
|
|
74217
74239
|
htmlFor: id,
|
|
74218
74240
|
children: [
|
|
74219
74241
|
text2 && /* @__PURE__ */ jsx("span", { className: "label-text " + labelClasses, children: text2 }),
|
|
@@ -74225,7 +74247,7 @@ const Input = React__default.forwardRef(
|
|
|
74225
74247
|
"span",
|
|
74226
74248
|
{
|
|
74227
74249
|
className: classNames(
|
|
74228
|
-
"absolute left-0 top-0 flex items-center px-2 text-
|
|
74250
|
+
"absolute left-0 top-0 flex items-center px-2 text-text-tertiary font-medium",
|
|
74229
74251
|
prefixSlotClassName
|
|
74230
74252
|
),
|
|
74231
74253
|
ref: prefixRef,
|
|
@@ -74241,7 +74263,7 @@ const Input = React__default.forwardRef(
|
|
|
74241
74263
|
...nativeProps.style,
|
|
74242
74264
|
paddingLeft: prefixSlot ? (_a = prefixRef.current) == null ? void 0 : _a.offsetWidth : (_b = nativeProps.style) == null ? void 0 : _b.paddingLeft,
|
|
74243
74265
|
paddingRight: suffixSlot ? (_c = suffixRef.current) == null ? void 0 : _c.offsetWidth : (_d = nativeProps.style) == null ? void 0 : _d.paddingRight,
|
|
74244
|
-
color:
|
|
74266
|
+
color: "var(--text-primary)"
|
|
74245
74267
|
},
|
|
74246
74268
|
ref: mergeRefs(inputRef, ref),
|
|
74247
74269
|
id,
|
|
@@ -74258,14 +74280,14 @@ const Input = React__default.forwardRef(
|
|
|
74258
74280
|
suffixSlot && /* @__PURE__ */ jsx(
|
|
74259
74281
|
"span",
|
|
74260
74282
|
{
|
|
74261
|
-
className: "absolute right-0 top-0 flex items-center px-2 text-
|
|
74283
|
+
className: "absolute right-0 top-0 flex items-center px-2 text-text-tertiary font-medium",
|
|
74262
74284
|
ref: suffixRef,
|
|
74263
74285
|
style: { height: (inputSize == null ? void 0 : inputSize.height) ?? "auto" },
|
|
74264
74286
|
children: suffixSlot
|
|
74265
74287
|
}
|
|
74266
74288
|
),
|
|
74267
74289
|
showErrorAsTooltip && validationError && /* @__PURE__ */ jsx(ErrorTooltip, { errMessage: validationError }),
|
|
74268
|
-
statusSlot && statusAlt && /* @__PURE__ */ jsx("label", { className: "label font-weight-600
|
|
74290
|
+
statusSlot && statusAlt && /* @__PURE__ */ jsx("label", { className: "label font-weight-600 text-text-secondary", htmlFor: id, children: /* @__PURE__ */ jsx("span", { className: "label-text-alt " + statusClasses, children: statusSlot }) }),
|
|
74269
74291
|
!hideErrorMessage && validationError && !showErrorAsTooltip && /* @__PURE__ */ jsxs("div", { className: classNames("w-full text-xs font-medium text-rose-600 mt-1 flex justify-end"), children: [
|
|
74270
74292
|
/* @__PURE__ */ jsx(IconProvider, { icon: "fa-warning", className: "px-1 pt-0.5 text-rose-500" }),
|
|
74271
74293
|
/* @__PURE__ */ jsx(Markdown, { children: validationError })
|
|
@@ -74283,4 +74305,4 @@ export {
|
|
|
74283
74305
|
CopyFieldHighlighted as b,
|
|
74284
74306
|
Markdown$1 as c
|
|
74285
74307
|
};
|
|
74286
|
-
//# sourceMappingURL=Input-
|
|
74308
|
+
//# sourceMappingURL=Input-Dhmo6L2n.js.map
|