@mindlogic-ai/logician-ui 4.0.0 → 5.0.0-alpha.1
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/MIGRATION-5.0.md +155 -0
- package/USAGE.md +1 -1
- package/codemods/5.0/README.md +244 -0
- package/codemods/5.0/__testfixtures__/badge-variants.input.tsx +20 -0
- package/codemods/5.0/__testfixtures__/badge-variants.output.tsx +21 -0
- package/codemods/5.0/__testfixtures__/button-variants.input.tsx +124 -0
- package/codemods/5.0/__testfixtures__/button-variants.output.tsx +116 -0
- package/codemods/5.0/__testfixtures__/card-gradient.input.tsx +12 -0
- package/codemods/5.0/__testfixtures__/card-gradient.output.tsx +16 -0
- package/codemods/5.0/__testfixtures__/index.input.tsx +43 -0
- package/codemods/5.0/__testfixtures__/index.output.tsx +53 -0
- package/codemods/5.0/__testfixtures__/tag-chip-conflict.input.tsx +10 -0
- package/codemods/5.0/__testfixtures__/tag-chip-conflict.output.tsx +12 -0
- package/codemods/5.0/__testfixtures__/tag-chip-merge.input.tsx +42 -0
- package/codemods/5.0/__testfixtures__/tag-chip-merge.output.tsx +44 -0
- package/codemods/5.0/__testfixtures__/tag-chip.input.tsx +67 -0
- package/codemods/5.0/__testfixtures__/tag-chip.output.tsx +99 -0
- package/codemods/5.0/__testfixtures__/token-renames.input.tsx +88 -0
- package/codemods/5.0/__testfixtures__/token-renames.output.tsx +88 -0
- package/codemods/5.0/badge-variants.js +91 -0
- package/codemods/5.0/button-variants.js +234 -0
- package/codemods/5.0/card-gradient.js +72 -0
- package/codemods/5.0/codemods.test.ts +441 -0
- package/codemods/5.0/index.js +220 -0
- package/codemods/5.0/lib/shared.js +273 -0
- package/codemods/5.0/tag-chip.js +436 -0
- package/codemods/5.0/token-renames.js +231 -0
- package/codemods/vitest.config.ts +22 -0
- package/dist/components/Avatar/Avatar.d.ts +37 -0
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.js +31 -2
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/Avatar.mjs +30 -3
- package/dist/components/Avatar/Avatar.mjs.map +1 -1
- package/dist/components/Avatar/index.d.ts +1 -1
- package/dist/components/Avatar/index.d.ts.map +1 -1
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/Badge.js +10 -6
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Badge/Badge.mjs +11 -7
- package/dist/components/Badge/Badge.mjs.map +1 -1
- package/dist/components/Badge/Badge.styles.d.ts +17 -3
- package/dist/components/Badge/Badge.styles.d.ts.map +1 -1
- package/dist/components/Badge/Badge.styles.js +51 -45
- package/dist/components/Badge/Badge.styles.js.map +1 -1
- package/dist/components/Badge/Badge.styles.mjs +50 -46
- package/dist/components/Badge/Badge.styles.mjs.map +1 -1
- package/dist/components/Badge/Badge.types.d.ts +16 -12
- package/dist/components/Badge/Badge.types.d.ts.map +1 -1
- package/dist/components/Badge/index.d.ts +2 -2
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Banner/Banner.styles.d.ts +7 -3
- package/dist/components/Banner/Banner.styles.d.ts.map +1 -1
- package/dist/components/Banner/Banner.styles.js +43 -27
- package/dist/components/Banner/Banner.styles.js.map +1 -1
- package/dist/components/Banner/Banner.styles.mjs +44 -28
- package/dist/components/Banner/Banner.styles.mjs.map +1 -1
- package/dist/components/Banner/Banner.types.d.ts +1 -1
- package/dist/components/Banner/Banner.types.d.ts.map +1 -1
- package/dist/components/BottomSheet/BottomSheetCloseButton.d.ts.map +1 -1
- package/dist/components/BottomSheet/BottomSheetCloseButton.js +1 -1
- package/dist/components/BottomSheet/BottomSheetCloseButton.js.map +1 -1
- package/dist/components/BottomSheet/BottomSheetCloseButton.mjs +1 -1
- package/dist/components/BottomSheet/BottomSheetCloseButton.mjs.map +1 -1
- package/dist/components/Breadcrumb/BreadcrumbLink/BreadcrumbLink.js +1 -1
- package/dist/components/Breadcrumb/BreadcrumbLink/BreadcrumbLink.js.map +1 -1
- package/dist/components/Breadcrumb/BreadcrumbLink/BreadcrumbLink.mjs +1 -1
- package/dist/components/Breadcrumb/BreadcrumbLink/BreadcrumbLink.mjs.map +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +33 -14
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.legacy.d.ts +53 -0
- package/dist/components/Button/Button.legacy.d.ts.map +1 -0
- package/dist/components/Button/Button.legacy.js +131 -0
- package/dist/components/Button/Button.legacy.js.map +1 -0
- package/dist/components/Button/Button.legacy.mjs +127 -0
- package/dist/components/Button/Button.legacy.mjs.map +1 -0
- package/dist/components/Button/Button.mjs +33 -14
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/Button/Button.styles.d.ts +38 -26
- package/dist/components/Button/Button.styles.d.ts.map +1 -1
- package/dist/components/Button/Button.styles.js +142 -378
- package/dist/components/Button/Button.styles.js.map +1 -1
- package/dist/components/Button/Button.styles.mjs +141 -379
- package/dist/components/Button/Button.styles.mjs.map +1 -1
- package/dist/components/Button/Button.types.d.ts +45 -37
- package/dist/components/Button/Button.types.d.ts.map +1 -1
- package/dist/components/Button/index.d.ts +2 -2
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/Card.js +1 -7
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/Card.mjs +1 -7
- package/dist/components/Card/Card.mjs.map +1 -1
- package/dist/components/Card/Card.styles.d.ts +1 -12
- package/dist/components/Card/Card.styles.d.ts.map +1 -1
- package/dist/components/Card/Card.styles.js +6 -13
- package/dist/components/Card/Card.styles.js.map +1 -1
- package/dist/components/Card/Card.styles.mjs +6 -13
- package/dist/components/Card/Card.styles.mjs.map +1 -1
- package/dist/components/Card/Card.types.d.ts +1 -5
- package/dist/components/Card/Card.types.d.ts.map +1 -1
- package/dist/components/Checkbox/CheckboxControl.d.ts.map +1 -1
- package/dist/components/Checkbox/CheckboxControl.js +14 -8
- package/dist/components/Checkbox/CheckboxControl.js.map +1 -1
- package/dist/components/Checkbox/CheckboxControl.mjs +14 -8
- package/dist/components/Checkbox/CheckboxControl.mjs.map +1 -1
- package/dist/components/Chip/Chip.d.ts +5 -1
- package/dist/components/Chip/Chip.d.ts.map +1 -1
- package/dist/components/Chip/Chip.js +24 -18
- package/dist/components/Chip/Chip.js.map +1 -1
- package/dist/components/Chip/Chip.mjs +24 -18
- package/dist/components/Chip/Chip.mjs.map +1 -1
- package/dist/components/Chip/Chip.types.d.ts +38 -23
- package/dist/components/Chip/Chip.types.d.ts.map +1 -1
- package/dist/components/Chip/index.d.ts +0 -1
- package/dist/components/Chip/index.d.ts.map +1 -1
- package/dist/components/Code/Code.d.ts.map +1 -1
- package/dist/components/Code/Code.js +2 -2
- package/dist/components/Code/Code.js.map +1 -1
- package/dist/components/Code/Code.mjs +2 -2
- package/dist/components/Code/Code.mjs.map +1 -1
- package/dist/components/CodeTabs/CodeTabs.d.ts.map +1 -1
- package/dist/components/CodeTabs/CodeTabs.js +16 -2
- package/dist/components/CodeTabs/CodeTabs.js.map +1 -1
- package/dist/components/CodeTabs/CodeTabs.mjs +16 -2
- package/dist/components/CodeTabs/CodeTabs.mjs.map +1 -1
- package/dist/components/CodeTabs/CodeTabs.styles.d.ts +27 -0
- package/dist/components/CodeTabs/CodeTabs.styles.d.ts.map +1 -0
- package/dist/components/CodeTabs/CodeTabs.styles.js +32 -0
- package/dist/components/CodeTabs/CodeTabs.styles.js.map +1 -0
- package/dist/components/CodeTabs/CodeTabs.styles.mjs +30 -0
- package/dist/components/CodeTabs/CodeTabs.styles.mjs.map +1 -0
- package/dist/components/CodeTabs/CopyButton.d.ts.map +1 -1
- package/dist/components/CodeTabs/CopyButton.js +6 -3
- package/dist/components/CodeTabs/CopyButton.js.map +1 -1
- package/dist/components/CodeTabs/CopyButton.mjs +6 -3
- package/dist/components/CodeTabs/CopyButton.mjs.map +1 -1
- package/dist/components/Confetti/Confetti.d.ts +6 -9
- package/dist/components/Confetti/Confetti.d.ts.map +1 -1
- package/dist/components/Confetti/Confetti.js +8 -42
- package/dist/components/Confetti/Confetti.js.map +1 -1
- package/dist/components/Confetti/Confetti.mjs +8 -42
- package/dist/components/Confetti/Confetti.mjs.map +1 -1
- package/dist/components/Confetti/confettiColors.d.ts +25 -0
- package/dist/components/Confetti/confettiColors.d.ts.map +1 -0
- package/dist/components/Confetti/confettiColors.js +43 -0
- package/dist/components/Confetti/confettiColors.js.map +1 -0
- package/dist/components/Confetti/confettiColors.mjs +40 -0
- package/dist/components/Confetti/confettiColors.mjs.map +1 -0
- package/dist/components/CopyableCode/CopyableCode.d.ts.map +1 -1
- package/dist/components/CopyableCode/CopyableCode.js +2 -1
- package/dist/components/CopyableCode/CopyableCode.js.map +1 -1
- package/dist/components/CopyableCode/CopyableCode.mjs +2 -1
- package/dist/components/CopyableCode/CopyableCode.mjs.map +1 -1
- package/dist/components/CountBadge/CountBadge.d.ts +41 -0
- package/dist/components/CountBadge/CountBadge.d.ts.map +1 -0
- package/dist/components/CountBadge/CountBadge.js +60 -0
- package/dist/components/CountBadge/CountBadge.js.map +1 -0
- package/dist/components/CountBadge/CountBadge.mjs +58 -0
- package/dist/components/CountBadge/CountBadge.mjs.map +1 -0
- package/dist/components/CountBadge/CountBadge.styles.d.ts +13 -0
- package/dist/components/CountBadge/CountBadge.styles.d.ts.map +1 -0
- package/dist/components/CountBadge/CountBadge.styles.js +42 -0
- package/dist/components/CountBadge/CountBadge.styles.js.map +1 -0
- package/dist/components/CountBadge/CountBadge.styles.mjs +37 -0
- package/dist/components/CountBadge/CountBadge.styles.mjs.map +1 -0
- package/dist/components/CountBadge/CountBadge.types.d.ts +33 -0
- package/dist/components/CountBadge/CountBadge.types.d.ts.map +1 -0
- package/dist/components/CountBadge/index.d.ts +3 -0
- package/dist/components/CountBadge/index.d.ts.map +1 -0
- package/dist/components/DatePicker/RangeDatePicker.js +9 -7
- package/dist/components/DatePicker/RangeDatePicker.js.map +1 -1
- package/dist/components/DatePicker/RangeDatePicker.mjs +9 -7
- package/dist/components/DatePicker/RangeDatePicker.mjs.map +1 -1
- package/dist/components/DatePicker/SingleDatePicker.js +6 -4
- package/dist/components/DatePicker/SingleDatePicker.js.map +1 -1
- package/dist/components/DatePicker/SingleDatePicker.mjs +6 -4
- package/dist/components/DatePicker/SingleDatePicker.mjs.map +1 -1
- package/dist/components/ErrorFallback/ErrorFallback.d.ts.map +1 -1
- package/dist/components/ErrorFallback/ErrorFallback.js +5 -4
- package/dist/components/ErrorFallback/ErrorFallback.js.map +1 -1
- package/dist/components/ErrorFallback/ErrorFallback.mjs +5 -4
- package/dist/components/ErrorFallback/ErrorFallback.mjs.map +1 -1
- package/dist/components/ExpandableText/ExpandableText.js +1 -1
- package/dist/components/ExpandableText/ExpandableText.js.map +1 -1
- package/dist/components/ExpandableText/ExpandableText.mjs +1 -1
- package/dist/components/ExpandableText/ExpandableText.mjs.map +1 -1
- package/dist/components/FileItem/FileItem.d.ts.map +1 -1
- package/dist/components/FileItem/FileItem.js +2 -2
- package/dist/components/FileItem/FileItem.js.map +1 -1
- package/dist/components/FileItem/FileItem.mjs +2 -2
- package/dist/components/FileItem/FileItem.mjs.map +1 -1
- package/dist/components/Form/FieldError/FieldError.d.ts +1 -1
- package/dist/components/Form/FieldError/FieldError.js +2 -2
- package/dist/components/Form/FieldError/FieldError.js.map +1 -1
- package/dist/components/Form/FieldError/FieldError.mjs +2 -2
- package/dist/components/Form/FieldError/FieldError.mjs.map +1 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.d.ts.map +1 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.js +19 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.js.map +1 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.mjs +19 -1
- package/dist/components/Form/FormModalFooter/FormModalFooter.mjs.map +1 -1
- package/dist/components/Form/FormSection/CollapsibleFormSection.js +1 -0
- package/dist/components/Form/FormSection/CollapsibleFormSection.js.map +1 -1
- package/dist/components/Form/FormSection/CollapsibleFormSection.mjs +1 -0
- package/dist/components/Form/FormSection/CollapsibleFormSection.mjs.map +1 -1
- package/dist/components/FormLabel/FormLabel.js +1 -1
- package/dist/components/FormLabel/FormLabel.js.map +1 -1
- package/dist/components/FormLabel/FormLabel.mjs +1 -1
- package/dist/components/FormLabel/FormLabel.mjs.map +1 -1
- package/dist/components/Icon/_utils/createIcon.d.ts +2 -2
- package/dist/components/Icon/_utils/createIcon.js +2 -2
- package/dist/components/Icon/_utils/createIcon.mjs +2 -2
- package/dist/components/Icon/_utils/createIconGroup.d.ts +1 -1
- package/dist/components/Icon/_utils/createIconGroup.js +1 -1
- package/dist/components/Icon/_utils/createIconGroup.mjs +1 -1
- package/dist/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.js +20 -10
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/IconButton/IconButton.mjs +20 -10
- package/dist/components/IconButton/IconButton.mjs.map +1 -1
- package/dist/components/IconButton/IconButton.styles.d.ts +24 -8
- package/dist/components/IconButton/IconButton.styles.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.styles.js +77 -11
- package/dist/components/IconButton/IconButton.styles.js.map +1 -1
- package/dist/components/IconButton/IconButton.styles.mjs +77 -13
- package/dist/components/IconButton/IconButton.styles.mjs.map +1 -1
- package/dist/components/IconButton/IconButton.types.d.ts +25 -20
- package/dist/components/IconButton/IconButton.types.d.ts.map +1 -1
- package/dist/components/IconButton/index.d.ts +1 -1
- package/dist/components/IconButton/index.d.ts.map +1 -1
- package/dist/components/InlineCode/InlineCode.js +6 -6
- package/dist/components/InlineCode/InlineCode.js.map +1 -1
- package/dist/components/InlineCode/InlineCode.mjs +6 -6
- package/dist/components/InlineCode/InlineCode.mjs.map +1 -1
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.js +12 -10
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/Input/Input.mjs +12 -10
- package/dist/components/Input/Input.mjs.map +1 -1
- package/dist/components/LineGraph/LineGraph.d.ts.map +1 -1
- package/dist/components/LineGraph/LineGraph.js +28 -8
- package/dist/components/LineGraph/LineGraph.js.map +1 -1
- package/dist/components/LineGraph/LineGraph.mjs +28 -8
- package/dist/components/LineGraph/LineGraph.mjs.map +1 -1
- package/dist/components/LineGraph/seriesColors.d.ts +22 -0
- package/dist/components/LineGraph/seriesColors.d.ts.map +1 -0
- package/dist/components/LineGraph/seriesColors.js +26 -0
- package/dist/components/LineGraph/seriesColors.js.map +1 -0
- package/dist/components/LineGraph/seriesColors.mjs +23 -0
- package/dist/components/LineGraph/seriesColors.mjs.map +1 -0
- package/dist/components/Loaders/LoaderStatus.d.ts +21 -0
- package/dist/components/Loaders/LoaderStatus.d.ts.map +1 -0
- package/dist/components/Loaders/LoaderStatus.js +29 -0
- package/dist/components/Loaders/LoaderStatus.js.map +1 -0
- package/dist/components/Loaders/LoaderStatus.mjs +27 -0
- package/dist/components/Loaders/LoaderStatus.mjs.map +1 -0
- package/dist/components/Loaders/Loaders.styles.d.ts +21 -0
- package/dist/components/Loaders/Loaders.styles.d.ts.map +1 -0
- package/dist/components/Loaders/Loaders.styles.js +33 -0
- package/dist/components/Loaders/Loaders.styles.js.map +1 -0
- package/dist/components/Loaders/Loaders.styles.mjs +29 -0
- package/dist/components/Loaders/Loaders.styles.mjs.map +1 -0
- package/dist/components/Loaders/Loaders.translations.json.js +19 -0
- package/dist/components/Loaders/Loaders.translations.json.js.map +1 -0
- package/dist/components/Loaders/Loaders.translations.json.mjs +14 -0
- package/dist/components/Loaders/Loaders.translations.json.mjs.map +1 -0
- package/dist/components/Loaders/PageLoader.d.ts +10 -2
- package/dist/components/Loaders/PageLoader.d.ts.map +1 -1
- package/dist/components/Loaders/PageLoader.js +6 -3
- package/dist/components/Loaders/PageLoader.js.map +1 -1
- package/dist/components/Loaders/PageLoader.mjs +7 -4
- package/dist/components/Loaders/PageLoader.mjs.map +1 -1
- package/dist/components/Loaders/SectionLoader.d.ts +2 -4
- package/dist/components/Loaders/SectionLoader.d.ts.map +1 -1
- package/dist/components/Loaders/SectionLoader.js +5 -2
- package/dist/components/Loaders/SectionLoader.js.map +1 -1
- package/dist/components/Loaders/SectionLoader.mjs +6 -3
- package/dist/components/Loaders/SectionLoader.mjs.map +1 -1
- package/dist/components/Loaders/ThinkingDots.d.ts +10 -0
- package/dist/components/Loaders/ThinkingDots.d.ts.map +1 -0
- package/dist/components/Loaders/ThinkingDots.js +20 -0
- package/dist/components/Loaders/ThinkingDots.js.map +1 -0
- package/dist/components/Loaders/ThinkingDots.mjs +18 -0
- package/dist/components/Loaders/ThinkingDots.mjs.map +1 -0
- package/dist/components/Loaders/index.d.ts +2 -1
- package/dist/components/Loaders/index.d.ts.map +1 -1
- package/dist/components/LogicianProvider/LogicianProvider.d.ts +12 -0
- package/dist/components/LogicianProvider/LogicianProvider.d.ts.map +1 -1
- package/dist/components/LogicianProvider/LogicianProvider.js +15 -5
- package/dist/components/LogicianProvider/LogicianProvider.js.map +1 -1
- package/dist/components/LogicianProvider/LogicianProvider.mjs +16 -6
- package/dist/components/LogicianProvider/LogicianProvider.mjs.map +1 -1
- package/dist/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/components/Menu/MenuItem.js +10 -6
- package/dist/components/Menu/MenuItem.js.map +1 -1
- package/dist/components/Menu/MenuItem.mjs +10 -6
- package/dist/components/Menu/MenuItem.mjs.map +1 -1
- package/dist/components/Menu/MenuList.js +1 -1
- package/dist/components/Menu/MenuList.js.map +1 -1
- package/dist/components/Menu/MenuList.mjs +1 -1
- package/dist/components/Menu/MenuList.mjs.map +1 -1
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +2 -2
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Modal/Modal.mjs +2 -2
- package/dist/components/Modal/Modal.mjs.map +1 -1
- package/dist/components/Modal/Modal.types.d.ts +12 -0
- package/dist/components/Modal/Modal.types.d.ts.map +1 -1
- package/dist/components/Modal/ModalContext.d.ts +2 -0
- package/dist/components/Modal/ModalContext.d.ts.map +1 -1
- package/dist/components/Modal/ModalContext.js +1 -0
- package/dist/components/Modal/ModalContext.js.map +1 -1
- package/dist/components/Modal/ModalContext.mjs +1 -0
- package/dist/components/Modal/ModalContext.mjs.map +1 -1
- package/dist/components/Modal/ModalHeader.d.ts +20 -1
- package/dist/components/Modal/ModalHeader.d.ts.map +1 -1
- package/dist/components/Modal/ModalHeader.js +46 -2
- package/dist/components/Modal/ModalHeader.js.map +1 -1
- package/dist/components/Modal/ModalHeader.mjs +47 -3
- package/dist/components/Modal/ModalHeader.mjs.map +1 -1
- package/dist/components/Modal/index.d.ts +2 -2
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/MonthPicker/MonthButton/MonthButton.d.ts.map +1 -1
- package/dist/components/MonthPicker/MonthButton/MonthButton.js +10 -9
- package/dist/components/MonthPicker/MonthButton/MonthButton.js.map +1 -1
- package/dist/components/MonthPicker/MonthButton/MonthButton.mjs +10 -9
- package/dist/components/MonthPicker/MonthButton/MonthButton.mjs.map +1 -1
- package/dist/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.js +1 -1
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/Pagination/Pagination.mjs +1 -1
- package/dist/components/Pagination/Pagination.mjs.map +1 -1
- package/dist/components/PinInput/PinInput.d.ts.map +1 -1
- package/dist/components/PinInput/PinInput.js +5 -1
- package/dist/components/PinInput/PinInput.js.map +1 -1
- package/dist/components/PinInput/PinInput.mjs +5 -1
- package/dist/components/PinInput/PinInput.mjs.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.js +1 -1
- package/dist/components/ProgressBar/ProgressBar.mjs +1 -1
- package/dist/components/RadialProgress/RadialProgress.d.ts.map +1 -1
- package/dist/components/RadialProgress/RadialProgress.js +4 -7
- package/dist/components/RadialProgress/RadialProgress.js.map +1 -1
- package/dist/components/RadialProgress/RadialProgress.mjs +4 -7
- package/dist/components/RadialProgress/RadialProgress.mjs.map +1 -1
- package/dist/components/RadialProgress/RadialProgress.types.d.ts +1 -1
- package/dist/components/RadialProgress/RadialProgress.types.d.ts.map +1 -1
- package/dist/components/Radio/RadioControl.d.ts.map +1 -1
- package/dist/components/Radio/RadioControl.js +26 -5
- package/dist/components/Radio/RadioControl.js.map +1 -1
- package/dist/components/Radio/RadioControl.mjs +26 -5
- package/dist/components/Radio/RadioControl.mjs.map +1 -1
- package/dist/components/Radio/RadioGroup.js +1 -1
- package/dist/components/Radio/RadioGroup.js.map +1 -1
- package/dist/components/Radio/RadioGroup.mjs +1 -1
- package/dist/components/Radio/RadioGroup.mjs.map +1 -1
- package/dist/components/SeeMoreButton/SeeMoreButton.d.ts.map +1 -1
- package/dist/components/SeeMoreButton/SeeMoreButton.js +8 -3
- package/dist/components/SeeMoreButton/SeeMoreButton.js.map +1 -1
- package/dist/components/SeeMoreButton/SeeMoreButton.mjs +8 -3
- package/dist/components/SeeMoreButton/SeeMoreButton.mjs.map +1 -1
- package/dist/components/SeeMoreButton/SeeMoreButton.styles.d.ts +20 -10
- package/dist/components/SeeMoreButton/SeeMoreButton.styles.d.ts.map +1 -1
- package/dist/components/SeeMoreButton/SeeMoreButton.styles.js +13 -5
- package/dist/components/SeeMoreButton/SeeMoreButton.styles.js.map +1 -1
- package/dist/components/SeeMoreButton/SeeMoreButton.styles.mjs +13 -5
- package/dist/components/SeeMoreButton/SeeMoreButton.styles.mjs.map +1 -1
- package/dist/components/SeeMoreButton/SeeMoreButton.types.d.ts +6 -2
- package/dist/components/SeeMoreButton/SeeMoreButton.types.d.ts.map +1 -1
- package/dist/components/Select/Select.styles.d.ts +13 -12
- package/dist/components/Select/Select.styles.d.ts.map +1 -1
- package/dist/components/Select/Select.styles.js +20 -14
- package/dist/components/Select/Select.styles.js.map +1 -1
- package/dist/components/Select/Select.styles.mjs +20 -14
- package/dist/components/Select/Select.styles.mjs.map +1 -1
- package/dist/components/Slider/SliderThumb/SliderThumb.js +1 -1
- package/dist/components/Slider/SliderThumb/SliderThumb.js.map +1 -1
- package/dist/components/Slider/SliderThumb/SliderThumb.mjs +1 -1
- package/dist/components/Slider/SliderThumb/SliderThumb.mjs.map +1 -1
- package/dist/components/Slider/SliderThumbs/SliderThumbs.js +1 -1
- package/dist/components/Slider/SliderThumbs/SliderThumbs.js.map +1 -1
- package/dist/components/Slider/SliderThumbs/SliderThumbs.mjs +1 -1
- package/dist/components/Slider/SliderThumbs/SliderThumbs.mjs.map +1 -1
- package/dist/components/Switch/SwitchControl.d.ts.map +1 -1
- package/dist/components/Switch/SwitchControl.js +8 -2
- package/dist/components/Switch/SwitchControl.js.map +1 -1
- package/dist/components/Switch/SwitchControl.mjs +8 -2
- package/dist/components/Switch/SwitchControl.mjs.map +1 -1
- package/dist/components/Table/Table.types.d.ts +1 -1
- package/dist/components/Tabs/Tab/Tab.d.ts.map +1 -1
- package/dist/components/Tabs/Tab/Tab.js +1 -1
- package/dist/components/Tabs/Tab/Tab.js.map +1 -1
- package/dist/components/Tabs/Tab/Tab.mjs +1 -1
- package/dist/components/Tabs/Tab/Tab.mjs.map +1 -1
- package/dist/components/Tabs/Tab/Tab.styles.d.ts +10 -12
- package/dist/components/Tabs/Tab/Tab.styles.d.ts.map +1 -1
- package/dist/components/Tabs/Tab/Tab.styles.js +8 -10
- package/dist/components/Tabs/Tab/Tab.styles.js.map +1 -1
- package/dist/components/Tabs/Tab/Tab.styles.mjs +8 -10
- package/dist/components/Tabs/Tab/Tab.styles.mjs.map +1 -1
- package/dist/components/Tag/Tag.d.ts.map +1 -1
- package/dist/components/Tag/Tag.js +41 -14
- package/dist/components/Tag/Tag.js.map +1 -1
- package/dist/components/Tag/Tag.mjs +43 -16
- package/dist/components/Tag/Tag.mjs.map +1 -1
- package/dist/components/Tag/Tag.styles.d.ts +55 -17
- package/dist/components/Tag/Tag.styles.d.ts.map +1 -1
- package/dist/components/Tag/Tag.styles.js +148 -128
- package/dist/components/Tag/Tag.styles.js.map +1 -1
- package/dist/components/Tag/Tag.styles.mjs +145 -126
- package/dist/components/Tag/Tag.styles.mjs.map +1 -1
- package/dist/components/Tag/Tag.types.d.ts +50 -29
- package/dist/components/Tag/Tag.types.d.ts.map +1 -1
- package/dist/components/Tag/TagCloseButton/TagCloseButton.d.ts +5 -0
- package/dist/components/Tag/TagCloseButton/TagCloseButton.d.ts.map +1 -1
- package/dist/components/Tag/TagCloseButton/TagCloseButton.js +7 -1
- package/dist/components/Tag/TagCloseButton/TagCloseButton.js.map +1 -1
- package/dist/components/Tag/TagCloseButton/TagCloseButton.mjs +7 -1
- package/dist/components/Tag/TagCloseButton/TagCloseButton.mjs.map +1 -1
- package/dist/components/Tag/index.d.ts +3 -2
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.js +12 -10
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Textarea/Textarea.mjs +12 -10
- package/dist/components/Textarea/Textarea.mjs.map +1 -1
- package/dist/components/Toast/Toast.js +1 -1
- package/dist/components/Toast/Toast.mjs +1 -1
- package/dist/components/Toast/Toast.styles.d.ts +5 -3
- package/dist/components/Toast/Toast.styles.d.ts.map +1 -1
- package/dist/components/Toast/Toast.styles.js +54 -35
- package/dist/components/Toast/Toast.styles.js.map +1 -1
- package/dist/components/Toast/Toast.styles.mjs +54 -35
- package/dist/components/Toast/Toast.styles.mjs.map +1 -1
- package/dist/components/Toast/Toast.types.d.ts +8 -1
- package/dist/components/Toast/Toast.types.d.ts.map +1 -1
- package/dist/components/Toast/ToastIcon/ToastIcon.d.ts.map +1 -1
- package/dist/components/Toast/ToastIcon/ToastIcon.js +6 -4
- package/dist/components/Toast/ToastIcon/ToastIcon.js.map +1 -1
- package/dist/components/Toast/ToastIcon/ToastIcon.mjs +6 -4
- package/dist/components/Toast/ToastIcon/ToastIcon.mjs.map +1 -1
- package/dist/components/Toast/Toaster.d.ts.map +1 -1
- package/dist/components/Toast/Toaster.js +12 -1
- package/dist/components/Toast/Toaster.js.map +1 -1
- package/dist/components/Toast/Toaster.mjs +12 -1
- package/dist/components/Toast/Toaster.mjs.map +1 -1
- package/dist/components/Toast/useToast.d.ts +2 -2
- package/dist/components/Toast/useToast.d.ts.map +1 -1
- package/dist/components/Toast/useToast.js +42 -8
- package/dist/components/Toast/useToast.js.map +1 -1
- package/dist/components/Toast/useToast.mjs +43 -9
- package/dist/components/Toast/useToast.mjs.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +2 -2
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.mjs +2 -2
- package/dist/components/Tooltip/Tooltip.mjs.map +1 -1
- package/dist/components/Tree/TreeBranchControl.js +1 -1
- package/dist/components/Tree/TreeBranchControl.js.map +1 -1
- package/dist/components/Tree/TreeBranchControl.mjs +1 -1
- package/dist/components/Tree/TreeBranchControl.mjs.map +1 -1
- package/dist/components/Tree/TreeItem.js +1 -1
- package/dist/components/Tree/TreeItem.js.map +1 -1
- package/dist/components/Tree/TreeItem.mjs +1 -1
- package/dist/components/Tree/TreeItem.mjs.map +1 -1
- package/dist/components/Typography/Caption.js +5 -5
- package/dist/components/Typography/Caption.js.map +1 -1
- package/dist/components/Typography/Caption.mjs +5 -5
- package/dist/components/Typography/Caption.mjs.map +1 -1
- package/dist/components/Typography/Link.d.ts +10 -16
- package/dist/components/Typography/Link.d.ts.map +1 -1
- package/dist/components/Typography/Link.js +24 -29
- package/dist/components/Typography/Link.js.map +1 -1
- package/dist/components/Typography/Link.mjs +24 -29
- package/dist/components/Typography/Link.mjs.map +1 -1
- package/dist/components/Typography/Overline.js +2 -2
- package/dist/components/Typography/Overline.js.map +1 -1
- package/dist/components/Typography/Overline.mjs +2 -2
- package/dist/components/Typography/Overline.mjs.map +1 -1
- package/dist/components/Workflow/Workflow.js +1 -1
- package/dist/components/Workflow/Workflow.js.map +1 -1
- package/dist/components/Workflow/Workflow.mjs +1 -1
- package/dist/components/Workflow/Workflow.mjs.map +1 -1
- package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.d.ts.map +1 -1
- package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.js +7 -6
- package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.js.map +1 -1
- package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.mjs +7 -6
- package/dist/components/Workflow/canvas/Canvas/BranchLabelBadge.mjs.map +1 -1
- package/dist/components/Workflow/canvas/Canvas/Canvas.js +8 -8
- package/dist/components/Workflow/canvas/Canvas/Canvas.js.map +1 -1
- package/dist/components/Workflow/canvas/Canvas/Canvas.mjs +8 -8
- package/dist/components/Workflow/canvas/Canvas/Canvas.mjs.map +1 -1
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.d.ts +2 -2
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.d.ts.map +1 -1
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.js +13 -12
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.js.map +1 -1
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.mjs +13 -12
- package/dist/components/Workflow/canvas/Canvas/Canvas.styles.mjs.map +1 -1
- package/dist/components/Workflow/canvas/Canvas/LabeledEdge.js +1 -1
- package/dist/components/Workflow/canvas/Canvas/LabeledEdge.js.map +1 -1
- package/dist/components/Workflow/canvas/Canvas/LabeledEdge.mjs +1 -1
- package/dist/components/Workflow/canvas/Canvas/LabeledEdge.mjs.map +1 -1
- package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.js +1 -1
- package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.js.map +1 -1
- package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.mjs +1 -1
- package/dist/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.mjs.map +1 -1
- package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.d.ts.map +1 -1
- package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.js +1 -1
- package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.js.map +1 -1
- package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.mjs +1 -1
- package/dist/components/Workflow/canvas/DrawerShell/DrawerHeader.mjs.map +1 -1
- package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.js +2 -2
- package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.js.map +1 -1
- package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.mjs +2 -2
- package/dist/components/Workflow/canvas/DrawerShell/DrawerIssues.mjs.map +1 -1
- package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.js +5 -4
- package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.js.map +1 -1
- package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.mjs +5 -4
- package/dist/components/Workflow/canvas/DrawerShell/DrawerShell.mjs.map +1 -1
- package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.js +2 -2
- package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.js.map +1 -1
- package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.mjs +2 -2
- package/dist/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.mjs.map +1 -1
- package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.js.map +1 -1
- package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.mjs +1 -1
- package/dist/components/Workflow/canvas/FieldWrapper/FieldWrapper.mjs.map +1 -1
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.js +1 -1
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.js.map +1 -1
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.mjs +1 -1
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.mjs.map +1 -1
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.d.ts +11 -3
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.d.ts.map +1 -1
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.js +29 -13
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.js.map +1 -1
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.mjs +29 -13
- package/dist/components/Workflow/canvas/IconTile/IconTile.styles.mjs.map +1 -1
- package/dist/components/Workflow/canvas/IssueList/IssueList.js +2 -2
- package/dist/components/Workflow/canvas/IssueList/IssueList.js.map +1 -1
- package/dist/components/Workflow/canvas/IssueList/IssueList.mjs +2 -2
- package/dist/components/Workflow/canvas/IssueList/IssueList.mjs.map +1 -1
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.d.ts.map +1 -1
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.js +2 -2
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.js.map +1 -1
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.mjs +2 -2
- package/dist/components/Workflow/canvas/NodePalette/NodePalette.mjs.map +1 -1
- package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.d.ts.map +1 -1
- package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.js +1 -1
- package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.js.map +1 -1
- package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.mjs +1 -1
- package/dist/components/Workflow/canvas/NodePalette/NodePaletteToggle.mjs.map +1 -1
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.d.ts.map +1 -1
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.js +42 -32
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.js.map +1 -1
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.mjs +42 -32
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.mjs.map +1 -1
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.d.ts +9 -4
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.d.ts.map +1 -1
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.js +8 -8
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.js.map +1 -1
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.mjs +7 -7
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.styles.mjs.map +1 -1
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.types.d.ts +2 -0
- package/dist/components/Workflow/canvas/NodeShell/NodeShell.types.d.ts.map +1 -1
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.d.ts +5 -4
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.d.ts.map +1 -1
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.js +1 -1
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.js.map +1 -1
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.mjs +1 -1
- package/dist/components/Workflow/canvas/SeverityDot/SeverityDot.mjs.map +1 -1
- package/dist/components/Workflow/canvas/colorVar.d.ts +20 -0
- package/dist/components/Workflow/canvas/colorVar.d.ts.map +1 -0
- package/dist/components/Workflow/canvas/colorVar.js +32 -0
- package/dist/components/Workflow/canvas/colorVar.js.map +1 -0
- package/dist/components/Workflow/canvas/colorVar.mjs +29 -0
- package/dist/components/Workflow/canvas/colorVar.mjs.map +1 -0
- package/dist/components/Workflow/canvas/issueSeverity.d.ts +6 -4
- package/dist/components/Workflow/canvas/issueSeverity.d.ts.map +1 -1
- package/dist/components/Workflow/canvas/issueSeverity.js +6 -4
- package/dist/components/Workflow/canvas/issueSeverity.js.map +1 -1
- package/dist/components/Workflow/canvas/issueSeverity.mjs +6 -4
- package/dist/components/Workflow/canvas/issueSeverity.mjs.map +1 -1
- package/dist/components/Workflow/canvas/workflowLabelProps.d.ts +1 -1
- package/dist/components/Workflow/canvas/workflowLabelProps.js +1 -1
- package/dist/components/Workflow/canvas/workflowLabelProps.mjs +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -8
- package/dist/index.mjs.map +1 -1
- package/dist/theme/colors.d.ts +43 -1139
- package/dist/theme/colors.d.ts.map +1 -1
- package/dist/theme/colors.js +336 -760
- package/dist/theme/colors.js.map +1 -1
- package/dist/theme/colors.mjs +334 -761
- package/dist/theme/colors.mjs.map +1 -1
- package/dist/theme/deprecatedColorTokens.json.js +69 -0
- package/dist/theme/deprecatedColorTokens.json.js.map +1 -0
- package/dist/theme/deprecatedColorTokens.json.mjs +64 -0
- package/dist/theme/deprecatedColorTokens.json.mjs.map +1 -0
- package/dist/theme/global.d.ts +3 -2
- package/dist/theme/global.d.ts.map +1 -1
- package/dist/theme/global.js +12 -18
- package/dist/theme/global.js.map +1 -1
- package/dist/theme/global.mjs +12 -18
- package/dist/theme/global.mjs.map +1 -1
- package/dist/theme/index.d.ts +34 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +143 -81
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +144 -84
- package/dist/theme/index.mjs.map +1 -1
- package/dist/theme/palette.generated.d.ts +887 -0
- package/dist/theme/palette.generated.d.ts.map +1 -0
- package/dist/theme/palette.generated.js +898 -0
- package/dist/theme/palette.generated.js.map +1 -0
- package/dist/theme/palette.generated.mjs +893 -0
- package/dist/theme/palette.generated.mjs.map +1 -0
- package/dist/theme/paletteSwatches.d.ts +22 -0
- package/dist/theme/paletteSwatches.d.ts.map +1 -0
- package/dist/theme/recipes/table.js +2 -2
- package/dist/theme/recipes/table.js.map +1 -1
- package/dist/theme/recipes/table.mjs +2 -2
- package/dist/theme/recipes/table.mjs.map +1 -1
- package/dist/utils/disabledControl.d.ts +27 -0
- package/dist/utils/disabledControl.d.ts.map +1 -0
- package/dist/utils/disabledControl.js +33 -0
- package/dist/utils/disabledControl.js.map +1 -0
- package/dist/utils/disabledControl.mjs +30 -0
- package/dist/utils/disabledControl.mjs.map +1 -0
- package/dist/utils/focusRing.d.ts +7 -1
- package/dist/utils/focusRing.d.ts.map +1 -1
- package/dist/utils/focusRing.js +8 -1
- package/dist/utils/focusRing.js.map +1 -1
- package/dist/utils/focusRing.mjs +8 -2
- package/dist/utils/focusRing.mjs.map +1 -1
- package/dist/utils/isDev.d.ts +22 -0
- package/dist/utils/isDev.d.ts.map +1 -0
- package/dist/utils/isDev.js +34 -0
- package/dist/utils/isDev.js.map +1 -0
- package/dist/utils/isDev.mjs +32 -0
- package/dist/utils/isDev.mjs.map +1 -0
- package/eslint/index.js +28 -0
- package/eslint/rules/no-deprecated-tokens.js +128 -0
- package/eslint/rules/no-deprecated-tokens.test.ts +130 -0
- package/package.json +16 -7
- package/src/components/Accordion/Accordion.stories.tsx +20 -12
- package/src/components/Appear/Appear.stories.tsx +6 -13
- package/src/components/Avatar/Avatar.hue.test.ts +67 -0
- package/src/components/Avatar/Avatar.stories.tsx +79 -23
- package/src/components/Avatar/Avatar.tsx +56 -2
- package/src/components/Avatar/index.tsx +1 -1
- package/src/components/Badge/Badge.stories.tsx +24 -50
- package/src/components/Badge/Badge.styles.ts +56 -50
- package/src/components/Badge/Badge.tsx +11 -7
- package/src/components/Badge/Badge.types.ts +18 -14
- package/src/components/Badge/index.ts +7 -1
- package/src/components/Banner/Banner.stories.tsx +10 -3
- package/src/components/Banner/Banner.styles.ts +43 -27
- package/src/components/Banner/Banner.types.ts +1 -1
- package/src/components/BottomSheet/BottomSheet.stories.tsx +3 -4
- package/src/components/BottomSheet/BottomSheetCloseButton.tsx +0 -1
- package/src/components/Breadcrumb/BreadcrumbLink/BreadcrumbLink.tsx +1 -1
- package/src/components/Button/Button.legacy.ts +181 -0
- package/src/components/Button/Button.lift.test.tsx +6 -14
- package/src/components/Button/Button.press.test.tsx +20 -15
- package/src/components/Button/Button.stories.tsx +140 -346
- package/src/components/Button/Button.styles.ts +158 -392
- package/src/components/Button/Button.tsx +49 -17
- package/src/components/Button/Button.types.ts +53 -37
- package/src/components/Button/Button.variants.test.tsx +158 -0
- package/src/components/Button/index.tsx +2 -0
- package/src/components/Card/Card.styles.ts +6 -13
- package/src/components/Card/Card.tsx +1 -6
- package/src/components/Card/Card.types.ts +1 -5
- package/src/components/Checkbox/CheckboxControl.tsx +17 -10
- package/src/components/Chip/Chip.stories.tsx +17 -230
- package/src/components/Chip/Chip.tsx +40 -24
- package/src/components/Chip/Chip.types.ts +38 -26
- package/src/components/Chip/index.ts +0 -6
- package/src/components/Code/Code.tsx +2 -3
- package/src/components/CodeTabs/CodeTabs.contrast.test.tsx +109 -0
- package/src/components/CodeTabs/CodeTabs.styles.ts +26 -0
- package/src/components/CodeTabs/CodeTabs.tsx +16 -4
- package/src/components/CodeTabs/CopyButton.tsx +6 -4
- package/src/components/Confetti/Confetti.stories.tsx +1 -1
- package/src/components/Confetti/Confetti.tsx +8 -43
- package/src/components/Confetti/confettiColors.test.ts +47 -0
- package/src/components/Confetti/confettiColors.ts +41 -0
- package/src/components/Container/Container.stories.tsx +1 -1
- package/src/components/CopyableCode/CopyableCode.tsx +1 -2
- package/src/components/CountBadge/CountBadge.stories.tsx +109 -0
- package/src/components/CountBadge/CountBadge.styles.ts +40 -0
- package/src/components/CountBadge/CountBadge.test.tsx +57 -0
- package/src/components/CountBadge/CountBadge.tsx +112 -0
- package/src/components/CountBadge/CountBadge.types.ts +34 -0
- package/src/components/CountBadge/index.ts +2 -0
- package/src/components/DatePicker/RangeDatePicker.tsx +8 -8
- package/src/components/DatePicker/SingleDatePicker.tsx +5 -5
- package/src/components/ErrorFallback/ErrorFallback.lift.test.tsx +45 -0
- package/src/components/ErrorFallback/ErrorFallback.tsx +16 -31
- package/src/components/ExpandableText/ExpandableText.tsx +1 -1
- package/src/components/FileItem/FileItem.tsx +1 -4
- package/src/components/FlyTo/FlyTo.stories.tsx +6 -1
- package/src/components/Form/FieldError/FieldError.tsx +2 -2
- package/src/components/Form/FormFooter/FormFooter.stories.tsx +4 -4
- package/src/components/Form/FormModalFooter/FormModalFooter.tsx +5 -6
- package/src/components/Form/FormSection/FormSection.stories.tsx +1 -1
- package/src/components/FormIntegration/FormIntegration.stories.tsx +4 -4
- package/src/components/FormLabel/FormLabel.tsx +1 -1
- package/src/components/Icon/ICON_MANAGEMENT.md +7 -7
- package/src/components/Icon/Icon.stories.tsx +220 -116
- package/src/components/Icon/_utils/createIcon.tsx +2 -2
- package/src/components/Icon/_utils/createIconGroup.tsx +1 -1
- package/src/components/IconButton/IconButton.stories.tsx +63 -216
- package/src/components/IconButton/IconButton.styles.ts +104 -27
- package/src/components/IconButton/IconButton.tsx +39 -12
- package/src/components/IconButton/IconButton.types.ts +30 -20
- package/src/components/IconButton/index.tsx +1 -0
- package/src/components/InlineCode/InlineCode.tsx +6 -6
- package/src/components/Input/Input.stories.tsx +10 -10
- package/src/components/Input/Input.tsx +12 -10
- package/src/components/LineGraph/LineGraph.tsx +24 -6
- package/src/components/LineGraph/seriesColors.test.ts +40 -0
- package/src/components/LineGraph/seriesColors.ts +42 -0
- package/src/components/Loaders/LoaderStatus.tsx +25 -0
- package/src/components/Loaders/Loaders.styles.ts +28 -0
- package/src/components/Loaders/Loaders.test.tsx +63 -0
- package/src/components/Loaders/Loaders.translations.json +9 -0
- package/src/components/Loaders/PageLoader.stories.tsx +15 -1
- package/src/components/Loaders/PageLoader.tsx +28 -4
- package/src/components/Loaders/SectionLoader.stories.tsx +10 -3
- package/src/components/Loaders/SectionLoader.tsx +16 -3
- package/src/components/Loaders/ThinkingDots.tsx +27 -0
- package/src/components/Loaders/index.ts +2 -1
- package/src/components/LogicianProvider/LogicianProvider.stories.tsx +28 -43
- package/src/components/LogicianProvider/LogicianProvider.tsx +35 -5
- package/src/components/Masonry/Masonry.stories.tsx +17 -5
- package/src/components/Menu/Menu.stories.tsx +58 -20
- package/src/components/Menu/MenuItem.highlight.test.tsx +72 -0
- package/src/components/Menu/MenuItem.tsx +9 -6
- package/src/components/Menu/MenuList.tsx +1 -1
- package/src/components/Modal/Modal.stories.tsx +76 -25
- package/src/components/Modal/Modal.tsx +5 -1
- package/src/components/Modal/Modal.types.ts +13 -0
- package/src/components/Modal/ModalContext.ts +4 -0
- package/src/components/Modal/ModalHeader.a11y.test.tsx +51 -0
- package/src/components/Modal/ModalHeader.tsx +73 -3
- package/src/components/Modal/index.tsx +2 -2
- package/src/components/MonthPicker/MonthButton/MonthButton.tsx +9 -14
- package/src/components/MonthPicker/MonthPicker.stories.tsx +13 -9
- package/src/components/Pagination/Pagination.stories.tsx +5 -6
- package/src/components/Pagination/Pagination.tsx +0 -2
- package/src/components/PinInput/PinInput.tsx +9 -5
- package/src/components/Popover/Popover.stories.tsx +5 -5
- package/src/components/ProgressBar/ProgressBar.tsx +1 -1
- package/src/components/Pulse/Pulse.stories.tsx +1 -1
- package/src/components/RadialProgress/RadialProgress.tsx +4 -7
- package/src/components/RadialProgress/RadialProgress.types.ts +1 -1
- package/src/components/Radio/Radio.stories.tsx +1 -1
- package/src/components/Radio/RadioControl.indicator.test.tsx +72 -0
- package/src/components/Radio/RadioControl.tsx +34 -6
- package/src/components/Radio/RadioGroup.tsx +1 -1
- package/src/components/Reveal/Reveal.stories.tsx +5 -1
- package/src/components/ScaledContext/ScaledContext.stories.tsx +21 -14
- package/src/components/SeeMoreButton/SeeMoreButton.border.test.tsx +51 -0
- package/src/components/SeeMoreButton/SeeMoreButton.stories.tsx +8 -0
- package/src/components/SeeMoreButton/SeeMoreButton.styles.ts +14 -6
- package/src/components/SeeMoreButton/SeeMoreButton.tsx +11 -2
- package/src/components/SeeMoreButton/SeeMoreButton.types.ts +9 -2
- package/src/components/SegmentedProgressBar/SegmentedProgressBar.stories.tsx +48 -31
- package/src/components/Select/Combobox.stories.tsx +1 -1
- package/src/components/Select/Comparison.stories.tsx +1 -1
- package/src/components/Select/Select.stories.tsx +22 -22
- package/src/components/Select/Select.styles.ts +20 -14
- package/src/components/Shake/Shake.stories.tsx +10 -12
- package/src/components/Slider/Slider.stories.tsx +43 -9
- package/src/components/Slider/SliderThumb/SliderThumb.tsx +1 -1
- package/src/components/Slider/SliderThumbs/SliderThumbs.tsx +1 -1
- package/src/components/SwapTransition/SwapTransition.stories.tsx +3 -4
- package/src/components/Switch/SwitchControl.tsx +8 -0
- package/src/components/Table/Table.stories.tsx +36 -20
- package/src/components/Table/Table.types.ts +1 -1
- package/src/components/Tabs/Tab/Tab.styles.ts +8 -10
- package/src/components/Tabs/Tab/Tab.tsx +1 -0
- package/src/components/Tabs/Tabs.stories.tsx +38 -26
- package/src/components/Tag/Tag.legacy.test.tsx +179 -0
- package/src/components/Tag/Tag.stories.tsx +107 -148
- package/src/components/Tag/Tag.styles.ts +186 -135
- package/src/components/Tag/Tag.test.tsx +115 -0
- package/src/components/Tag/Tag.tsx +103 -21
- package/src/components/Tag/Tag.types.ts +52 -29
- package/src/components/Tag/TagCloseButton/TagCloseButton.tsx +19 -1
- package/src/components/Tag/index.ts +5 -3
- package/src/components/Textarea/Textarea.stories.tsx +6 -1
- package/src/components/Textarea/Textarea.tsx +13 -11
- package/src/components/Toast/Toast.action.test.tsx +13 -0
- package/src/components/Toast/Toast.stories.tsx +17 -7
- package/src/components/Toast/Toast.styles.ts +54 -35
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/components/Toast/Toast.types.ts +9 -1
- package/src/components/Toast/Toast.update.test.tsx +124 -0
- package/src/components/Toast/ToastIcon/ToastIcon.tsx +6 -4
- package/src/components/Toast/Toaster.tsx +14 -2
- package/src/components/Toast/useToast.tsx +54 -14
- package/src/components/Tooltip/Tooltip.stories.tsx +12 -12
- package/src/components/Tooltip/Tooltip.tsx +2 -2
- package/src/components/Tree/Tree.GuideElbow.stories.tsx +2 -2
- package/src/components/Tree/TreeBranchControl.tsx +1 -1
- package/src/components/Tree/TreeBranchIndentGuide.test.tsx +2 -2
- package/src/components/Tree/TreeItem.tsx +1 -1
- package/src/components/Typography/Caption.tsx +5 -5
- package/src/components/Typography/Link.tsx +27 -29
- package/src/components/Typography/Overline.tsx +2 -2
- package/src/components/Workflow/README.md +58 -52
- package/src/components/Workflow/Workflow.translations.json +1 -1
- package/src/components/Workflow/Workflow.tsx +1 -1
- package/src/components/Workflow/canvas/Canvas/BranchLabelBadge.tsx +7 -6
- package/src/components/Workflow/canvas/Canvas/Canvas.styles.ts +14 -12
- package/src/components/Workflow/canvas/Canvas/Canvas.tsx +9 -9
- package/src/components/Workflow/canvas/Canvas/LabeledEdge.tsx +2 -2
- package/src/components/Workflow/canvas/CollapsibleSection/CollapsibleSection.tsx +4 -4
- package/src/components/Workflow/canvas/DrawerShell/DrawerHeader.tsx +2 -4
- package/src/components/Workflow/canvas/DrawerShell/DrawerIssues.tsx +2 -2
- package/src/components/Workflow/canvas/DrawerShell/DrawerShell.tsx +6 -6
- package/src/components/Workflow/canvas/EdgeInspector/BuiltInEdgeInspector.tsx +4 -4
- package/src/components/Workflow/canvas/FieldWrapper/FieldWrapper.tsx +2 -2
- package/src/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.tsx +12 -12
- package/src/components/Workflow/canvas/IconTile/IconTile.styles.ts +29 -13
- package/src/components/Workflow/canvas/IssueList/IssueList.tsx +3 -3
- package/src/components/Workflow/canvas/NodePalette/NodePalette.tsx +6 -7
- package/src/components/Workflow/canvas/NodePalette/NodePaletteToggle.tsx +1 -2
- package/src/components/Workflow/canvas/NodeShell/NodeShell.styles.ts +6 -8
- package/src/components/Workflow/canvas/NodeShell/NodeShell.test.tsx +79 -0
- package/src/components/Workflow/canvas/NodeShell/NodeShell.tsx +46 -37
- package/src/components/Workflow/canvas/NodeShell/NodeShell.types.ts +2 -0
- package/src/components/Workflow/canvas/SeverityDot/SeverityDot.tsx +6 -5
- package/src/components/Workflow/canvas/canvasStroke.test.ts +84 -0
- package/src/components/Workflow/canvas/colorVar.ts +26 -0
- package/src/components/Workflow/canvas/issueSeverity.ts +7 -5
- package/src/components/Workflow/canvas/workflowLabelProps.ts +1 -1
- package/src/components/Workflow/stories/Workflow.stories.tsx +4 -5
- package/src/components/a11y.kwcag.test.tsx +64 -83
- package/src/components/claude.md +40 -58
- package/src/components/noRawScales.test.ts +152 -0
- package/src/components/noSandBackground.test.ts +282 -0
- package/src/index.ts +18 -1
- package/src/stories/SizeComparison.stories.tsx +1 -1
- package/src/theme/BazePalette.stories.tsx +202 -0
- package/src/theme/Borders.stories.tsx +9 -9
- package/src/theme/Motion.stories.tsx +19 -19
- package/src/theme/MotionCases.stories.tsx +1 -1
- package/src/theme/Palette.stories.tsx +101 -515
- package/src/theme/SemanticTokens.mdx +61 -242
- package/src/theme/Surfaces.stories.tsx +3 -3
- package/src/theme/chakraTokens.test.ts +115 -0
- package/src/theme/claude.md +111 -502
- package/src/theme/colors.ts +403 -822
- package/src/theme/contrast.test.ts +344 -0
- package/src/theme/cssVarNames.test.ts +36 -0
- package/src/theme/deprecatedColorTokens.json +95 -0
- package/src/theme/global.ts +12 -19
- package/src/theme/index.ts +154 -82
- package/src/theme/palette.generated.ts +893 -0
- package/src/theme/paletteSwatches.test.ts +42 -0
- package/src/theme/paletteSwatches.ts +80 -0
- package/src/theme/recipes/table.ts +2 -2
- package/src/utils/disabledControl.ts +27 -0
- package/src/utils/focusRing.ts +9 -2
- package/src/utils/isDev.test.ts +41 -0
- package/src/utils/isDev.ts +27 -0
- package/dist/components/Chip/Chip.styles.d.ts +0 -20
- package/dist/components/Chip/Chip.styles.d.ts.map +0 -1
- package/dist/components/Chip/Chip.styles.js +0 -143
- package/dist/components/Chip/Chip.styles.js.map +0 -1
- package/dist/components/Chip/Chip.styles.mjs +0 -137
- package/dist/components/Chip/Chip.styles.mjs.map +0 -1
- package/src/components/Chip/Chip.styles.ts +0 -147
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared helpers for the logician-ui 5.0 codemods.
|
|
3
|
+
*
|
|
4
|
+
* Plain CommonJS on purpose: jscodeshift loads it without a build step, and the
|
|
5
|
+
* package ships `codemods/` as-is (package.json "files").
|
|
6
|
+
*/
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
|
|
11
|
+
const PKG = '@mindlogic-ai/logician-ui';
|
|
12
|
+
const TODO = 'TODO(logician-ui 5.0)';
|
|
13
|
+
|
|
14
|
+
/** `@mindlogic-ai/logician-ui` and its subpaths (`/dist`, …). */
|
|
15
|
+
const isLuiSource = (value) =>
|
|
16
|
+
typeof value === 'string' && (value === PKG || value.startsWith(`${PKG}/`));
|
|
17
|
+
|
|
18
|
+
/** Value import declarations from logician-ui (type-only imports skipped). */
|
|
19
|
+
const luiImports = (j, root) =>
|
|
20
|
+
root
|
|
21
|
+
.find(j.ImportDeclaration)
|
|
22
|
+
.filter(
|
|
23
|
+
(p) => isLuiSource(p.node.source.value) && p.node.importKind !== 'type'
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Local binding names of a logician-ui export — respects aliases
|
|
28
|
+
* (`import { Button as LButton }`) and namespace imports (`import * as L`).
|
|
29
|
+
* Returns `{ names: Set<string>, namespaces: Set<string> }`.
|
|
30
|
+
*/
|
|
31
|
+
const localNamesFor = (j, root, exported) => {
|
|
32
|
+
const names = new Set();
|
|
33
|
+
const namespaces = new Set();
|
|
34
|
+
luiImports(j, root).forEach((p) => {
|
|
35
|
+
for (const s of p.node.specifiers || []) {
|
|
36
|
+
if (s.type === 'ImportNamespaceSpecifier') namespaces.add(s.local.name);
|
|
37
|
+
if (
|
|
38
|
+
s.type === 'ImportSpecifier' &&
|
|
39
|
+
s.importKind !== 'type' &&
|
|
40
|
+
s.imported.name === exported
|
|
41
|
+
) {
|
|
42
|
+
names.add((s.local || s.imported).name);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return { names, namespaces };
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/** Does this JSX element name refer to the logician-ui export? */
|
|
50
|
+
const nameMatches = (nameNode, locals) => {
|
|
51
|
+
if (!nameNode) return false;
|
|
52
|
+
if (nameNode.type === 'JSXIdentifier') return locals.names.has(nameNode.name);
|
|
53
|
+
if (
|
|
54
|
+
nameNode.type === 'JSXMemberExpression' &&
|
|
55
|
+
nameNode.object.type === 'JSXIdentifier' &&
|
|
56
|
+
locals.namespaces.has(nameNode.object.name)
|
|
57
|
+
) {
|
|
58
|
+
return locals.lookup === nameNode.property.name;
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* All JSX opening elements (as paths) of a logician-ui component.
|
|
65
|
+
* Each result also carries `.componentLabel` for reporting.
|
|
66
|
+
*/
|
|
67
|
+
const findElements = (j, root, exported) => {
|
|
68
|
+
const locals = localNamesFor(j, root, exported);
|
|
69
|
+
locals.lookup = exported;
|
|
70
|
+
if (locals.names.size === 0 && locals.namespaces.size === 0) return [];
|
|
71
|
+
return root
|
|
72
|
+
.find(j.JSXOpeningElement)
|
|
73
|
+
.filter((p) => nameMatches(p.node.name, locals))
|
|
74
|
+
.paths();
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const attrName = (a) =>
|
|
78
|
+
a && a.type === 'JSXAttribute' && a.name && a.name.type === 'JSXIdentifier'
|
|
79
|
+
? a.name.name
|
|
80
|
+
: null;
|
|
81
|
+
|
|
82
|
+
/** The string value of a static attribute value node, else undefined. */
|
|
83
|
+
const staticString = (valueNode) => {
|
|
84
|
+
if (!valueNode) return undefined;
|
|
85
|
+
if (valueNode.type === 'StringLiteral') return valueNode.value;
|
|
86
|
+
if (valueNode.type === 'Literal' && typeof valueNode.value === 'string')
|
|
87
|
+
return valueNode.value;
|
|
88
|
+
if (valueNode.type === 'JSXExpressionContainer') {
|
|
89
|
+
const e = valueNode.expression;
|
|
90
|
+
if (e.type === 'StringLiteral') return e.value;
|
|
91
|
+
if (e.type === 'Literal' && typeof e.value === 'string') return e.value;
|
|
92
|
+
if (e.type === 'TemplateLiteral' && e.expressions.length === 0)
|
|
93
|
+
return e.quasis.map((q) => q.value.cooked).join('');
|
|
94
|
+
}
|
|
95
|
+
return undefined;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Read one attribute. The last occurrence wins, like React.
|
|
100
|
+
* { kind: 'absent' } | { kind: 'static', value, attr } | { kind: 'dynamic', attr }
|
|
101
|
+
* A bare boolean (`<Button variant>`) counts as dynamic: it has no mapping.
|
|
102
|
+
*/
|
|
103
|
+
const readAttr = (opening, name) => {
|
|
104
|
+
let found = null;
|
|
105
|
+
for (const a of opening.attributes || []) if (attrName(a) === name) found = a;
|
|
106
|
+
if (!found) return { kind: 'absent' };
|
|
107
|
+
const value = staticString(found.value);
|
|
108
|
+
if (value === undefined) return { kind: 'dynamic', attr: found };
|
|
109
|
+
return { kind: 'static', value, attr: found };
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const hasAttr = (opening, name) =>
|
|
113
|
+
(opening.attributes || []).some((a) => attrName(a) === name);
|
|
114
|
+
|
|
115
|
+
const spreads = (opening) =>
|
|
116
|
+
(opening.attributes || []).filter((a) => a.type === 'JSXSpreadAttribute');
|
|
117
|
+
|
|
118
|
+
/** Remove every attribute with one of the names; returns the first index removed (or -1). */
|
|
119
|
+
const removeAttrs = (opening, names) => {
|
|
120
|
+
let first = -1;
|
|
121
|
+
const keep = [];
|
|
122
|
+
(opening.attributes || []).forEach((a, i) => {
|
|
123
|
+
if (names.includes(attrName(a))) {
|
|
124
|
+
if (first === -1) first = keep.length;
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
keep.push(a);
|
|
128
|
+
void i;
|
|
129
|
+
});
|
|
130
|
+
opening.attributes = keep;
|
|
131
|
+
return first;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/** Insert an attribute at `index` (or append when index < 0). */
|
|
135
|
+
const insertAttr = (opening, attr, index) => {
|
|
136
|
+
const attrs = opening.attributes || (opening.attributes = []);
|
|
137
|
+
if (index < 0 || index > attrs.length) attrs.push(attr);
|
|
138
|
+
else attrs.splice(index, 0, attr);
|
|
139
|
+
return attr;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const stringAttr = (j, name, value) =>
|
|
143
|
+
j.jsxAttribute(j.jsxIdentifier(name), j.stringLiteral(value));
|
|
144
|
+
|
|
145
|
+
const boolAttr = (j, name) => j.jsxAttribute(j.jsxIdentifier(name), null);
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Attach a `/* TODO(logician-ui 5.0): … *\/` block comment in front of an
|
|
149
|
+
* attribute (valid JSX in any position; Prettier keeps it). With no attribute
|
|
150
|
+
* to hang it on, the element name gets a trailing comment.
|
|
151
|
+
*/
|
|
152
|
+
const addTodo = (j, opening, message, anchorAttr) => {
|
|
153
|
+
const comment = j.commentBlock(` ${TODO}: ${message} `, true, false);
|
|
154
|
+
const target = anchorAttr || (opening.attributes || [])[0];
|
|
155
|
+
if (target) {
|
|
156
|
+
target.comments = [...(target.comments || []), comment];
|
|
157
|
+
} else {
|
|
158
|
+
const c = j.commentBlock(` ${TODO}: ${message} `, false, true);
|
|
159
|
+
opening.name.comments = [...(opening.name.comments || []), c];
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/** Original source text of a node (falls back to printing it). */
|
|
164
|
+
const textOf = (j, file, node) => {
|
|
165
|
+
let s;
|
|
166
|
+
if (typeof node.start === 'number' && typeof node.end === 'number') {
|
|
167
|
+
s = file.source.slice(node.start, node.end);
|
|
168
|
+
} else {
|
|
169
|
+
s = j(node).toSource();
|
|
170
|
+
}
|
|
171
|
+
s = s.replace(/\s+/g, ' ').trim();
|
|
172
|
+
return s.length > 140 ? `${s.slice(0, 137)}...` : s;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
const lineOf = (node) => (node && node.loc ? node.loc.start.line : 0);
|
|
176
|
+
|
|
177
|
+
const componentLabel = (opening) => {
|
|
178
|
+
const n = opening.name;
|
|
179
|
+
if (n.type === 'JSXIdentifier') return n.name;
|
|
180
|
+
if (n.type === 'JSXMemberExpression')
|
|
181
|
+
return `${n.object.name}.${n.property.name}`;
|
|
182
|
+
return '?';
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Reporter for one transform × one file.
|
|
187
|
+
*
|
|
188
|
+
* Every site goes three ways:
|
|
189
|
+
* - `api.report(msg)` → jscodeshift prints ` REP <file> <msg>` per site;
|
|
190
|
+
* - `api.stats(name)` → counted in jscodeshift's end-of-run stats (`--dry` only;
|
|
191
|
+
* jscodeshift drops stats in write mode);
|
|
192
|
+
* - appended as JSON lines to `$LUI5_CODEMOD_REPORT` when set — the
|
|
193
|
+
* `node index.js` runner sets it and prints the summary table from it.
|
|
194
|
+
* `sites` keeps them in memory for tests.
|
|
195
|
+
*/
|
|
196
|
+
const createReporter = (api, file, transform) => {
|
|
197
|
+
const sites = [];
|
|
198
|
+
const outPath = process.env.LUI5_CODEMOD_REPORT;
|
|
199
|
+
const site = (entry) => {
|
|
200
|
+
const e = { transform, file: file.path, ...entry };
|
|
201
|
+
sites.push(e);
|
|
202
|
+
const msg = `[${transform}] L${e.line} <${e.component}> ${e.prop} — ${e.kind}${
|
|
203
|
+
e.note ? ` (${e.note})` : ''
|
|
204
|
+
}: ${e.source}`;
|
|
205
|
+
if (api && typeof api.report === 'function') api.report(msg);
|
|
206
|
+
if (api && typeof api.stats === 'function')
|
|
207
|
+
api.stats(`${transform} · needs human · ${e.kind}`);
|
|
208
|
+
if (outPath) {
|
|
209
|
+
try {
|
|
210
|
+
fs.appendFileSync(outPath, `${JSON.stringify(e)}\n`);
|
|
211
|
+
} catch (_) {
|
|
212
|
+
/* reporting must never fail the transform */
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
const count = (name, quantity = 1) => {
|
|
217
|
+
if (api && typeof api.stats === 'function')
|
|
218
|
+
api.stats(`${transform} · ${name}`, quantity);
|
|
219
|
+
if (outPath) {
|
|
220
|
+
try {
|
|
221
|
+
fs.appendFileSync(
|
|
222
|
+
outPath,
|
|
223
|
+
`${JSON.stringify({ transform, file: file.path, migrated: name, quantity })}\n`
|
|
224
|
+
);
|
|
225
|
+
} catch (_) {
|
|
226
|
+
/* ignore */
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
return { site, count, sites };
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Set a string literal's value, keeping its original quote style.
|
|
235
|
+
*
|
|
236
|
+
* Recast reprints a changed Babel `StringLiteral` with the global `quote`
|
|
237
|
+
* option and ignores `extra.raw`; an ESTree `Literal` honours its raw text.
|
|
238
|
+
* So the node is turned into a `Literal` carrying the re-quoted raw.
|
|
239
|
+
*/
|
|
240
|
+
const setStringLiteral = (node, value) => {
|
|
241
|
+
const raw = (node.extra && node.extra.raw) || node.raw;
|
|
242
|
+
const q = raw && raw[0] === "'" ? "'" : '"';
|
|
243
|
+
const escaped = value.replace(/\\/g, '\\\\').split(q).join(`\\${q}`);
|
|
244
|
+
const newRaw = `${q}${escaped}${q}`;
|
|
245
|
+
node.type = 'Literal';
|
|
246
|
+
node.value = value;
|
|
247
|
+
node.raw = newRaw;
|
|
248
|
+
node.extra = { rawValue: value, raw: newRaw };
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
module.exports = {
|
|
252
|
+
PKG,
|
|
253
|
+
TODO,
|
|
254
|
+
isLuiSource,
|
|
255
|
+
luiImports,
|
|
256
|
+
localNamesFor,
|
|
257
|
+
findElements,
|
|
258
|
+
attrName,
|
|
259
|
+
staticString,
|
|
260
|
+
readAttr,
|
|
261
|
+
hasAttr,
|
|
262
|
+
spreads,
|
|
263
|
+
removeAttrs,
|
|
264
|
+
insertAttr,
|
|
265
|
+
stringAttr,
|
|
266
|
+
boolAttr,
|
|
267
|
+
addTodo,
|
|
268
|
+
textOf,
|
|
269
|
+
lineOf,
|
|
270
|
+
componentLabel,
|
|
271
|
+
createReporter,
|
|
272
|
+
setStringLiteral,
|
|
273
|
+
};
|
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* logician-ui 5.0 codemod — tag-chip
|
|
3
|
+
*
|
|
4
|
+
* 5.0 merges Chip into Tag and drops Tag's colour × fill grid:
|
|
5
|
+
*
|
|
6
|
+
* 1. `<Chip>` → `<Tag>`. The import specifier is rewritten (or dropped when
|
|
7
|
+
* the file already imports Tag — the import is merged, TagLabel & co. are
|
|
8
|
+
* kept). Aliases (`Chip as C`) and namespace use (`<L.Chip>`) are followed.
|
|
9
|
+
* If the file already binds `Tag` to something else, `Tag as LuiTag` is
|
|
10
|
+
* imported. Non-JSX references (`styled(Chip)`) are renamed and reported.
|
|
11
|
+
* A converted Chip keeps Chip's pill shape — `borderRadius="xl"` (32px)
|
|
12
|
+
* `px={3} py={2} fontWeight="medium"`, what Chip.tsx renders — unless
|
|
13
|
+
* the call site already sets them.
|
|
14
|
+
* 2. On every logician-ui Tag (incl. converted Chips), the runtime table of
|
|
15
|
+
* mapLegacyTagProps (src/components/Tag/Tag.styles.ts):
|
|
16
|
+
* colorPalette (Chip: colorScheme ?? colorPalette) × variant
|
|
17
|
+
* primary|secondary|neutral|— × soft|—|outline → plain <Tag> (neutral)
|
|
18
|
+
* primary|secondary|neutral|— × solid → selected (reported:
|
|
19
|
+
* explicit `selected` is also a toggle)
|
|
20
|
+
* danger|success|warning × soft|— → tone="danger" …
|
|
21
|
+
* danger|success|warning × solid → tone (soft) + TODO
|
|
22
|
+
* danger|success|warning × outline → plain <Tag> + TODO
|
|
23
|
+
* unknown palette / variant → plain <Tag> + TODO
|
|
24
|
+
* colorPalette / colorScheme / variant are then removed. Defaults: Chip
|
|
25
|
+
* 4.x was primary/soft, Tag 4.x neutral/soft. A Tag's `colorScheme` was
|
|
26
|
+
* never read (only Chip's), so it is removed with a TODO.
|
|
27
|
+
* Dynamic values are left alone and reported; so are Chip type imports
|
|
28
|
+
* (`ChipProps` …), which need a hand rename.
|
|
29
|
+
*/
|
|
30
|
+
'use strict';
|
|
31
|
+
|
|
32
|
+
const {
|
|
33
|
+
luiImports,
|
|
34
|
+
findElements,
|
|
35
|
+
readAttr,
|
|
36
|
+
hasAttr,
|
|
37
|
+
spreads,
|
|
38
|
+
removeAttrs,
|
|
39
|
+
insertAttr,
|
|
40
|
+
stringAttr,
|
|
41
|
+
boolAttr,
|
|
42
|
+
addTodo,
|
|
43
|
+
textOf,
|
|
44
|
+
lineOf,
|
|
45
|
+
componentLabel,
|
|
46
|
+
createReporter,
|
|
47
|
+
isLuiSource,
|
|
48
|
+
} = require('./lib/shared');
|
|
49
|
+
|
|
50
|
+
const NAME = 'tag-chip';
|
|
51
|
+
const PLAIN = new Set(['primary', 'secondary', 'neutral']);
|
|
52
|
+
const TONES = new Set(['danger', 'success', 'warning']);
|
|
53
|
+
const CHIP_TYPES = new Set([
|
|
54
|
+
'ChipProps',
|
|
55
|
+
'ChipOwnProps',
|
|
56
|
+
'ChipVariant',
|
|
57
|
+
'ChipColorScheme',
|
|
58
|
+
]);
|
|
59
|
+
|
|
60
|
+
/** Names bound at module level (imports, declarations) — to avoid shadowing. */
|
|
61
|
+
const boundNames = (j, root) => {
|
|
62
|
+
const names = new Set();
|
|
63
|
+
root.find(j.ImportDeclaration).forEach((p) => {
|
|
64
|
+
for (const s of p.node.specifiers || [])
|
|
65
|
+
if (s.local) names.add(s.local.name);
|
|
66
|
+
});
|
|
67
|
+
root.find(j.VariableDeclarator).forEach((p) => {
|
|
68
|
+
if (p.node.id.type === 'Identifier') names.add(p.node.id.name);
|
|
69
|
+
});
|
|
70
|
+
root
|
|
71
|
+
.find(j.FunctionDeclaration)
|
|
72
|
+
.forEach((p) => p.node.id && names.add(p.node.id.name));
|
|
73
|
+
root
|
|
74
|
+
.find(j.ClassDeclaration)
|
|
75
|
+
.forEach((p) => p.node.id && names.add(p.node.id.name));
|
|
76
|
+
return names;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/** Chip → Tag rename. Returns the set of opening-element nodes that were Chips. */
|
|
80
|
+
function renameChips(j, root, file, reporter) {
|
|
81
|
+
const chipOpenings = new Set();
|
|
82
|
+
const decls = luiImports(j, root).paths();
|
|
83
|
+
|
|
84
|
+
// Type-only imports / type specifiers of Chip* are reported, not rewritten.
|
|
85
|
+
root
|
|
86
|
+
.find(j.ImportDeclaration)
|
|
87
|
+
.filter((p) => isLuiSource(p.node.source.value))
|
|
88
|
+
.forEach((p) => {
|
|
89
|
+
for (const s of p.node.specifiers || []) {
|
|
90
|
+
if (s.type === 'ImportSpecifier' && CHIP_TYPES.has(s.imported.name)) {
|
|
91
|
+
reporter.site({
|
|
92
|
+
line: lineOf(s),
|
|
93
|
+
component: 'Chip',
|
|
94
|
+
prop: s.imported.name,
|
|
95
|
+
kind: 'type',
|
|
96
|
+
note: 'Chip types merged into Tag (TagProps …) — rename by hand',
|
|
97
|
+
source: textOf(j, file, s),
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const chipLocals = [];
|
|
104
|
+
let namespaceUse = false;
|
|
105
|
+
let tagLocal = null;
|
|
106
|
+
for (const p of decls) {
|
|
107
|
+
for (const s of p.node.specifiers || []) {
|
|
108
|
+
if (s.type === 'ImportNamespaceSpecifier') namespaceUse = true;
|
|
109
|
+
if (s.type !== 'ImportSpecifier' || s.importKind === 'type') continue;
|
|
110
|
+
if (s.imported.name === 'Chip') chipLocals.push(s.local.name);
|
|
111
|
+
if (s.imported.name === 'Tag') tagLocal = s.local.name;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Namespace form: <L.Chip> → <L.Tag>.
|
|
116
|
+
if (namespaceUse) {
|
|
117
|
+
const nsNames = new Set();
|
|
118
|
+
for (const p of decls)
|
|
119
|
+
for (const s of p.node.specifiers || [])
|
|
120
|
+
if (s.type === 'ImportNamespaceSpecifier') nsNames.add(s.local.name);
|
|
121
|
+
const fix = (n) =>
|
|
122
|
+
n &&
|
|
123
|
+
n.type === 'JSXMemberExpression' &&
|
|
124
|
+
n.object.type === 'JSXIdentifier' &&
|
|
125
|
+
nsNames.has(n.object.name) &&
|
|
126
|
+
n.property.name === 'Chip';
|
|
127
|
+
root.find(j.JSXElement).forEach((p) => {
|
|
128
|
+
const { openingElement: o, closingElement: c } = p.node;
|
|
129
|
+
if (fix(o.name)) {
|
|
130
|
+
o.name.property.name = 'Tag';
|
|
131
|
+
if (c && fix(c.name)) c.name.property.name = 'Tag';
|
|
132
|
+
chipOpenings.add(o);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (!chipLocals.length) return chipOpenings;
|
|
138
|
+
|
|
139
|
+
let importTag = false;
|
|
140
|
+
if (!tagLocal) {
|
|
141
|
+
const bound = boundNames(j, root);
|
|
142
|
+
tagLocal = bound.has('Tag') ? 'LuiTag' : 'Tag';
|
|
143
|
+
importTag = true;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Rewrite import specifiers: the first Chip specifier becomes Tag (unless Tag
|
|
147
|
+
// is already imported), the rest are dropped; empty declarations go away.
|
|
148
|
+
for (const p of decls) {
|
|
149
|
+
const specs = p.node.specifiers || [];
|
|
150
|
+
const next = [];
|
|
151
|
+
for (const s of specs) {
|
|
152
|
+
if (
|
|
153
|
+
s.type === 'ImportSpecifier' &&
|
|
154
|
+
s.importKind !== 'type' &&
|
|
155
|
+
s.imported.name === 'Chip'
|
|
156
|
+
) {
|
|
157
|
+
if (importTag) {
|
|
158
|
+
next.push(
|
|
159
|
+
tagLocal === 'Tag'
|
|
160
|
+
? j.importSpecifier(j.identifier('Tag'))
|
|
161
|
+
: j.importSpecifier(j.identifier('Tag'), j.identifier(tagLocal))
|
|
162
|
+
);
|
|
163
|
+
importTag = false;
|
|
164
|
+
}
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
next.push(s);
|
|
168
|
+
}
|
|
169
|
+
p.node.specifiers = next;
|
|
170
|
+
if (next.length === 0) j(p).remove();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const locals = new Set(chipLocals);
|
|
174
|
+
root.find(j.JSXElement).forEach((p) => {
|
|
175
|
+
const { openingElement: o, closingElement: c } = p.node;
|
|
176
|
+
if (o.name.type === 'JSXIdentifier' && locals.has(o.name.name)) {
|
|
177
|
+
o.name.name = tagLocal;
|
|
178
|
+
if (c && c.name.type === 'JSXIdentifier') c.name.name = tagLocal;
|
|
179
|
+
chipOpenings.add(o);
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
// Non-JSX references (styled(Chip), `const X = Chip`, typeof Chip …).
|
|
184
|
+
root
|
|
185
|
+
.find(j.Identifier)
|
|
186
|
+
.filter((p) => {
|
|
187
|
+
if (!locals.has(p.node.name)) return false;
|
|
188
|
+
const parent = p.parent && p.parent.node;
|
|
189
|
+
if (!parent) return false;
|
|
190
|
+
if (parent.type === 'ImportSpecifier') return false;
|
|
191
|
+
if (
|
|
192
|
+
(parent.type === 'MemberExpression' ||
|
|
193
|
+
parent.type === 'OptionalMemberExpression') &&
|
|
194
|
+
parent.property === p.node &&
|
|
195
|
+
!parent.computed
|
|
196
|
+
)
|
|
197
|
+
return false;
|
|
198
|
+
if (
|
|
199
|
+
(parent.type === 'ObjectProperty' || parent.type === 'Property') &&
|
|
200
|
+
parent.key === p.node &&
|
|
201
|
+
!parent.computed &&
|
|
202
|
+
!parent.shorthand
|
|
203
|
+
)
|
|
204
|
+
return false;
|
|
205
|
+
if (parent.type === 'TSQualifiedName' && parent.right === p.node)
|
|
206
|
+
return false;
|
|
207
|
+
return true;
|
|
208
|
+
})
|
|
209
|
+
.forEach((p) => {
|
|
210
|
+
reporter.site({
|
|
211
|
+
line: lineOf(p.node),
|
|
212
|
+
component: 'Chip',
|
|
213
|
+
prop: '(reference)',
|
|
214
|
+
kind: 'reference',
|
|
215
|
+
note: `renamed to ${tagLocal}; props passed here are not migrated and Chip's pill shape (borderRadius="xl" px={3} py={2} fontWeight="medium") is not added`,
|
|
216
|
+
source: textOf(j, file, p.parent.node),
|
|
217
|
+
});
|
|
218
|
+
const parent = p.parent.node;
|
|
219
|
+
if (
|
|
220
|
+
(parent.type === 'ObjectProperty' || parent.type === 'Property') &&
|
|
221
|
+
parent.shorthand
|
|
222
|
+
) {
|
|
223
|
+
parent.shorthand = false;
|
|
224
|
+
parent.value = j.identifier(tagLocal);
|
|
225
|
+
} else {
|
|
226
|
+
p.node.name = tagLocal;
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
return chipOpenings;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Port of mapLegacyTagProps (src/components/Tag/Tag.styles.ts) — the runtime
|
|
235
|
+
* back-compat table, so a migrated call site renders as the unmigrated one
|
|
236
|
+
* did. `palette` is what the runtime receives: Tag's `colorPalette`, or for a
|
|
237
|
+
* Chip `colorScheme ?? colorPalette ?? 'primary'` (Chip.tsx); undefined means
|
|
238
|
+
* Tag's 4.x default, neutral.
|
|
239
|
+
* @returns {{ tone: string, selected?: boolean, needsHuman: boolean }}
|
|
240
|
+
*/
|
|
241
|
+
const mapLegacy = (palette, variant) => {
|
|
242
|
+
const color = palette == null ? 'neutral' : palette;
|
|
243
|
+
const v = variant == null ? 'soft' : variant;
|
|
244
|
+
const plain = PLAIN.has(color);
|
|
245
|
+
const status = TONES.has(color);
|
|
246
|
+
if (!plain && !status) return { tone: 'neutral', needsHuman: true };
|
|
247
|
+
switch (v) {
|
|
248
|
+
case 'soft':
|
|
249
|
+
return { tone: status ? color : 'neutral', needsHuman: false };
|
|
250
|
+
case 'solid':
|
|
251
|
+
return status
|
|
252
|
+
? { tone: color, needsHuman: true }
|
|
253
|
+
: { tone: 'neutral', selected: true, needsHuman: false };
|
|
254
|
+
case 'outline':
|
|
255
|
+
return { tone: 'neutral', needsHuman: status };
|
|
256
|
+
default:
|
|
257
|
+
return { tone: 'neutral', needsHuman: true };
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
/** Why a needs-human pair is lossy — the TODO text. */
|
|
262
|
+
const todoFor = (color, variant, r) => {
|
|
263
|
+
if (!PLAIN.has(color) && !TONES.has(color))
|
|
264
|
+
return `colorPalette="${color}" is not a 5.0 tone; now a plain Tag`;
|
|
265
|
+
if (variant === 'solid')
|
|
266
|
+
return `${color}/solid has no filled 5.0 Tag; now tone="${r.tone}" (soft)`;
|
|
267
|
+
if (variant === 'outline')
|
|
268
|
+
return `${color}/outline has no outlined 5.0 Tag; now a plain Tag — tone="${color}"?`;
|
|
269
|
+
return `variant="${variant}" is not a Tag variant; now a plain Tag`;
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Chip.tsx renders its Tag with a pill shape so an unmigrated screen does not
|
|
274
|
+
* shift; a migrated <Chip> keeps it. `xl` is the 32px radius token. A prop the
|
|
275
|
+
* call site already sets (or a shorthand covering it) is left alone, and the
|
|
276
|
+
* shape goes first, before any spread, as in Chip.tsx.
|
|
277
|
+
*/
|
|
278
|
+
const CHIP_SHAPE = [
|
|
279
|
+
['borderRadius', 'xl', ['borderRadius', 'rounded']],
|
|
280
|
+
['px', 3, ['px', 'paddingX', 'paddingInline', 'p', 'padding']],
|
|
281
|
+
['py', 2, ['py', 'paddingY', 'paddingBlock', 'p', 'padding']],
|
|
282
|
+
['fontWeight', 'medium', ['fontWeight']],
|
|
283
|
+
];
|
|
284
|
+
|
|
285
|
+
const addChipShape = (j, opening) => {
|
|
286
|
+
const set = (opening.attributes || [])
|
|
287
|
+
.filter((a) => a.type === 'JSXAttribute')
|
|
288
|
+
.map((a) => a.name && a.name.name);
|
|
289
|
+
const add = [];
|
|
290
|
+
for (const [name, value, covers] of CHIP_SHAPE) {
|
|
291
|
+
if (covers.some((c) => set.includes(c))) continue;
|
|
292
|
+
add.push(
|
|
293
|
+
typeof value === 'number'
|
|
294
|
+
? j.jsxAttribute(
|
|
295
|
+
j.jsxIdentifier(name),
|
|
296
|
+
j.jsxExpressionContainer(j.numericLiteral(value))
|
|
297
|
+
)
|
|
298
|
+
: stringAttr(j, name, value)
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
opening.attributes = [...add, ...(opening.attributes || [])];
|
|
302
|
+
return add.length > 0;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
function migrateTag(j, file, reporter, opening, fromChip) {
|
|
306
|
+
const label = fromChip
|
|
307
|
+
? `${componentLabel(opening)} (was Chip)`
|
|
308
|
+
: componentLabel(opening);
|
|
309
|
+
const shaped = fromChip && addChipShape(j, opening);
|
|
310
|
+
const cp = readAttr(opening, 'colorPalette');
|
|
311
|
+
const cs = readAttr(opening, 'colorScheme');
|
|
312
|
+
const v = readAttr(opening, 'variant');
|
|
313
|
+
const line = lineOf(opening);
|
|
314
|
+
|
|
315
|
+
const sp = spreads(opening);
|
|
316
|
+
if (sp.length) {
|
|
317
|
+
reporter.site({
|
|
318
|
+
line,
|
|
319
|
+
component: label,
|
|
320
|
+
prop: '{...spread}',
|
|
321
|
+
kind: 'spread',
|
|
322
|
+
note: 'may carry colorPalette/colorScheme/variant — check by hand',
|
|
323
|
+
source: sp.map((s) => textOf(j, file, s)).join(' '),
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
const dynamic = [
|
|
327
|
+
['colorPalette', cp],
|
|
328
|
+
['colorScheme', cs],
|
|
329
|
+
['variant', v],
|
|
330
|
+
].filter(([, a]) => a.kind === 'dynamic');
|
|
331
|
+
if (dynamic.length) {
|
|
332
|
+
for (const [prop, a] of dynamic) {
|
|
333
|
+
reporter.site({
|
|
334
|
+
line: lineOf(a.attr),
|
|
335
|
+
component: label,
|
|
336
|
+
prop,
|
|
337
|
+
kind: 'dynamic',
|
|
338
|
+
note: 'not migrated (5.0: tone="danger|success|warning", selected)',
|
|
339
|
+
source: textOf(j, file, a.attr),
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
return shaped;
|
|
343
|
+
}
|
|
344
|
+
if (cp.kind === 'absent' && cs.kind === 'absent' && v.kind === 'absent')
|
|
345
|
+
return shaped;
|
|
346
|
+
|
|
347
|
+
const stat = (a) => (a.kind === 'static' ? a.value : undefined);
|
|
348
|
+
// What the runtime reads: Chip → colorScheme ?? colorPalette ?? 'primary';
|
|
349
|
+
// Tag → colorPalette only (a colorScheme on a Tag never reached the mapping).
|
|
350
|
+
const palette = fromChip ? (stat(cs) ?? stat(cp) ?? 'primary') : stat(cp);
|
|
351
|
+
const variant = stat(v);
|
|
352
|
+
const r = mapLegacy(palette, variant);
|
|
353
|
+
const color = palette == null ? 'neutral' : palette;
|
|
354
|
+
const shownVariant = variant == null ? 'soft' : variant;
|
|
355
|
+
|
|
356
|
+
let todo = r.needsHuman ? todoFor(color, shownVariant, r) : null;
|
|
357
|
+
if (!fromChip && cs.kind === 'static' && cp.kind === 'absent') {
|
|
358
|
+
const note = `colorScheme="${cs.value}" was ignored by Tag (it reads colorPalette); removed`;
|
|
359
|
+
todo = todo ? `${todo}; ${note}` : note;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
const index = removeAttrs(opening, [
|
|
363
|
+
'colorPalette',
|
|
364
|
+
'colorScheme',
|
|
365
|
+
'variant',
|
|
366
|
+
]);
|
|
367
|
+
const at = index < 0 ? 0 : index;
|
|
368
|
+
let anchor = null;
|
|
369
|
+
// An explicit tone / selected wins over the mapping (Tag.tsx: `tone ??=`).
|
|
370
|
+
if (r.tone !== 'neutral' && !hasAttr(opening, 'tone'))
|
|
371
|
+
anchor = insertAttr(opening, stringAttr(j, 'tone', r.tone), at);
|
|
372
|
+
if (r.selected && !hasAttr(opening, 'selected')) {
|
|
373
|
+
anchor = insertAttr(opening, boolAttr(j, 'selected'), at);
|
|
374
|
+
// The runtime mapping gives the selected *look* only; an explicit
|
|
375
|
+
// `selected` prop also makes the tag a toggle (hover, pointer,
|
|
376
|
+
// aria-pressed on a button) — Tag.tsx. No public prop gives the look
|
|
377
|
+
// without that, so a human confirms it.
|
|
378
|
+
reporter.site({
|
|
379
|
+
line,
|
|
380
|
+
component: label,
|
|
381
|
+
prop: 'selected',
|
|
382
|
+
kind: 'selected',
|
|
383
|
+
note: `${color}/${shownVariant} → selected, which also makes the tag interactive (hover, pointer) — confirm it is a toggle`,
|
|
384
|
+
source: `<${label} ${color}/${shownVariant}>`,
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
if (todo) {
|
|
388
|
+
addTodo(
|
|
389
|
+
j,
|
|
390
|
+
opening,
|
|
391
|
+
todo,
|
|
392
|
+
anchor || opening.attributes[at] || opening.attributes[0]
|
|
393
|
+
);
|
|
394
|
+
reporter.site({
|
|
395
|
+
line,
|
|
396
|
+
component: label,
|
|
397
|
+
prop: 'colorPalette+variant',
|
|
398
|
+
kind: 'todo',
|
|
399
|
+
note: todo,
|
|
400
|
+
source: `<${label} ${color}/${shownVariant}>`,
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
return true;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
function transform(file, api, options) {
|
|
407
|
+
const j = api.jscodeshift;
|
|
408
|
+
const root = j(file.source);
|
|
409
|
+
const reporter =
|
|
410
|
+
(options && options.__reporter) || createReporter(api, file, NAME);
|
|
411
|
+
|
|
412
|
+
const chipOpenings = renameChips(j, root, file, reporter);
|
|
413
|
+
let changed = chipOpenings.size;
|
|
414
|
+
if (changed) reporter.count('Chip → Tag', changed);
|
|
415
|
+
|
|
416
|
+
// Tag elements (after the rename, Chips are Tags too).
|
|
417
|
+
const seen = new Set();
|
|
418
|
+
let migrated = 0;
|
|
419
|
+
for (const p of findElements(j, root, 'Tag')) {
|
|
420
|
+
seen.add(p.node);
|
|
421
|
+
if (migrateTag(j, file, reporter, p.node, chipOpenings.has(p.node)))
|
|
422
|
+
migrated += 1;
|
|
423
|
+
}
|
|
424
|
+
// Chips renamed to a newly imported Tag are found above; namespace ones too.
|
|
425
|
+
for (const o of chipOpenings) {
|
|
426
|
+
if (!seen.has(o) && migrateTag(j, file, reporter, o, true)) migrated += 1;
|
|
427
|
+
}
|
|
428
|
+
if (migrated) reporter.count('elements migrated', migrated);
|
|
429
|
+
changed += migrated;
|
|
430
|
+
if (!changed) return undefined;
|
|
431
|
+
return root.toSource();
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
module.exports = transform;
|
|
435
|
+
module.exports.parser = 'tsx';
|
|
436
|
+
module.exports.mapLegacy = mapLegacy;
|