@yahoo/uds 3.123.0 → 3.124.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/client/AnimateHeightChange.cjs +1 -1
- package/dist/components/client/AnimateHeightChange.d.ts +1 -0
- package/dist/components/client/AnimateHeightChange.js +1 -1
- package/dist/components/client/Avatar/Avatar.cjs +1 -1
- package/dist/components/client/Avatar/Avatar.d.ts +1 -0
- package/dist/components/client/Avatar/Avatar.js +1 -1
- package/dist/components/client/Avatar/AvatarIcon.cjs +1 -1
- package/dist/components/client/Avatar/AvatarIcon.d.ts +1 -0
- package/dist/components/client/Avatar/AvatarIcon.js +1 -1
- package/dist/components/client/Avatar/AvatarImage.cjs +1 -1
- package/dist/components/client/Avatar/AvatarImage.d.ts +1 -0
- package/dist/components/client/Avatar/AvatarImage.js +1 -1
- package/dist/components/client/Avatar/AvatarText.cjs +1 -1
- package/dist/components/client/Avatar/AvatarText.d.ts +1 -0
- package/dist/components/client/Avatar/AvatarText.js +1 -1
- package/dist/components/client/Avatar/index.cjs +1 -1
- package/dist/components/client/Avatar/index.d.ts +1 -0
- package/dist/components/client/Avatar/index.js +1 -1
- package/dist/components/client/Avatar/utils.cjs +1 -1
- package/dist/components/client/Avatar/utils.d.ts +1 -0
- package/dist/components/client/Avatar/utils.js +1 -1
- package/dist/components/client/Badge.cjs +1 -1
- package/dist/components/client/Badge.d.ts +1 -0
- package/dist/components/client/Badge.js +1 -1
- package/dist/components/client/BottomSheet/BottomSheet.cjs +1 -1
- package/dist/components/client/BottomSheet/BottomSheet.d.ts +1 -0
- package/dist/components/client/BottomSheet/BottomSheet.js +1 -1
- package/dist/components/client/BottomSheet/BottomSheetContent.cjs +1 -1
- package/dist/components/client/BottomSheet/BottomSheetContent.d.ts +1 -0
- package/dist/components/client/BottomSheet/BottomSheetContent.js +1 -1
- package/dist/components/client/BottomSheet/BottomSheetDismiss.cjs +1 -1
- package/dist/components/client/BottomSheet/BottomSheetDismiss.d.ts +1 -0
- package/dist/components/client/BottomSheet/BottomSheetDismiss.js +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHandle.cjs +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHandle.d.ts +1 -0
- package/dist/components/client/BottomSheet/BottomSheetHandle.js +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHeader.cjs +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHeader.d.ts +1 -0
- package/dist/components/client/BottomSheet/BottomSheetHeader.js +1 -1
- package/dist/components/client/BottomSheet/BottomSheetInternalContext.cjs +1 -1
- package/dist/components/client/BottomSheet/BottomSheetInternalContext.d.ts +1 -0
- package/dist/components/client/BottomSheet/BottomSheetInternalContext.js +1 -1
- package/dist/components/client/BottomSheet/BottomSheetProvider.cjs +1 -1
- package/dist/components/client/BottomSheet/BottomSheetProvider.d.ts +1 -0
- package/dist/components/client/BottomSheet/BottomSheetProvider.js +1 -1
- package/dist/components/client/BottomSheet/BottomSheetTrigger.cjs +1 -1
- package/dist/components/client/BottomSheet/BottomSheetTrigger.d.ts +1 -0
- package/dist/components/client/BottomSheet/BottomSheetTrigger.js +1 -1
- package/dist/components/client/BottomSheet/UDSBottomSheetConfigProvider.cjs +1 -1
- package/dist/components/client/BottomSheet/UDSBottomSheetConfigProvider.d.ts +1 -0
- package/dist/components/client/BottomSheet/UDSBottomSheetConfigProvider.js +1 -1
- package/dist/components/client/BottomSheet/index.cjs +1 -1
- package/dist/components/client/BottomSheet/index.d.ts +1 -0
- package/dist/components/client/BottomSheet/index.js +1 -1
- package/dist/components/client/BottomSheet/useBottomSheetDrag.cjs +1 -1
- package/dist/components/client/BottomSheet/useBottomSheetDrag.d.ts +1 -0
- package/dist/components/client/BottomSheet/useBottomSheetDrag.js +1 -1
- package/dist/components/client/BottomSheet/useBottomSheetSnapModel.cjs +1 -1
- package/dist/components/client/BottomSheet/useBottomSheetSnapModel.d.ts +1 -0
- package/dist/components/client/BottomSheet/useBottomSheetSnapModel.js +1 -1
- package/dist/components/client/BottomSheet/useBottomSheetStore.cjs +1 -1
- package/dist/components/client/BottomSheet/useBottomSheetStore.d.ts +1 -0
- package/dist/components/client/BottomSheet/useBottomSheetStore.js +1 -1
- package/dist/components/client/BottomSheet/useBottomSheetStoreInternal.cjs +1 -1
- package/dist/components/client/BottomSheet/useBottomSheetStoreInternal.d.ts +1 -0
- package/dist/components/client/BottomSheet/useBottomSheetStoreInternal.js +1 -1
- package/dist/components/client/BottomSheet/useExpansionMargins.cjs +1 -1
- package/dist/components/client/BottomSheet/useExpansionMargins.d.ts +1 -0
- package/dist/components/client/BottomSheet/useExpansionMargins.js +1 -1
- package/dist/components/client/BottomSheet/useViewportHeight.cjs +1 -1
- package/dist/components/client/BottomSheet/useViewportHeight.d.ts +1 -0
- package/dist/components/client/BottomSheet/useViewportHeight.js +1 -1
- package/dist/components/client/BottomSheet/useVirtualKeyboard.cjs +1 -1
- package/dist/components/client/BottomSheet/useVirtualKeyboard.d.ts +1 -0
- package/dist/components/client/BottomSheet/useVirtualKeyboard.js +1 -1
- package/dist/components/client/BottomSheet/utils.cjs +1 -1
- package/dist/components/client/BottomSheet/utils.d.ts +1 -0
- package/dist/components/client/BottomSheet/utils.js +1 -1
- package/dist/components/client/Button.cjs +1 -1
- package/dist/components/client/Button.d.ts +1 -0
- package/dist/components/client/Button.js +1 -1
- package/dist/components/client/Checkbox.cjs +1 -1
- package/dist/components/client/Checkbox.d.ts +1 -0
- package/dist/components/client/Checkbox.js +1 -1
- package/dist/components/client/Chip/Chip.cjs +1 -1
- package/dist/components/client/Chip/Chip.d.ts +1 -0
- package/dist/components/client/Chip/Chip.js +1 -1
- package/dist/components/client/Chip/ChipBase.cjs +1 -1
- package/dist/components/client/Chip/ChipBase.d.ts +1 -0
- package/dist/components/client/Chip/ChipBase.js +1 -1
- package/dist/components/client/Chip/ChipButton.cjs +1 -1
- package/dist/components/client/Chip/ChipButton.d.ts +1 -0
- package/dist/components/client/Chip/ChipButton.js +1 -1
- package/dist/components/client/Chip/ChipDismissible.cjs +1 -1
- package/dist/components/client/Chip/ChipDismissible.d.ts +1 -0
- package/dist/components/client/Chip/ChipDismissible.js +1 -1
- package/dist/components/client/Chip/ChipLink.cjs +1 -1
- package/dist/components/client/Chip/ChipLink.d.ts +1 -0
- package/dist/components/client/Chip/ChipLink.js +1 -1
- package/dist/components/client/Chip/ChipToggle.cjs +1 -1
- package/dist/components/client/Chip/ChipToggle.d.ts +1 -0
- package/dist/components/client/Chip/ChipToggle.js +1 -1
- package/dist/components/client/Chip/index.cjs +1 -1
- package/dist/components/client/Chip/index.d.ts +1 -0
- package/dist/components/client/Chip/index.js +1 -1
- package/dist/components/client/IconButton.cjs +1 -1
- package/dist/components/client/IconButton.d.ts +1 -0
- package/dist/components/client/IconButton.js +1 -1
- package/dist/components/client/Input/Input.cjs +1 -1
- package/dist/components/client/Input/Input.d.ts +1 -0
- package/dist/components/client/Input/Input.js +1 -1
- package/dist/components/client/Input/InputHelpText.cjs +1 -1
- package/dist/components/client/Input/InputHelpText.d.ts +1 -0
- package/dist/components/client/Input/InputHelpText.js +1 -1
- package/dist/components/client/Input/InputHelpTextInternal.cjs +1 -1
- package/dist/components/client/Input/InputHelpTextInternal.d.ts +1 -0
- package/dist/components/client/Input/InputHelpTextInternal.js +1 -1
- package/dist/components/client/Input/index.cjs +1 -1
- package/dist/components/client/Input/index.d.ts +1 -0
- package/dist/components/client/Input/index.js +1 -1
- package/dist/components/client/Menu/Menu.Content.cjs +1 -1
- package/dist/components/client/Menu/Menu.Content.d.ts +1 -0
- package/dist/components/client/Menu/Menu.Content.js +1 -1
- package/dist/components/client/Menu/Menu.Divider.cjs +1 -1
- package/dist/components/client/Menu/Menu.Divider.d.ts +1 -0
- package/dist/components/client/Menu/Menu.Divider.js +1 -1
- package/dist/components/client/Menu/Menu.Item.cjs +1 -1
- package/dist/components/client/Menu/Menu.Item.d.ts +1 -0
- package/dist/components/client/Menu/Menu.Item.js +1 -1
- package/dist/components/client/Menu/Menu.ItemBase.cjs +1 -1
- package/dist/components/client/Menu/Menu.ItemBase.d.ts +1 -0
- package/dist/components/client/Menu/Menu.ItemBase.js +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.cjs +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.cts +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +2 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.js +1 -1
- package/dist/components/client/Menu/Menu.Provider.cjs +1 -1
- package/dist/components/client/Menu/Menu.Provider.d.ts +1 -0
- package/dist/components/client/Menu/Menu.Provider.js +1 -1
- package/dist/components/client/Menu/Menu.Trigger.cjs +1 -1
- package/dist/components/client/Menu/Menu.Trigger.d.ts +1 -0
- package/dist/components/client/Menu/Menu.Trigger.js +1 -1
- package/dist/components/client/Menu/Menu.cjs +1 -1
- package/dist/components/client/Menu/Menu.d.ts +1 -0
- package/dist/components/client/Menu/Menu.index.cjs +1 -1
- package/dist/components/client/Menu/Menu.index.d.ts +1 -0
- package/dist/components/client/Menu/Menu.index.js +1 -1
- package/dist/components/client/Menu/Menu.js +1 -1
- package/dist/components/client/Menu/index.cjs +1 -1
- package/dist/components/client/Menu/index.d.ts +1 -0
- package/dist/components/client/Menu/index.js +1 -1
- package/dist/components/client/Menu/utils/transformAriakitPlacement.cjs +1 -1
- package/dist/components/client/Menu/utils/transformAriakitPlacement.d.ts +1 -0
- package/dist/components/client/Menu/utils/transformAriakitPlacement.js +1 -1
- package/dist/components/client/Popover/Popover.cjs +1 -1
- package/dist/components/client/Popover/Popover.d.ts +1 -0
- package/dist/components/client/Popover/Popover.js +1 -1
- package/dist/components/client/Popover/PopoverContent.cjs +1 -1
- package/dist/components/client/Popover/PopoverContent.d.ts +1 -0
- package/dist/components/client/Popover/PopoverContent.js +1 -1
- package/dist/components/client/Popover/PopoverContext.cjs +1 -1
- package/dist/components/client/Popover/PopoverContext.d.ts +1 -0
- package/dist/components/client/Popover/PopoverContext.js +1 -1
- package/dist/components/client/Popover/PopoverTrigger.cjs +1 -1
- package/dist/components/client/Popover/PopoverTrigger.d.ts +1 -0
- package/dist/components/client/Popover/PopoverTrigger.js +1 -1
- package/dist/components/client/Popover/UDSPopoverConfigProvider.cjs +1 -1
- package/dist/components/client/Popover/UDSPopoverConfigProvider.d.cts +1 -1
- package/dist/components/client/Popover/UDSPopoverConfigProvider.d.ts +2 -1
- package/dist/components/client/Popover/UDSPopoverConfigProvider.js +1 -1
- package/dist/components/client/Popover/index.cjs +1 -1
- package/dist/components/client/Popover/index.d.ts +1 -0
- package/dist/components/client/Popover/index.js +1 -1
- package/dist/components/client/Pressable.cjs +1 -1
- package/dist/components/client/Pressable.d.ts +1 -0
- package/dist/components/client/Pressable.js +1 -1
- package/dist/components/client/Radio/Radio.cjs +1 -1
- package/dist/components/client/Radio/Radio.d.ts +1 -0
- package/dist/components/client/Radio/Radio.js +1 -1
- package/dist/components/client/Radio/RadioGroupProvider.cjs +1 -1
- package/dist/components/client/Radio/RadioGroupProvider.d.ts +1 -0
- package/dist/components/client/Radio/RadioGroupProvider.js +1 -1
- package/dist/components/client/Radio/RadioGroupStore.cjs +1 -1
- package/dist/components/client/Radio/RadioGroupStore.d.ts +1 -0
- package/dist/components/client/Radio/RadioGroupStore.js +1 -1
- package/dist/components/client/Radio/index.cjs +1 -1
- package/dist/components/client/Radio/index.d.ts +1 -0
- package/dist/components/client/Radio/index.js +1 -1
- package/dist/components/client/Radio/useRadioGroup.cjs +1 -1
- package/dist/components/client/Radio/useRadioGroup.d.ts +1 -0
- package/dist/components/client/Radio/useRadioGroup.js +1 -1
- package/dist/components/client/SpringMotionConfig.cjs +1 -1
- package/dist/components/client/SpringMotionConfig.d.ts +1 -0
- package/dist/components/client/SpringMotionConfig.js +1 -1
- package/dist/components/client/Switch.cjs +1 -1
- package/dist/components/client/Switch.d.ts +1 -0
- package/dist/components/client/Switch.js +1 -1
- package/dist/components/client/Toast/Toast.cjs +1 -1
- package/dist/components/client/Toast/Toast.d.ts +1 -0
- package/dist/components/client/Toast/Toast.js +1 -1
- package/dist/components/client/Toast/ToastContainer.cjs +1 -1
- package/dist/components/client/Toast/ToastContainer.d.ts +1 -0
- package/dist/components/client/Toast/ToastContainer.js +1 -1
- package/dist/components/client/Toast/ToastPortal.cjs +1 -1
- package/dist/components/client/Toast/ToastPortal.d.ts +1 -0
- package/dist/components/client/Toast/ToastPortal.js +1 -1
- package/dist/components/client/Toast/UDSToastConfigProvider.cjs +1 -1
- package/dist/components/client/Toast/UDSToastConfigProvider.d.cts +5 -5
- package/dist/components/client/Toast/UDSToastConfigProvider.d.ts +6 -5
- package/dist/components/client/Toast/UDSToastConfigProvider.js +1 -1
- package/dist/components/client/Toast/createToast.cjs +1 -1
- package/dist/components/client/Toast/createToast.d.ts +1 -0
- package/dist/components/client/Toast/createToast.js +1 -1
- package/dist/components/client/Toast/index.cjs +1 -1
- package/dist/components/client/Toast/index.d.ts +1 -0
- package/dist/components/client/Toast/index.js +1 -1
- package/dist/components/client/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/client/Tooltip/Tooltip.d.ts +1 -0
- package/dist/components/client/Tooltip/Tooltip.js +1 -1
- package/dist/components/client/Tooltip/TooltipContent.cjs +1 -1
- package/dist/components/client/Tooltip/TooltipContent.d.ts +1 -0
- package/dist/components/client/Tooltip/TooltipContent.js +1 -1
- package/dist/components/client/Tooltip/TooltipTrigger.cjs +1 -1
- package/dist/components/client/Tooltip/TooltipTrigger.d.ts +1 -0
- package/dist/components/client/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/client/Tooltip/UDSTooltipConfigProvider.cjs +1 -1
- package/dist/components/client/Tooltip/UDSTooltipConfigProvider.d.ts +1 -0
- package/dist/components/client/Tooltip/UDSTooltipConfigProvider.js +1 -1
- package/dist/components/client/Tooltip/index.cjs +1 -1
- package/dist/components/client/Tooltip/index.d.ts +1 -0
- package/dist/components/client/Tooltip/index.js +1 -1
- package/dist/components/client/Tooltip/tooltipContext.cjs +1 -1
- package/dist/components/client/Tooltip/tooltipContext.d.ts +1 -0
- package/dist/components/client/Tooltip/tooltipContext.js +1 -1
- package/dist/components/client/buttonConstants.cjs +1 -1
- package/dist/components/client/buttonConstants.d.ts +1 -0
- package/dist/components/client/buttonConstants.js +1 -1
- package/dist/components/client/index.cjs +1 -1
- package/dist/components/client/index.d.ts +1 -0
- package/dist/components/client/index.js +1 -1
- package/dist/components/client/motionFeatures/domAnimation.cjs +1 -1
- package/dist/components/client/motionFeatures/domAnimation.d.ts +1 -0
- package/dist/components/client/motionFeatures/domAnimation.js +1 -1
- package/dist/components/client/motionFeatures/domMax.cjs +1 -1
- package/dist/components/client/motionFeatures/domMax.d.ts +1 -0
- package/dist/components/client/motionFeatures/domMax.js +1 -1
- package/dist/components/client/providers/UDSBreakpointsConfigProvider.cjs +1 -1
- package/dist/components/client/providers/UDSBreakpointsConfigProvider.d.ts +1 -0
- package/dist/components/client/providers/UDSBreakpointsConfigProvider.js +1 -1
- package/dist/components/client/providers/UDSConfigProvider.cjs +1 -1
- package/dist/components/client/providers/UDSConfigProvider.d.ts +1 -0
- package/dist/components/client/providers/UDSConfigProvider.js +1 -1
- package/dist/components/experimental/client/Accordion.cjs +1 -1
- package/dist/components/experimental/client/Accordion.d.ts +1 -0
- package/dist/components/experimental/client/Accordion.js +1 -1
- package/dist/components/experimental/client/AvoidMotionLibraryProvider.cjs +1 -1
- package/dist/components/experimental/client/AvoidMotionLibraryProvider.d.ts +1 -0
- package/dist/components/experimental/client/AvoidMotionLibraryProvider.js +1 -1
- package/dist/components/experimental/client/Modal.cjs +1 -1
- package/dist/components/experimental/client/Modal.d.ts +1 -0
- package/dist/components/experimental/client/Modal.js +1 -1
- package/dist/components/experimental/client/SegmentedControl.cjs +1 -1
- package/dist/components/experimental/client/SegmentedControl.d.ts +1 -0
- package/dist/components/experimental/client/SegmentedControl.js +1 -1
- package/dist/components/experimental/client/SwitchV2.cjs +1 -1
- package/dist/components/experimental/client/SwitchV2.d.ts +1 -0
- package/dist/components/experimental/client/SwitchV2.js +1 -1
- package/dist/components/experimental/client/Tabs.cjs +1 -1
- package/dist/components/experimental/client/Tabs.d.ts +1 -0
- package/dist/components/experimental/client/Tabs.js +1 -1
- package/dist/components/experimental/client/index.cjs +1 -1
- package/dist/components/experimental/client/index.d.ts +1 -0
- package/dist/components/experimental/client/index.js +1 -1
- package/dist/styles/styler.d.cts +32 -32
- package/dist/styles/styler.d.ts +32 -32
- package/dist/tailwind/dist/commands/css.cjs +17 -3
- package/dist/tailwind/dist/commands/css.d.cts.map +1 -1
- package/dist/tailwind/dist/commands/css.d.ts.map +1 -1
- package/dist/tailwind/dist/commands/css.helpers.cjs +2 -1
- package/dist/tailwind/dist/commands/css.helpers.js +2 -1
- package/dist/tailwind/dist/commands/css.helpers.js.map +1 -1
- package/dist/tailwind/dist/commands/css.js +17 -3
- package/dist/tailwind/dist/commands/css.js.map +1 -1
- package/dist/tailwind/dist/css/generate.cjs +3 -0
- package/dist/tailwind/dist/css/generate.helpers.cjs +14 -6
- package/dist/tailwind/dist/css/generate.helpers.js +15 -7
- package/dist/tailwind/dist/css/generate.helpers.js.map +1 -1
- package/dist/tailwind/dist/css/generate.js +3 -0
- package/dist/tailwind/dist/css/generate.js.map +1 -1
- package/dist/tailwind/dist/css/nodeUtils.cjs +91 -20
- package/dist/tailwind/dist/css/nodeUtils.js +90 -21
- package/dist/tailwind/dist/css/nodeUtils.js.map +1 -1
- package/dist/tailwind/dist/css/postcss.cjs +22 -1
- package/dist/tailwind/dist/css/postcss.helpers.cjs +12 -1
- package/dist/tailwind/dist/css/postcss.helpers.js +11 -1
- package/dist/tailwind/dist/css/postcss.helpers.js.map +1 -1
- package/dist/tailwind/dist/css/postcss.js +22 -2
- package/dist/tailwind/dist/css/postcss.js.map +1 -1
- package/dist/tailwind/dist/css/runner.cjs +171 -20
- package/dist/tailwind/dist/css/runner.helpers.cjs +58 -6
- package/dist/tailwind/dist/css/runner.helpers.js +54 -7
- package/dist/tailwind/dist/css/runner.helpers.js.map +1 -1
- package/dist/tailwind/dist/css/runner.js +172 -20
- package/dist/tailwind/dist/css/runner.js.map +1 -1
- package/dist/tailwind/dist/css/theme.d.cts +11 -0
- package/dist/tailwind/dist/css/theme.d.cts.map +1 -1
- package/dist/tailwind/dist/css/theme.d.ts +11 -0
- package/dist/tailwind/dist/css/theme.d.ts.map +1 -1
- package/dist/tailwind/dist/css/theme.js.map +1 -1
- package/dist/tailwind/dist/purger/optimized/ast/expressions.cjs +26 -3
- package/dist/tailwind/dist/purger/optimized/ast/expressions.js +26 -3
- package/dist/tailwind/dist/purger/optimized/ast/expressions.js.map +1 -1
- package/dist/tailwind/dist/tailwind/utils/getFontStyles.d.cts +1 -1
- package/dist/tailwind/dist/tailwind/utils/getFontStyles.d.ts +1 -1
- package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.cts +4 -4
- package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.ts +4 -4
- package/dist/uds/generated/componentData.cjs +1202 -1202
- package/dist/uds/generated/componentData.js +1202 -1202
- package/generated/componentData.json +1610 -1610
- package/package.json +1 -1
|
@@ -9,6 +9,25 @@ const importedSourceFileCache = /* @__PURE__ */ new Map();
|
|
|
9
9
|
const tsConfigPathCache = /* @__PURE__ */ new Map();
|
|
10
10
|
const compilerOptionsCache = /* @__PURE__ */ new Map();
|
|
11
11
|
const hasImportQuery = (moduleSpecifier) => moduleSpecifier.includes("?");
|
|
12
|
+
const getLocalDefinitionNodes = (node) => {
|
|
13
|
+
if (!Node.isIdentifier(node)) return [];
|
|
14
|
+
const name = node.getText();
|
|
15
|
+
const nodeStart = node.getStart();
|
|
16
|
+
const sourceFile = node.getSourceFile();
|
|
17
|
+
return [
|
|
18
|
+
...sourceFile.getDescendantsOfKind(SyntaxKind.VariableDeclaration).filter((definition) => definition.getName() === name && definition.getStart() <= nodeStart),
|
|
19
|
+
...sourceFile.getDescendantsOfKind(SyntaxKind.Parameter).filter((definition) => definition.getName() === name && definition.getStart() <= nodeStart),
|
|
20
|
+
...sourceFile.getDescendantsOfKind(SyntaxKind.BindingElement).filter((definition) => definition.getName() === name && definition.getStart() <= nodeStart),
|
|
21
|
+
...sourceFile.getFunctions().filter((definition) => definition.getName() === name && definition.getStart() <= nodeStart)
|
|
22
|
+
].sort((left, right) => right.getStart() - left.getStart()).slice(0, 1);
|
|
23
|
+
};
|
|
24
|
+
const getDefinitionNodesSafe = (node) => {
|
|
25
|
+
try {
|
|
26
|
+
return node.getDefinitionNodes();
|
|
27
|
+
} catch {
|
|
28
|
+
return getLocalDefinitionNodes(node);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
12
31
|
const isExistingFile = (candidate) => fs.existsSync(candidate) && fs.statSync(candidate).isFile();
|
|
13
32
|
const resolveRelativeImportPath = (sourceFilePath, moduleSpecifier) => {
|
|
14
33
|
if (!path.isAbsolute(sourceFilePath) || !moduleSpecifier.startsWith(".") || hasImportQuery(moduleSpecifier)) return null;
|
|
@@ -17,10 +36,14 @@ const resolveRelativeImportPath = (sourceFilePath, moduleSpecifier) => {
|
|
|
17
36
|
basePath,
|
|
18
37
|
`${basePath}.ts`,
|
|
19
38
|
`${basePath}.tsx`,
|
|
39
|
+
`${basePath}.mjs`,
|
|
40
|
+
`${basePath}.cjs`,
|
|
20
41
|
`${basePath}.js`,
|
|
21
42
|
`${basePath}.jsx`,
|
|
22
43
|
path.join(basePath, "index.ts"),
|
|
23
44
|
path.join(basePath, "index.tsx"),
|
|
45
|
+
path.join(basePath, "index.mjs"),
|
|
46
|
+
path.join(basePath, "index.cjs"),
|
|
24
47
|
path.join(basePath, "index.js"),
|
|
25
48
|
path.join(basePath, "index.jsx")
|
|
26
49
|
].find((candidate) => isExistingFile(candidate)) ?? null;
|
|
@@ -181,7 +204,7 @@ const extractElementAccessValues = (node) => {
|
|
|
181
204
|
const extractCallExpressionValues = (node, visited) => {
|
|
182
205
|
if (!Node.isCallExpression(node)) return null;
|
|
183
206
|
const expression = node.getExpression();
|
|
184
|
-
const fromDefinitions = Node.isIdentifier(expression) ? expression
|
|
207
|
+
const fromDefinitions = Node.isIdentifier(expression) ? getDefinitionNodesSafe(expression).flatMap((definition) => {
|
|
185
208
|
if (Node.isFunctionDeclaration(definition)) return definition.getDescendantsOfKind(SyntaxKind.ReturnStatement).flatMap((returnStmt) => {
|
|
186
209
|
const expression = returnStmt.getExpression();
|
|
187
210
|
return expression ? extractStringLiterals(expression, visited) : [];
|
|
@@ -197,7 +220,7 @@ const extractCallExpressionValues = (node, visited) => {
|
|
|
197
220
|
};
|
|
198
221
|
const extractIdentifierValues = (node, visited) => {
|
|
199
222
|
if (!Node.isIdentifier(node)) return null;
|
|
200
|
-
const values = node
|
|
223
|
+
const values = getDefinitionNodesSafe(node).flatMap((definition) => {
|
|
201
224
|
if (Node.isVariableDeclaration(definition) || Node.isParameterDeclaration(definition) || Node.isBindingElement(definition)) {
|
|
202
225
|
const initializer = definition.getInitializer();
|
|
203
226
|
return initializer ? extractStringLiterals(initializer, visited) : [];
|
|
@@ -252,7 +275,7 @@ const extractObjectValues = (node, visited) => {
|
|
|
252
275
|
return values;
|
|
253
276
|
}
|
|
254
277
|
if (Node.isIdentifier(node)) {
|
|
255
|
-
node
|
|
278
|
+
getDefinitionNodesSafe(node).forEach((definition) => {
|
|
256
279
|
if (Node.isVariableDeclaration(definition)) {
|
|
257
280
|
const initializer = definition.getInitializer();
|
|
258
281
|
if (initializer) if (Node.isAsExpression(initializer)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expressions.js","names":[],"sources":["../../../../src/purger/optimized/ast/expressions.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport { Node, Project, SyntaxKind, ts } from 'ts-morph';\n\nconst importedSourceProject = new Project({ useInMemoryFileSystem: true });\nconst importedSourceFileCache = new Map<string, ReturnType<Project['createSourceFile']>>();\nconst tsConfigPathCache = new Map<string, string | null>();\nconst compilerOptionsCache = new Map<string, ts.CompilerOptions | null>();\nconst hasImportQuery = (moduleSpecifier: string): boolean => moduleSpecifier.includes('?');\n\nconst isExistingFile = (candidate: string): boolean =>\n fs.existsSync(candidate) && fs.statSync(candidate).isFile();\n\nconst resolveRelativeImportPath = (\n sourceFilePath: string,\n moduleSpecifier: string,\n): string | null => {\n if (\n !path.isAbsolute(sourceFilePath) ||\n !moduleSpecifier.startsWith('.') ||\n hasImportQuery(moduleSpecifier)\n ) {\n return null;\n }\n\n const basePath = path.resolve(path.dirname(sourceFilePath), moduleSpecifier);\n const candidates = [\n basePath,\n `${basePath}.ts`,\n `${basePath}.tsx`,\n `${basePath}.js`,\n `${basePath}.jsx`,\n path.join(basePath, 'index.ts'),\n path.join(basePath, 'index.tsx'),\n path.join(basePath, 'index.js'),\n path.join(basePath, 'index.jsx'),\n ];\n\n return candidates.find((candidate) => isExistingFile(candidate)) ?? null;\n};\n\nconst findNearestTypeScriptConfig = (sourceFilePath: string): string | null => {\n const sourceDir = path.dirname(sourceFilePath);\n const cached = tsConfigPathCache.get(sourceDir);\n\n if (cached !== undefined) {\n return cached;\n }\n\n let currentDir = sourceDir;\n\n while (true) {\n const tsConfigPath = path.join(currentDir, 'tsconfig.json');\n if (isExistingFile(tsConfigPath)) {\n tsConfigPathCache.set(sourceDir, tsConfigPath);\n return tsConfigPath;\n }\n\n const jsConfigPath = path.join(currentDir, 'jsconfig.json');\n if (isExistingFile(jsConfigPath)) {\n tsConfigPathCache.set(sourceDir, jsConfigPath);\n return jsConfigPath;\n }\n\n const parentDir = path.dirname(currentDir);\n if (parentDir === currentDir) {\n tsConfigPathCache.set(sourceDir, null);\n return null;\n }\n\n currentDir = parentDir;\n }\n};\n\nconst getCompilerOptionsForSourceFile = (sourceFilePath: string): ts.CompilerOptions | null => {\n const configPath = findNearestTypeScriptConfig(sourceFilePath);\n if (!configPath) {\n return null;\n }\n\n const cached = compilerOptionsCache.get(configPath);\n if (cached !== undefined) {\n return cached;\n }\n\n const readResult = ts.readConfigFile(configPath, ts.sys.readFile);\n if (readResult.error) {\n compilerOptionsCache.set(configPath, null);\n return null;\n }\n\n const parsed = ts.parseJsonConfigFileContent(readResult.config, ts.sys, path.dirname(configPath));\n\n const compilerOptions =\n parsed.options.paths && !parsed.options.baseUrl\n ? { ...parsed.options, baseUrl: path.dirname(configPath) }\n : parsed.options;\n\n compilerOptionsCache.set(configPath, compilerOptions);\n return compilerOptions;\n};\n\nconst resolveConfigImportPath = (\n sourceFilePath: string,\n moduleSpecifier: string,\n): string | null => {\n if (hasImportQuery(moduleSpecifier)) {\n return null;\n }\n\n const compilerOptions = getCompilerOptionsForSourceFile(sourceFilePath);\n if (!compilerOptions) {\n return null;\n }\n\n const resolvedModule = ts.resolveModuleName(\n moduleSpecifier,\n sourceFilePath,\n compilerOptions,\n ts.sys,\n ).resolvedModule;\n\n if (!resolvedModule) {\n return null;\n }\n\n return isExistingFile(resolvedModule.resolvedFileName) ? resolvedModule.resolvedFileName : null;\n};\n\nconst resolveImportPath = (sourceFilePath: string, moduleSpecifier: string): string | null =>\n moduleSpecifier.startsWith('.')\n ? resolveRelativeImportPath(sourceFilePath, moduleSpecifier)\n : resolveConfigImportPath(sourceFilePath, moduleSpecifier);\n\nconst getImportedSourceFile = (filePath: string) => {\n const cached = importedSourceFileCache.get(filePath);\n if (cached) {\n return cached;\n }\n\n if (!fs.existsSync(filePath)) {\n return null;\n }\n\n const sourceFile = importedSourceProject.createSourceFile(\n filePath,\n fs.readFileSync(filePath, 'utf-8'),\n {\n overwrite: true,\n },\n );\n importedSourceFileCache.set(filePath, sourceFile);\n return sourceFile;\n};\n\nconst extractImportedIdentifierValues = (node: Node, visited: Set<Node>): string[] => {\n if (!Node.isIdentifier(node)) {\n return [];\n }\n\n const sourceFile = node.getSourceFile();\n const sourceFilePath = sourceFile.getFilePath();\n const importMatch = sourceFile\n .getImportDeclarations()\n .find((importDecl) =>\n importDecl\n .getNamedImports()\n .some(\n (namedImport) =>\n (namedImport.getAliasNode()?.getText() ?? namedImport.getName()) === node.getText(),\n ),\n );\n\n if (!importMatch) {\n return [];\n }\n\n const namedImport = importMatch\n .getNamedImports()\n .find(\n (candidate) =>\n (candidate.getAliasNode()?.getText() ?? candidate.getName()) === node.getText(),\n );\n\n if (!namedImport) {\n return [];\n }\n\n const resolvedPath = resolveImportPath(sourceFilePath, importMatch.getModuleSpecifierValue());\n if (!resolvedPath) {\n return [];\n }\n\n const importedSourceFile = getImportedSourceFile(resolvedPath);\n if (!importedSourceFile) {\n return [];\n }\n\n const declaration = importedSourceFile.getVariableDeclaration(namedImport.getName());\n const initializer = declaration?.getInitializer();\n return initializer ? extractStringLiterals(initializer, visited) : [];\n};\n\n/**\n * Extracts string literal values from an expression.\n *\n * Handles:\n * - Direct string literals: 'value'\n * - Ternary expressions: condition ? 'a' : 'b' -> ['a', 'b']\n * - Variable references: traces back to initializer\n * - Logical expressions: a || 'fallback', a ?? 'default'\n * - Function calls: traces to return statements\n * - Template literals: `value`\n * - As expressions: value as Type\n *\n * @param node The expression node to extract values from\n * @param visited Set of visited nodes to prevent infinite recursion\n * @returns Array of extracted string literal values\n */\nconst extractStringLiterals = (node: Node, visited: Set<Node> = new Set()): string[] => {\n if (visited.has(node)) {\n return [];\n }\n visited.add(node);\n\n const directValues = extractDirectLiteralValues(node);\n if (directValues) {\n return directValues;\n }\n\n const templateValues = extractTemplateExpressionValues(node, visited);\n if (templateValues) {\n return templateValues;\n }\n\n // Ternary/conditional expression: condition ? 'a' : 'b'\n if (Node.isConditionalExpression(node)) {\n return [\n ...extractStringLiterals(node.getWhenTrue(), visited),\n ...extractStringLiterals(node.getWhenFalse(), visited),\n ];\n }\n\n const binaryValues = extractBinaryExpressionValues(node, visited);\n if (binaryValues) {\n return binaryValues;\n }\n\n const wrappedExpressionValues = extractWrappedExpressionValues(node, visited);\n if (wrappedExpressionValues) {\n return wrappedExpressionValues;\n }\n\n const propertyAccessValues = extractPropertyAccessValues(node, visited);\n if (propertyAccessValues) {\n return propertyAccessValues;\n }\n\n const elementAccessValues = extractElementAccessValues(node);\n if (elementAccessValues) {\n return elementAccessValues;\n }\n\n const callExpressionValues = extractCallExpressionValues(node, visited);\n if (callExpressionValues) {\n return callExpressionValues;\n }\n\n const identifierValues = extractIdentifierValues(node, visited);\n if (identifierValues) {\n return identifierValues;\n }\n\n return [];\n};\n\nconst extractDirectLiteralValues = (node: Node): string[] | null => {\n if (Node.isStringLiteral(node) || Node.isNoSubstitutionTemplateLiteral(node)) {\n return [node.getLiteralValue()];\n }\n\n return null;\n};\n\nconst extractTemplateExpressionValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (!Node.isTemplateExpression(node)) {\n return null;\n }\n\n const parts: string[][] = [[node.getHead().getLiteralText()]];\n\n node.getTemplateSpans().forEach((span) => {\n const exprValues = extractStringLiterals(span.getExpression(), visited);\n const literalText = span.getLiteral().getLiteralText();\n parts.push(\n exprValues.length > 0\n ? exprValues.map((value) => `${value}${literalText}`)\n : ['', literalText],\n );\n });\n\n return parts\n .reduce<\n string[]\n >((acc, segment) => acc.flatMap((base) => segment.map((frag) => `${base}${frag}`)), [''])\n .filter((value) => value.length > 0);\n};\n\nconst extractBinaryExpressionValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (!Node.isBinaryExpression(node)) {\n return null;\n }\n\n const operator = node.getOperatorToken().getText();\n if (operator === '+') {\n const left = extractStringLiterals(node.getLeft(), visited);\n const right = extractStringLiterals(node.getRight(), visited);\n const combined = left.flatMap((l) => right.map((r) => `${l}${r}`));\n return combined.length > 0 ? combined : [];\n }\n\n if (operator === '||' || operator === '??') {\n return [\n ...extractStringLiterals(node.getLeft(), visited),\n ...extractStringLiterals(node.getRight(), visited),\n ];\n }\n\n return [];\n};\n\nconst extractWrappedExpressionValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (Node.isParenthesizedExpression(node) || Node.isAsExpression(node)) {\n return extractStringLiterals(node.getExpression(), visited);\n }\n\n return null;\n};\n\nconst extractPropertyAccessValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (!Node.isPropertyAccessExpression(node)) {\n return null;\n }\n\n const typeValues = extractLiteralValuesFromType(node);\n if (typeValues.length > 0) {\n return typeValues;\n }\n\n const propertyName = node.getName();\n return extractObjectValues(node.getExpression(), visited)\n .filter(\n (value): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && propertyName in value,\n )\n .map((value) => value[propertyName])\n .filter((value): value is string => typeof value === 'string');\n};\n\nconst extractElementAccessValues = (node: Node): string[] | null => {\n if (!Node.isElementAccessExpression(node)) {\n return null;\n }\n\n return extractLiteralValuesFromType(node);\n};\n\nconst extractCallExpressionValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (!Node.isCallExpression(node)) {\n return null;\n }\n\n const expression = node.getExpression();\n\n const fromDefinitions = Node.isIdentifier(expression)\n ? expression.getDefinitionNodes().flatMap((definition) => {\n if (Node.isFunctionDeclaration(definition)) {\n return definition\n .getDescendantsOfKind(SyntaxKind.ReturnStatement)\n .flatMap((returnStmt) => {\n const expression = returnStmt.getExpression();\n return expression ? extractStringLiterals(expression, visited) : [];\n });\n }\n\n if (Node.isVariableDeclaration(definition)) {\n const initializer = definition.getInitializer();\n return initializer ? extractFromFunctionLike(initializer, visited) : [];\n }\n\n return [];\n })\n : [];\n\n const fromArguments = node.getArguments().flatMap((arg) => extractStringLiterals(arg, visited));\n\n return [...fromDefinitions, ...fromArguments];\n};\n\nconst extractIdentifierValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (!Node.isIdentifier(node)) {\n return null;\n }\n\n const values = node.getDefinitionNodes().flatMap((definition) => {\n if (\n Node.isVariableDeclaration(definition) ||\n Node.isParameterDeclaration(definition) ||\n Node.isBindingElement(definition)\n ) {\n const initializer = definition.getInitializer();\n return initializer ? extractStringLiterals(initializer, visited) : [];\n }\n\n return [];\n });\n\n if (values.length > 0) {\n return values;\n }\n\n const importedValues = extractImportedIdentifierValues(node, visited);\n if (importedValues.length > 0) {\n return importedValues;\n }\n\n return extractLiteralValuesFromType(node);\n};\n\n/**\n * Extract string literals from arrow functions or function expressions\n */\nconst extractFromFunctionLike = (node: Node, visited: Set<Node>): string[] => {\n const values: string[] = [];\n\n if (Node.isArrowFunction(node)) {\n const body = node.getBody();\n if (Node.isBlock(body)) {\n body.getDescendantsOfKind(SyntaxKind.ReturnStatement).forEach((returnStmt) => {\n const returnExpr = returnStmt.getExpression();\n if (returnExpr) {\n values.push(...extractStringLiterals(returnExpr, visited));\n }\n });\n } else {\n values.push(...extractStringLiterals(body, visited));\n }\n } else if (Node.isFunctionExpression(node)) {\n node.getDescendantsOfKind(SyntaxKind.ReturnStatement).forEach((returnStmt) => {\n const returnExpr = returnStmt.getExpression();\n if (returnExpr) {\n values.push(...extractStringLiterals(returnExpr, visited));\n }\n });\n }\n\n return values;\n};\n\n/**\n * Extract object literal values from an expression.\n * Returns an array of all possible object values (for union types or indexed access).\n */\nconst extractObjectValues = (node: Node, visited: Set<Node>): unknown[] => {\n if (visited.has(node)) {\n return [];\n }\n visited.add(node);\n\n const values: unknown[] = [];\n\n // Object literal expression\n if (Node.isObjectLiteralExpression(node)) {\n const obj: Record<string, unknown> = {};\n node.getProperties().forEach((prop) => {\n if (Node.isPropertyAssignment(prop)) {\n const name = prop.getName();\n const init = prop.getInitializer();\n if (init && Node.isStringLiteral(init)) {\n obj[name] = init.getLiteralValue();\n } else if (init && Node.isObjectLiteralExpression(init)) {\n const nestedValues = extractObjectValues(init, visited);\n if (nestedValues.length > 0) {\n obj[name] = nestedValues[0];\n }\n }\n }\n });\n values.push(obj);\n return values;\n }\n\n // Identifier - trace to initializer\n if (Node.isIdentifier(node)) {\n node.getDefinitionNodes().forEach((definition) => {\n if (Node.isVariableDeclaration(definition)) {\n const initializer = definition.getInitializer();\n if (initializer) {\n // Handle 'as const' assertion\n if (Node.isAsExpression(initializer)) {\n const inner = initializer.getExpression();\n values.push(...extractObjectValues(inner, visited));\n } else {\n values.push(...extractObjectValues(initializer, visited));\n }\n }\n }\n });\n return values;\n }\n\n // Element access - return all values from the object\n if (Node.isElementAccessExpression(node)) {\n const expression = node.getExpression();\n const baseObjects = extractObjectValues(expression, visited);\n\n // For indexed access, return all possible values\n baseObjects.forEach((obj) => {\n if (typeof obj === 'object' && obj !== null) {\n Object.values(obj).forEach((value) => values.push(value));\n }\n });\n return values;\n }\n\n return values;\n};\n\n/**\n * Extract literal values from a TypeScript type (for union types like 'brand' | 'secondary')\n */\nexport const extractLiteralValuesFromType = (node: Node): string[] => {\n const values: string[] = [];\n const nodeType = node.getType();\n\n if (nodeType.isUnion()) {\n nodeType.getUnionTypes().forEach((unionMember) => {\n if (unionMember.isStringLiteral()) {\n values.push(unionMember.getLiteralValue() as string);\n }\n });\n } else if (nodeType.isStringLiteral()) {\n values.push(nodeType.getLiteralValue() as string);\n }\n\n return values;\n};\n\nexport { extractStringLiterals };\n"],"mappings":";;;;;;AAKA,MAAM,wBAAwB,IAAI,QAAQ,EAAE,uBAAuB,MAAM,CAAC;AAC1E,MAAM,0CAA0B,IAAI,KAAsD;AAC1F,MAAM,oCAAoB,IAAI,KAA4B;AAC1D,MAAM,uCAAuB,IAAI,KAAwC;AACzE,MAAM,kBAAkB,oBAAqC,gBAAgB,SAAS,IAAI;AAE1F,MAAM,kBAAkB,cACtB,GAAG,WAAW,UAAU,IAAI,GAAG,SAAS,UAAU,CAAC,QAAQ;AAE7D,MAAM,6BACJ,gBACA,oBACkB;AAClB,KACE,CAAC,KAAK,WAAW,eAAe,IAChC,CAAC,gBAAgB,WAAW,IAAI,IAChC,eAAe,gBAAgB,CAE/B,QAAO;CAGT,MAAM,WAAW,KAAK,QAAQ,KAAK,QAAQ,eAAe,EAAE,gBAAgB;AAa5E,QAZmB;EACjB;EACA,GAAG,SAAS;EACZ,GAAG,SAAS;EACZ,GAAG,SAAS;EACZ,GAAG,SAAS;EACZ,KAAK,KAAK,UAAU,WAAW;EAC/B,KAAK,KAAK,UAAU,YAAY;EAChC,KAAK,KAAK,UAAU,WAAW;EAC/B,KAAK,KAAK,UAAU,YAAY;EACjC,CAEiB,MAAM,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B;aACzB,QAAQ,KAAK,0BAA0B,KAAK,EAAE;KACvD,MAAM,eAAe,oBAAoB,MAAM,QAAQ;AACvD,SAAI,aAAa,SAAS,EACxB,KAAI,QAAQ,aAAa;;;IAI/B;AACF,SAAO,KAAK,IAAI;AAChB,SAAO;;AAIT,KAAI,KAAK,aAAa,KAAK,EAAE;AAC3B,OAAK,oBAAoB,CAAC,SAAS,eAAe;AAChD,OAAI,KAAK,sBAAsB,WAAW,EAAE;IAC1C,MAAM,cAAc,WAAW,gBAAgB;AAC/C,QAAI,YAEF,KAAI,KAAK,eAAe,YAAY,EAAE;KACpC,MAAM,QAAQ,YAAY,eAAe;AACzC,YAAO,KAAK,GAAG,oBAAoB,OAAO,QAAQ,CAAC;UAEnD,QAAO,KAAK,GAAG,oBAAoB,aAAa,QAAQ,CAAC;;IAI/D;AACF,SAAO;;AAIT,KAAI,KAAK,0BAA0B,KAAK,EAAE;AAKxC,EAHoB,oBADD,KAAK,eAAe,EACa,QAAQ,CAGhD,SAAS,QAAQ;AAC3B,OAAI,OAAO,QAAQ,YAAY,QAAQ,KACrC,QAAO,OAAO,IAAI,CAAC,SAAS,UAAU,OAAO,KAAK,MAAM,CAAC;IAE3D;AACF,SAAO;;AAGT,QAAO;;;;;AAMT,MAAa,gCAAgC,SAAyB;CACpE,MAAM,SAAmB,EAAE;CAC3B,MAAM,WAAW,KAAK,SAAS;AAE/B,KAAI,SAAS,SAAS,CACpB,UAAS,eAAe,CAAC,SAAS,gBAAgB;AAChD,MAAI,YAAY,iBAAiB,CAC/B,QAAO,KAAK,YAAY,iBAAiB,CAAW;GAEtD;UACO,SAAS,iBAAiB,CACnC,QAAO,KAAK,SAAS,iBAAiB,CAAW;AAGnD,QAAO"}
|
|
1
|
+
{"version":3,"file":"expressions.js","names":[],"sources":["../../../../src/purger/optimized/ast/expressions.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { Identifier } from 'ts-morph';\nimport { Node, Project, SyntaxKind, ts } from 'ts-morph';\n\nconst importedSourceProject = new Project({ useInMemoryFileSystem: true });\nconst importedSourceFileCache = new Map<string, ReturnType<Project['createSourceFile']>>();\nconst tsConfigPathCache = new Map<string, string | null>();\nconst compilerOptionsCache = new Map<string, ts.CompilerOptions | null>();\nconst hasImportQuery = (moduleSpecifier: string): boolean => moduleSpecifier.includes('?');\n\nconst getLocalDefinitionNodes = (node: Node): Node[] => {\n if (!Node.isIdentifier(node)) {\n return [];\n }\n\n const name = node.getText();\n const nodeStart = node.getStart();\n const sourceFile = node.getSourceFile();\n\n const matches = [\n ...sourceFile\n .getDescendantsOfKind(SyntaxKind.VariableDeclaration)\n .filter((definition) => definition.getName() === name && definition.getStart() <= nodeStart),\n ...sourceFile\n .getDescendantsOfKind(SyntaxKind.Parameter)\n .filter((definition) => definition.getName() === name && definition.getStart() <= nodeStart),\n ...sourceFile\n .getDescendantsOfKind(SyntaxKind.BindingElement)\n .filter((definition) => definition.getName() === name && definition.getStart() <= nodeStart),\n ...sourceFile\n .getFunctions()\n .filter((definition) => definition.getName() === name && definition.getStart() <= nodeStart),\n ];\n\n return matches.sort((left, right) => right.getStart() - left.getStart()).slice(0, 1);\n};\n\nconst getDefinitionNodesSafe = (node: Identifier): Node[] => {\n try {\n return node.getDefinitionNodes();\n } catch {\n return getLocalDefinitionNodes(node);\n }\n};\n\nconst isExistingFile = (candidate: string): boolean =>\n fs.existsSync(candidate) && fs.statSync(candidate).isFile();\n\nconst resolveRelativeImportPath = (\n sourceFilePath: string,\n moduleSpecifier: string,\n): string | null => {\n if (\n !path.isAbsolute(sourceFilePath) ||\n !moduleSpecifier.startsWith('.') ||\n hasImportQuery(moduleSpecifier)\n ) {\n return null;\n }\n\n const basePath = path.resolve(path.dirname(sourceFilePath), moduleSpecifier);\n const candidates = [\n basePath,\n `${basePath}.ts`,\n `${basePath}.tsx`,\n `${basePath}.mjs`,\n `${basePath}.cjs`,\n `${basePath}.js`,\n `${basePath}.jsx`,\n path.join(basePath, 'index.ts'),\n path.join(basePath, 'index.tsx'),\n path.join(basePath, 'index.mjs'),\n path.join(basePath, 'index.cjs'),\n path.join(basePath, 'index.js'),\n path.join(basePath, 'index.jsx'),\n ];\n\n return candidates.find((candidate) => isExistingFile(candidate)) ?? null;\n};\n\nconst findNearestTypeScriptConfig = (sourceFilePath: string): string | null => {\n const sourceDir = path.dirname(sourceFilePath);\n const cached = tsConfigPathCache.get(sourceDir);\n\n if (cached !== undefined) {\n return cached;\n }\n\n let currentDir = sourceDir;\n\n while (true) {\n const tsConfigPath = path.join(currentDir, 'tsconfig.json');\n if (isExistingFile(tsConfigPath)) {\n tsConfigPathCache.set(sourceDir, tsConfigPath);\n return tsConfigPath;\n }\n\n const jsConfigPath = path.join(currentDir, 'jsconfig.json');\n if (isExistingFile(jsConfigPath)) {\n tsConfigPathCache.set(sourceDir, jsConfigPath);\n return jsConfigPath;\n }\n\n const parentDir = path.dirname(currentDir);\n if (parentDir === currentDir) {\n tsConfigPathCache.set(sourceDir, null);\n return null;\n }\n\n currentDir = parentDir;\n }\n};\n\nconst getCompilerOptionsForSourceFile = (sourceFilePath: string): ts.CompilerOptions | null => {\n const configPath = findNearestTypeScriptConfig(sourceFilePath);\n if (!configPath) {\n return null;\n }\n\n const cached = compilerOptionsCache.get(configPath);\n if (cached !== undefined) {\n return cached;\n }\n\n const readResult = ts.readConfigFile(configPath, ts.sys.readFile);\n if (readResult.error) {\n compilerOptionsCache.set(configPath, null);\n return null;\n }\n\n const parsed = ts.parseJsonConfigFileContent(readResult.config, ts.sys, path.dirname(configPath));\n\n const compilerOptions =\n parsed.options.paths && !parsed.options.baseUrl\n ? { ...parsed.options, baseUrl: path.dirname(configPath) }\n : parsed.options;\n\n compilerOptionsCache.set(configPath, compilerOptions);\n return compilerOptions;\n};\n\nconst resolveConfigImportPath = (\n sourceFilePath: string,\n moduleSpecifier: string,\n): string | null => {\n if (hasImportQuery(moduleSpecifier)) {\n return null;\n }\n\n const compilerOptions = getCompilerOptionsForSourceFile(sourceFilePath);\n if (!compilerOptions) {\n return null;\n }\n\n const resolvedModule = ts.resolveModuleName(\n moduleSpecifier,\n sourceFilePath,\n compilerOptions,\n ts.sys,\n ).resolvedModule;\n\n if (!resolvedModule) {\n return null;\n }\n\n return isExistingFile(resolvedModule.resolvedFileName) ? resolvedModule.resolvedFileName : null;\n};\n\nconst resolveImportPath = (sourceFilePath: string, moduleSpecifier: string): string | null =>\n moduleSpecifier.startsWith('.')\n ? resolveRelativeImportPath(sourceFilePath, moduleSpecifier)\n : resolveConfigImportPath(sourceFilePath, moduleSpecifier);\n\nconst getImportedSourceFile = (filePath: string) => {\n const cached = importedSourceFileCache.get(filePath);\n if (cached) {\n return cached;\n }\n\n if (!fs.existsSync(filePath)) {\n return null;\n }\n\n const sourceFile = importedSourceProject.createSourceFile(\n filePath,\n fs.readFileSync(filePath, 'utf-8'),\n {\n overwrite: true,\n },\n );\n importedSourceFileCache.set(filePath, sourceFile);\n return sourceFile;\n};\n\nconst extractImportedIdentifierValues = (node: Node, visited: Set<Node>): string[] => {\n if (!Node.isIdentifier(node)) {\n return [];\n }\n\n const sourceFile = node.getSourceFile();\n const sourceFilePath = sourceFile.getFilePath();\n const importMatch = sourceFile\n .getImportDeclarations()\n .find((importDecl) =>\n importDecl\n .getNamedImports()\n .some(\n (namedImport) =>\n (namedImport.getAliasNode()?.getText() ?? namedImport.getName()) === node.getText(),\n ),\n );\n\n if (!importMatch) {\n return [];\n }\n\n const namedImport = importMatch\n .getNamedImports()\n .find(\n (candidate) =>\n (candidate.getAliasNode()?.getText() ?? candidate.getName()) === node.getText(),\n );\n\n if (!namedImport) {\n return [];\n }\n\n const resolvedPath = resolveImportPath(sourceFilePath, importMatch.getModuleSpecifierValue());\n if (!resolvedPath) {\n return [];\n }\n\n const importedSourceFile = getImportedSourceFile(resolvedPath);\n if (!importedSourceFile) {\n return [];\n }\n\n const declaration = importedSourceFile.getVariableDeclaration(namedImport.getName());\n const initializer = declaration?.getInitializer();\n return initializer ? extractStringLiterals(initializer, visited) : [];\n};\n\n/**\n * Extracts string literal values from an expression.\n *\n * Handles:\n * - Direct string literals: 'value'\n * - Ternary expressions: condition ? 'a' : 'b' -> ['a', 'b']\n * - Variable references: traces back to initializer\n * - Logical expressions: a || 'fallback', a ?? 'default'\n * - Function calls: traces to return statements\n * - Template literals: `value`\n * - As expressions: value as Type\n *\n * @param node The expression node to extract values from\n * @param visited Set of visited nodes to prevent infinite recursion\n * @returns Array of extracted string literal values\n */\nconst extractStringLiterals = (node: Node, visited: Set<Node> = new Set()): string[] => {\n if (visited.has(node)) {\n return [];\n }\n visited.add(node);\n\n const directValues = extractDirectLiteralValues(node);\n if (directValues) {\n return directValues;\n }\n\n const templateValues = extractTemplateExpressionValues(node, visited);\n if (templateValues) {\n return templateValues;\n }\n\n // Ternary/conditional expression: condition ? 'a' : 'b'\n if (Node.isConditionalExpression(node)) {\n return [\n ...extractStringLiterals(node.getWhenTrue(), visited),\n ...extractStringLiterals(node.getWhenFalse(), visited),\n ];\n }\n\n const binaryValues = extractBinaryExpressionValues(node, visited);\n if (binaryValues) {\n return binaryValues;\n }\n\n const wrappedExpressionValues = extractWrappedExpressionValues(node, visited);\n if (wrappedExpressionValues) {\n return wrappedExpressionValues;\n }\n\n const propertyAccessValues = extractPropertyAccessValues(node, visited);\n if (propertyAccessValues) {\n return propertyAccessValues;\n }\n\n const elementAccessValues = extractElementAccessValues(node);\n if (elementAccessValues) {\n return elementAccessValues;\n }\n\n const callExpressionValues = extractCallExpressionValues(node, visited);\n if (callExpressionValues) {\n return callExpressionValues;\n }\n\n const identifierValues = extractIdentifierValues(node, visited);\n if (identifierValues) {\n return identifierValues;\n }\n\n return [];\n};\n\nconst extractDirectLiteralValues = (node: Node): string[] | null => {\n if (Node.isStringLiteral(node) || Node.isNoSubstitutionTemplateLiteral(node)) {\n return [node.getLiteralValue()];\n }\n\n return null;\n};\n\nconst extractTemplateExpressionValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (!Node.isTemplateExpression(node)) {\n return null;\n }\n\n const parts: string[][] = [[node.getHead().getLiteralText()]];\n\n node.getTemplateSpans().forEach((span) => {\n const exprValues = extractStringLiterals(span.getExpression(), visited);\n const literalText = span.getLiteral().getLiteralText();\n parts.push(\n exprValues.length > 0\n ? exprValues.map((value) => `${value}${literalText}`)\n : ['', literalText],\n );\n });\n\n return parts\n .reduce<\n string[]\n >((acc, segment) => acc.flatMap((base) => segment.map((frag) => `${base}${frag}`)), [''])\n .filter((value) => value.length > 0);\n};\n\nconst extractBinaryExpressionValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (!Node.isBinaryExpression(node)) {\n return null;\n }\n\n const operator = node.getOperatorToken().getText();\n if (operator === '+') {\n const left = extractStringLiterals(node.getLeft(), visited);\n const right = extractStringLiterals(node.getRight(), visited);\n const combined = left.flatMap((l) => right.map((r) => `${l}${r}`));\n return combined.length > 0 ? combined : [];\n }\n\n if (operator === '||' || operator === '??') {\n return [\n ...extractStringLiterals(node.getLeft(), visited),\n ...extractStringLiterals(node.getRight(), visited),\n ];\n }\n\n return [];\n};\n\nconst extractWrappedExpressionValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (Node.isParenthesizedExpression(node) || Node.isAsExpression(node)) {\n return extractStringLiterals(node.getExpression(), visited);\n }\n\n return null;\n};\n\nconst extractPropertyAccessValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (!Node.isPropertyAccessExpression(node)) {\n return null;\n }\n\n const typeValues = extractLiteralValuesFromType(node);\n if (typeValues.length > 0) {\n return typeValues;\n }\n\n const propertyName = node.getName();\n return extractObjectValues(node.getExpression(), visited)\n .filter(\n (value): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && propertyName in value,\n )\n .map((value) => value[propertyName])\n .filter((value): value is string => typeof value === 'string');\n};\n\nconst extractElementAccessValues = (node: Node): string[] | null => {\n if (!Node.isElementAccessExpression(node)) {\n return null;\n }\n\n return extractLiteralValuesFromType(node);\n};\n\nconst extractCallExpressionValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (!Node.isCallExpression(node)) {\n return null;\n }\n\n const expression = node.getExpression();\n\n const fromDefinitions = Node.isIdentifier(expression)\n ? getDefinitionNodesSafe(expression).flatMap((definition) => {\n if (Node.isFunctionDeclaration(definition)) {\n return definition\n .getDescendantsOfKind(SyntaxKind.ReturnStatement)\n .flatMap((returnStmt) => {\n const expression = returnStmt.getExpression();\n return expression ? extractStringLiterals(expression, visited) : [];\n });\n }\n\n if (Node.isVariableDeclaration(definition)) {\n const initializer = definition.getInitializer();\n return initializer ? extractFromFunctionLike(initializer, visited) : [];\n }\n\n return [];\n })\n : [];\n\n const fromArguments = node.getArguments().flatMap((arg) => extractStringLiterals(arg, visited));\n\n return [...fromDefinitions, ...fromArguments];\n};\n\nconst extractIdentifierValues = (node: Node, visited: Set<Node>): string[] | null => {\n if (!Node.isIdentifier(node)) {\n return null;\n }\n\n const values = getDefinitionNodesSafe(node).flatMap((definition) => {\n if (\n Node.isVariableDeclaration(definition) ||\n Node.isParameterDeclaration(definition) ||\n Node.isBindingElement(definition)\n ) {\n const initializer = definition.getInitializer();\n return initializer ? extractStringLiterals(initializer, visited) : [];\n }\n\n return [];\n });\n\n if (values.length > 0) {\n return values;\n }\n\n const importedValues = extractImportedIdentifierValues(node, visited);\n if (importedValues.length > 0) {\n return importedValues;\n }\n\n return extractLiteralValuesFromType(node);\n};\n\n/**\n * Extract string literals from arrow functions or function expressions\n */\nconst extractFromFunctionLike = (node: Node, visited: Set<Node>): string[] => {\n const values: string[] = [];\n\n if (Node.isArrowFunction(node)) {\n const body = node.getBody();\n if (Node.isBlock(body)) {\n body.getDescendantsOfKind(SyntaxKind.ReturnStatement).forEach((returnStmt) => {\n const returnExpr = returnStmt.getExpression();\n if (returnExpr) {\n values.push(...extractStringLiterals(returnExpr, visited));\n }\n });\n } else {\n values.push(...extractStringLiterals(body, visited));\n }\n } else if (Node.isFunctionExpression(node)) {\n node.getDescendantsOfKind(SyntaxKind.ReturnStatement).forEach((returnStmt) => {\n const returnExpr = returnStmt.getExpression();\n if (returnExpr) {\n values.push(...extractStringLiterals(returnExpr, visited));\n }\n });\n }\n\n return values;\n};\n\n/**\n * Extract object literal values from an expression.\n * Returns an array of all possible object values (for union types or indexed access).\n */\nconst extractObjectValues = (node: Node, visited: Set<Node>): unknown[] => {\n if (visited.has(node)) {\n return [];\n }\n visited.add(node);\n\n const values: unknown[] = [];\n\n // Object literal expression\n if (Node.isObjectLiteralExpression(node)) {\n const obj: Record<string, unknown> = {};\n node.getProperties().forEach((prop) => {\n if (Node.isPropertyAssignment(prop)) {\n const name = prop.getName();\n const init = prop.getInitializer();\n if (init && Node.isStringLiteral(init)) {\n obj[name] = init.getLiteralValue();\n } else if (init && Node.isObjectLiteralExpression(init)) {\n const nestedValues = extractObjectValues(init, visited);\n if (nestedValues.length > 0) {\n obj[name] = nestedValues[0];\n }\n }\n }\n });\n values.push(obj);\n return values;\n }\n\n // Identifier - trace to initializer\n if (Node.isIdentifier(node)) {\n getDefinitionNodesSafe(node).forEach((definition) => {\n if (Node.isVariableDeclaration(definition)) {\n const initializer = definition.getInitializer();\n if (initializer) {\n // Handle 'as const' assertion\n if (Node.isAsExpression(initializer)) {\n const inner = initializer.getExpression();\n values.push(...extractObjectValues(inner, visited));\n } else {\n values.push(...extractObjectValues(initializer, visited));\n }\n }\n }\n });\n return values;\n }\n\n // Element access - return all values from the object\n if (Node.isElementAccessExpression(node)) {\n const expression = node.getExpression();\n const baseObjects = extractObjectValues(expression, visited);\n\n // For indexed access, return all possible values\n baseObjects.forEach((obj) => {\n if (typeof obj === 'object' && obj !== null) {\n Object.values(obj).forEach((value) => values.push(value));\n }\n });\n return values;\n }\n\n return values;\n};\n\n/**\n * Extract literal values from a TypeScript type (for union types like 'brand' | 'secondary')\n */\nexport const extractLiteralValuesFromType = (node: Node): string[] => {\n const values: string[] = [];\n const nodeType = node.getType();\n\n if (nodeType.isUnion()) {\n nodeType.getUnionTypes().forEach((unionMember) => {\n if (unionMember.isStringLiteral()) {\n values.push(unionMember.getLiteralValue() as string);\n }\n });\n } else if (nodeType.isStringLiteral()) {\n values.push(nodeType.getLiteralValue() as string);\n }\n\n return values;\n};\n\nexport { extractStringLiterals };\n"],"mappings":";;;;;;AAMA,MAAM,wBAAwB,IAAI,QAAQ,EAAE,uBAAuB,MAAM,CAAC;AAC1E,MAAM,0CAA0B,IAAI,KAAsD;AAC1F,MAAM,oCAAoB,IAAI,KAA4B;AAC1D,MAAM,uCAAuB,IAAI,KAAwC;AACzE,MAAM,kBAAkB,oBAAqC,gBAAgB,SAAS,IAAI;AAE1F,MAAM,2BAA2B,SAAuB;AACtD,KAAI,CAAC,KAAK,aAAa,KAAK,CAC1B,QAAO,EAAE;CAGX,MAAM,OAAO,KAAK,SAAS;CAC3B,MAAM,YAAY,KAAK,UAAU;CACjC,MAAM,aAAa,KAAK,eAAe;AAiBvC,QAfgB;EACd,GAAG,WACA,qBAAqB,WAAW,oBAAoB,CACpD,QAAQ,eAAe,WAAW,SAAS,KAAK,QAAQ,WAAW,UAAU,IAAI,UAAU;EAC9F,GAAG,WACA,qBAAqB,WAAW,UAAU,CAC1C,QAAQ,eAAe,WAAW,SAAS,KAAK,QAAQ,WAAW,UAAU,IAAI,UAAU;EAC9F,GAAG,WACA,qBAAqB,WAAW,eAAe,CAC/C,QAAQ,eAAe,WAAW,SAAS,KAAK,QAAQ,WAAW,UAAU,IAAI,UAAU;EAC9F,GAAG,WACA,cAAc,CACd,QAAQ,eAAe,WAAW,SAAS,KAAK,QAAQ,WAAW,UAAU,IAAI,UAAU;EAC/F,CAEc,MAAM,MAAM,UAAU,MAAM,UAAU,GAAG,KAAK,UAAU,CAAC,CAAC,MAAM,GAAG,EAAE;;AAGtF,MAAM,0BAA0B,SAA6B;AAC3D,KAAI;AACF,SAAO,KAAK,oBAAoB;SAC1B;AACN,SAAO,wBAAwB,KAAK;;;AAIxC,MAAM,kBAAkB,cACtB,GAAG,WAAW,UAAU,IAAI,GAAG,SAAS,UAAU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AAO,IAAI,CAAC,SAAS,UAAU,OAAO,KAAK,MAAM,CAAC;IAE3D;AACF,SAAO;;AAGT,QAAO;;;;;AAMT,MAAa,gCAAgC,SAAyB;CACpE,MAAM,SAAmB,EAAE;CAC3B,MAAM,WAAW,KAAK,SAAS;AAE/B,KAAI,SAAS,SAAS,CACpB,UAAS,eAAe,CAAC,SAAS,gBAAgB;AAChD,MAAI,YAAY,iBAAiB,CAC/B,QAAO,KAAK,YAAY,iBAAiB,CAAW;GAEtD;UACO,SAAS,iBAAiB,CACnC,QAAO,KAAK,SAAS,iBAAiB,CAAW;AAGnD,QAAO"}
|
|
@@ -18,7 +18,7 @@ import { FontConfig } from "../../types/dist/index.cjs";
|
|
|
18
18
|
* addBase(fontVars);
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
|
-
declare function getFontStyles(fontConfig: Partial<FontConfig>): Record<"--uds-font-sans" | "--uds-font-
|
|
21
|
+
declare function getFontStyles(fontConfig: Partial<FontConfig>): Record<"--uds-font-sans" | "--uds-font-serif" | "--uds-font-mono" | "--uds-font-sans-alt" | "--uds-font-serif-alt", string>;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { getFontStyles };
|
|
24
24
|
//# sourceMappingURL=getFontStyles.d.cts.map
|
|
@@ -18,7 +18,7 @@ import { FontConfig } from "../../types/dist/index.js";
|
|
|
18
18
|
* addBase(fontVars);
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
|
-
declare function getFontStyles(fontConfig: Partial<FontConfig>): Record<"--uds-font-sans" | "--uds-font-
|
|
21
|
+
declare function getFontStyles(fontConfig: Partial<FontConfig>): Record<"--uds-font-sans" | "--uds-font-serif" | "--uds-font-mono" | "--uds-font-sans-alt" | "--uds-font-serif-alt", string>;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { getFontStyles };
|
|
24
24
|
//# sourceMappingURL=getFontStyles.d.ts.map
|
|
@@ -3,8 +3,8 @@ import { ElevationAlias, ShadowType, ShadowVariant } from "../../types/dist/inde
|
|
|
3
3
|
import { UniversalTokensConfig } from "../../config/dist/index.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/tailwind/utils/getShadowStyles.d.ts
|
|
6
|
-
declare const shadowVariantToCSS: (shadowType: ShadowType, shadowVariant: ShadowVariant | ElevationAlias) => readonly [".uds-inset-shadow-
|
|
7
|
-
readonly [x: string]: "var(--uds-inset-shadow-
|
|
6
|
+
declare const shadowVariantToCSS: (shadowType: ShadowType, shadowVariant: ShadowVariant | ElevationAlias) => readonly [".uds-inset-shadow-sm" | ".uds-inset-shadow-md" | ".uds-inset-shadow-lg" | ".uds-inset-shadow-xl" | ".uds-inset-shadow-2xl" | ".uds-inset-shadow-none" | ".uds-inset-shadow-xs" | ".uds-inset-shadow-elevation-0" | ".uds-inset-shadow-elevation-1" | ".uds-inset-shadow-elevation-2" | ".uds-inset-shadow-elevation-3" | ".uds-inset-shadow-elevation-4" | ".uds-inset-shadow-elevation-5" | ".uds-drop-shadow-sm" | ".uds-drop-shadow-md" | ".uds-drop-shadow-lg" | ".uds-drop-shadow-xl" | ".uds-drop-shadow-2xl" | ".uds-drop-shadow-none" | ".uds-drop-shadow-xs" | ".uds-drop-shadow-elevation-0" | ".uds-drop-shadow-elevation-1" | ".uds-drop-shadow-elevation-2" | ".uds-drop-shadow-elevation-3" | ".uds-drop-shadow-elevation-4" | ".uds-drop-shadow-elevation-5", {
|
|
7
|
+
readonly [x: string]: "var(--uds-inset-shadow-sm)" | "var(--uds-inset-shadow-md)" | "var(--uds-inset-shadow-lg)" | "var(--uds-inset-shadow-xl)" | "var(--uds-inset-shadow-2xl)" | "var(--uds-inset-shadow-none)" | "var(--uds-inset-shadow-xs)" | "var(--uds-inset-shadow-elevation-0)" | "var(--uds-inset-shadow-elevation-1)" | "var(--uds-inset-shadow-elevation-2)" | "var(--uds-inset-shadow-elevation-3)" | "var(--uds-inset-shadow-elevation-4)" | "var(--uds-inset-shadow-elevation-5)" | "var(--uds-drop-shadow-sm)" | "var(--uds-drop-shadow-md)" | "var(--uds-drop-shadow-lg)" | "var(--uds-drop-shadow-xl)" | "var(--uds-drop-shadow-2xl)" | "var(--uds-drop-shadow-none)" | "var(--uds-drop-shadow-xs)" | "var(--uds-drop-shadow-elevation-0)" | "var(--uds-drop-shadow-elevation-1)" | "var(--uds-drop-shadow-elevation-2)" | "var(--uds-drop-shadow-elevation-3)" | "var(--uds-drop-shadow-elevation-4)" | "var(--uds-drop-shadow-elevation-5)" | "var(--uds-drop-shadow, 0 0 transparent), var(--uds-inset-shadow, 0 0 transparent), var(--tw-ring-offset-shadow, 0 0 transparent), var(--tw-ring-shadow, 0 0 transparent), var(--tw-shadow, 0 0 transparent)";
|
|
8
8
|
readonly boxShadow: "var(--uds-drop-shadow, 0 0 transparent), var(--uds-inset-shadow, 0 0 transparent), var(--tw-ring-offset-shadow, 0 0 transparent), var(--tw-ring-shadow, 0 0 transparent), var(--tw-shadow, 0 0 transparent)";
|
|
9
9
|
}];
|
|
10
10
|
declare function getShadowStyles({
|
|
@@ -13,8 +13,8 @@ declare function getShadowStyles({
|
|
|
13
13
|
}: {
|
|
14
14
|
config: UniversalTokensConfig;
|
|
15
15
|
shadowType: ShadowType;
|
|
16
|
-
}): Record<".uds-inset-shadow-
|
|
17
|
-
readonly [x: string]: "var(--uds-inset-shadow-
|
|
16
|
+
}): Record<".uds-inset-shadow-sm" | ".uds-inset-shadow-md" | ".uds-inset-shadow-lg" | ".uds-inset-shadow-xl" | ".uds-inset-shadow-2xl" | ".uds-inset-shadow-none" | ".uds-inset-shadow-xs" | ".uds-inset-shadow-elevation-0" | ".uds-inset-shadow-elevation-1" | ".uds-inset-shadow-elevation-2" | ".uds-inset-shadow-elevation-3" | ".uds-inset-shadow-elevation-4" | ".uds-inset-shadow-elevation-5" | ".uds-drop-shadow-sm" | ".uds-drop-shadow-md" | ".uds-drop-shadow-lg" | ".uds-drop-shadow-xl" | ".uds-drop-shadow-2xl" | ".uds-drop-shadow-none" | ".uds-drop-shadow-xs" | ".uds-drop-shadow-elevation-0" | ".uds-drop-shadow-elevation-1" | ".uds-drop-shadow-elevation-2" | ".uds-drop-shadow-elevation-3" | ".uds-drop-shadow-elevation-4" | ".uds-drop-shadow-elevation-5", {
|
|
17
|
+
readonly [x: string]: "var(--uds-inset-shadow-sm)" | "var(--uds-inset-shadow-md)" | "var(--uds-inset-shadow-lg)" | "var(--uds-inset-shadow-xl)" | "var(--uds-inset-shadow-2xl)" | "var(--uds-inset-shadow-none)" | "var(--uds-inset-shadow-xs)" | "var(--uds-inset-shadow-elevation-0)" | "var(--uds-inset-shadow-elevation-1)" | "var(--uds-inset-shadow-elevation-2)" | "var(--uds-inset-shadow-elevation-3)" | "var(--uds-inset-shadow-elevation-4)" | "var(--uds-inset-shadow-elevation-5)" | "var(--uds-drop-shadow-sm)" | "var(--uds-drop-shadow-md)" | "var(--uds-drop-shadow-lg)" | "var(--uds-drop-shadow-xl)" | "var(--uds-drop-shadow-2xl)" | "var(--uds-drop-shadow-none)" | "var(--uds-drop-shadow-xs)" | "var(--uds-drop-shadow-elevation-0)" | "var(--uds-drop-shadow-elevation-1)" | "var(--uds-drop-shadow-elevation-2)" | "var(--uds-drop-shadow-elevation-3)" | "var(--uds-drop-shadow-elevation-4)" | "var(--uds-drop-shadow-elevation-5)" | "var(--uds-drop-shadow, 0 0 transparent), var(--uds-inset-shadow, 0 0 transparent), var(--tw-ring-offset-shadow, 0 0 transparent), var(--tw-ring-shadow, 0 0 transparent), var(--tw-shadow, 0 0 transparent)";
|
|
18
18
|
readonly boxShadow: "var(--uds-drop-shadow, 0 0 transparent), var(--uds-inset-shadow, 0 0 transparent), var(--tw-ring-offset-shadow, 0 0 transparent), var(--tw-ring-shadow, 0 0 transparent), var(--tw-shadow, 0 0 transparent)";
|
|
19
19
|
}>;
|
|
20
20
|
//#endregion
|
|
@@ -3,8 +3,8 @@ import { ElevationAlias, ShadowType, ShadowVariant } from "../../types/dist/inde
|
|
|
3
3
|
import { UniversalTokensConfig } from "../../config/dist/index.js";
|
|
4
4
|
|
|
5
5
|
//#region src/tailwind/utils/getShadowStyles.d.ts
|
|
6
|
-
declare const shadowVariantToCSS: (shadowType: ShadowType, shadowVariant: ShadowVariant | ElevationAlias) => readonly [".uds-inset-shadow-
|
|
7
|
-
readonly [x: string]: "var(--uds-inset-shadow-
|
|
6
|
+
declare const shadowVariantToCSS: (shadowType: ShadowType, shadowVariant: ShadowVariant | ElevationAlias) => readonly [".uds-inset-shadow-sm" | ".uds-inset-shadow-md" | ".uds-inset-shadow-lg" | ".uds-inset-shadow-xl" | ".uds-inset-shadow-2xl" | ".uds-inset-shadow-none" | ".uds-inset-shadow-xs" | ".uds-inset-shadow-elevation-0" | ".uds-inset-shadow-elevation-1" | ".uds-inset-shadow-elevation-2" | ".uds-inset-shadow-elevation-3" | ".uds-inset-shadow-elevation-4" | ".uds-inset-shadow-elevation-5" | ".uds-drop-shadow-sm" | ".uds-drop-shadow-md" | ".uds-drop-shadow-lg" | ".uds-drop-shadow-xl" | ".uds-drop-shadow-2xl" | ".uds-drop-shadow-none" | ".uds-drop-shadow-xs" | ".uds-drop-shadow-elevation-0" | ".uds-drop-shadow-elevation-1" | ".uds-drop-shadow-elevation-2" | ".uds-drop-shadow-elevation-3" | ".uds-drop-shadow-elevation-4" | ".uds-drop-shadow-elevation-5", {
|
|
7
|
+
readonly [x: string]: "var(--uds-inset-shadow-sm)" | "var(--uds-inset-shadow-md)" | "var(--uds-inset-shadow-lg)" | "var(--uds-inset-shadow-xl)" | "var(--uds-inset-shadow-2xl)" | "var(--uds-inset-shadow-none)" | "var(--uds-inset-shadow-xs)" | "var(--uds-inset-shadow-elevation-0)" | "var(--uds-inset-shadow-elevation-1)" | "var(--uds-inset-shadow-elevation-2)" | "var(--uds-inset-shadow-elevation-3)" | "var(--uds-inset-shadow-elevation-4)" | "var(--uds-inset-shadow-elevation-5)" | "var(--uds-drop-shadow-sm)" | "var(--uds-drop-shadow-md)" | "var(--uds-drop-shadow-lg)" | "var(--uds-drop-shadow-xl)" | "var(--uds-drop-shadow-2xl)" | "var(--uds-drop-shadow-none)" | "var(--uds-drop-shadow-xs)" | "var(--uds-drop-shadow-elevation-0)" | "var(--uds-drop-shadow-elevation-1)" | "var(--uds-drop-shadow-elevation-2)" | "var(--uds-drop-shadow-elevation-3)" | "var(--uds-drop-shadow-elevation-4)" | "var(--uds-drop-shadow-elevation-5)" | "var(--uds-drop-shadow, 0 0 transparent), var(--uds-inset-shadow, 0 0 transparent), var(--tw-ring-offset-shadow, 0 0 transparent), var(--tw-ring-shadow, 0 0 transparent), var(--tw-shadow, 0 0 transparent)";
|
|
8
8
|
readonly boxShadow: "var(--uds-drop-shadow, 0 0 transparent), var(--uds-inset-shadow, 0 0 transparent), var(--tw-ring-offset-shadow, 0 0 transparent), var(--tw-ring-shadow, 0 0 transparent), var(--tw-shadow, 0 0 transparent)";
|
|
9
9
|
}];
|
|
10
10
|
declare function getShadowStyles({
|
|
@@ -13,8 +13,8 @@ declare function getShadowStyles({
|
|
|
13
13
|
}: {
|
|
14
14
|
config: UniversalTokensConfig;
|
|
15
15
|
shadowType: ShadowType;
|
|
16
|
-
}): Record<".uds-inset-shadow-
|
|
17
|
-
readonly [x: string]: "var(--uds-inset-shadow-
|
|
16
|
+
}): Record<".uds-inset-shadow-sm" | ".uds-inset-shadow-md" | ".uds-inset-shadow-lg" | ".uds-inset-shadow-xl" | ".uds-inset-shadow-2xl" | ".uds-inset-shadow-none" | ".uds-inset-shadow-xs" | ".uds-inset-shadow-elevation-0" | ".uds-inset-shadow-elevation-1" | ".uds-inset-shadow-elevation-2" | ".uds-inset-shadow-elevation-3" | ".uds-inset-shadow-elevation-4" | ".uds-inset-shadow-elevation-5" | ".uds-drop-shadow-sm" | ".uds-drop-shadow-md" | ".uds-drop-shadow-lg" | ".uds-drop-shadow-xl" | ".uds-drop-shadow-2xl" | ".uds-drop-shadow-none" | ".uds-drop-shadow-xs" | ".uds-drop-shadow-elevation-0" | ".uds-drop-shadow-elevation-1" | ".uds-drop-shadow-elevation-2" | ".uds-drop-shadow-elevation-3" | ".uds-drop-shadow-elevation-4" | ".uds-drop-shadow-elevation-5", {
|
|
17
|
+
readonly [x: string]: "var(--uds-inset-shadow-sm)" | "var(--uds-inset-shadow-md)" | "var(--uds-inset-shadow-lg)" | "var(--uds-inset-shadow-xl)" | "var(--uds-inset-shadow-2xl)" | "var(--uds-inset-shadow-none)" | "var(--uds-inset-shadow-xs)" | "var(--uds-inset-shadow-elevation-0)" | "var(--uds-inset-shadow-elevation-1)" | "var(--uds-inset-shadow-elevation-2)" | "var(--uds-inset-shadow-elevation-3)" | "var(--uds-inset-shadow-elevation-4)" | "var(--uds-inset-shadow-elevation-5)" | "var(--uds-drop-shadow-sm)" | "var(--uds-drop-shadow-md)" | "var(--uds-drop-shadow-lg)" | "var(--uds-drop-shadow-xl)" | "var(--uds-drop-shadow-2xl)" | "var(--uds-drop-shadow-none)" | "var(--uds-drop-shadow-xs)" | "var(--uds-drop-shadow-elevation-0)" | "var(--uds-drop-shadow-elevation-1)" | "var(--uds-drop-shadow-elevation-2)" | "var(--uds-drop-shadow-elevation-3)" | "var(--uds-drop-shadow-elevation-4)" | "var(--uds-drop-shadow-elevation-5)" | "var(--uds-drop-shadow, 0 0 transparent), var(--uds-inset-shadow, 0 0 transparent), var(--tw-ring-offset-shadow, 0 0 transparent), var(--tw-ring-shadow, 0 0 transparent), var(--tw-shadow, 0 0 transparent)";
|
|
18
18
|
readonly boxShadow: "var(--uds-drop-shadow, 0 0 transparent), var(--uds-inset-shadow, 0 0 transparent), var(--tw-ring-offset-shadow, 0 0 transparent), var(--tw-ring-shadow, 0 0 transparent), var(--tw-shadow, 0 0 transparent)";
|
|
19
19
|
}>;
|
|
20
20
|
//#endregion
|