@databricks/design-system 1.12.7 → 1.12.8
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/Typography-1b037412.js +2074 -0
- package/dist/Typography-1b037412.js.map +1 -0
- package/dist/Typography-e3d5ff23.js +2083 -0
- package/dist/Typography-e3d5ff23.js.map +1 -0
- package/dist/common-1fb3eeb9.js.map +1 -1
- package/dist/design-system/Accordion/Accordion.d.ts.map +1 -1
- package/dist/design-system/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/design-system/Button/Button.d.ts +1 -2
- package/dist/design-system/Button/Button.d.ts.map +1 -1
- package/dist/design-system/Button/styles.d.ts.map +1 -1
- package/dist/design-system/DesignSystemProvider/DesignSystemProvider.d.ts.map +1 -1
- package/dist/design-system/DialogCombobox/DialogCombobox.d.ts +4 -2
- package/dist/design-system/DialogCombobox/DialogCombobox.d.ts.map +1 -1
- package/dist/design-system/DialogCombobox/DialogComboboxContent.d.ts.map +1 -1
- package/dist/design-system/DialogCombobox/DialogComboboxCountBadge.d.ts.map +1 -1
- package/dist/design-system/DialogCombobox/DialogComboboxEmpty.d.ts +2 -0
- package/dist/design-system/DialogCombobox/DialogComboboxEmpty.d.ts.map +1 -0
- package/dist/design-system/DialogCombobox/DialogComboboxOptionControlledList.d.ts.map +1 -1
- package/dist/design-system/DialogCombobox/DialogComboboxOptionList.d.ts +2 -2
- package/dist/design-system/DialogCombobox/DialogComboboxOptionList.d.ts.map +1 -1
- package/dist/design-system/DialogCombobox/DialogComboboxOptionListCheckboxItem.d.ts +2 -0
- package/dist/design-system/DialogCombobox/DialogComboboxOptionListCheckboxItem.d.ts.map +1 -1
- package/dist/design-system/DialogCombobox/DialogComboboxOptionListSearch.d.ts.map +1 -1
- package/dist/design-system/DialogCombobox/DialogComboboxOptionListSelectItem.d.ts +2 -0
- package/dist/design-system/DialogCombobox/DialogComboboxOptionListSelectItem.d.ts.map +1 -1
- package/dist/design-system/DialogCombobox/DialogComboboxTrigger.d.ts +8 -1
- package/dist/design-system/DialogCombobox/DialogComboboxTrigger.d.ts.map +1 -1
- package/dist/design-system/DialogCombobox/providers/DialogComboboxContext.d.ts +4 -1
- package/dist/design-system/DialogCombobox/providers/DialogComboboxContext.d.ts.map +1 -1
- package/dist/design-system/DialogCombobox/providers/DialogComboboxOptionListContext.d.ts +2 -0
- package/dist/design-system/DialogCombobox/providers/DialogComboboxOptionListContext.d.ts.map +1 -1
- package/dist/design-system/DialogCombobox/shared.d.ts +11 -1
- package/dist/design-system/DialogCombobox/shared.d.ts.map +1 -1
- package/dist/design-system/Drawer/Drawer.d.ts +6 -1
- package/dist/design-system/Drawer/Drawer.d.ts.map +1 -1
- package/dist/design-system/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/design-system/Form/Form.d.ts.map +1 -1
- package/dist/design-system/Header/Header.d.ts.map +1 -1
- package/dist/design-system/Icon/Icon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/AlignCenterIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/AlignLeftIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/AlignRightIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/AppIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/AppIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/ArrowDownIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ArrowLeftIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ArrowRightIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ArrowUpIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ArrowsUpDownIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/BarChartIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/BeakerIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/BinaryIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/BinaryIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/BoldIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/BoldIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/BookIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/BookmarkFillIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/BookmarkIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/BooksIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/BooksIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/BracketsCurlyIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/BracketsCurlyIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/BracketsSquareIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/BracketsSquareIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/BracketsXIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/BracketsXIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/BranchIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/BranchIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/BriefcaseFillIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/BriefcaseIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/CalendarEventIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/CalendarIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/CaretDownSquareIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/CaretUpSquareIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/CatalogIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/CatalogIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/ChartLineIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/ChartLineIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/CheckCircleBadgeIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/CheckCircleBadgeIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/CheckCircleFillIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/CheckCircleIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/CheckIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/CheckLineIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ChecklistIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ChevronDoubleDownIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ChevronDoubleLeftIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ChevronDoubleRightIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ChevronDoubleUpIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ChevronDownIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ChevronLeftIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ChevronRightIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ChevronUpIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/CircleIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ClipboardIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ClockIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/CloseIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/CloudDownloadIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/CloudIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/CloudKeyIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/CloudKeyIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/CloudModelIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/CloudModelIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/CloudOffIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/CloudUploadIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/CodeIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ColorFillIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/ColorFillIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/ColumnIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/ColumnIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/ConnectIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/ConnectIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/CopyIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/CursorIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/CursorIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/CursorTypeIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/CursorTypeIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/DIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/DagIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/DagIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/DangerFillIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/DangerIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/DashIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/DashboardIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/DataIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/DatabaseIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/DecimalIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/DecimalIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/DotsCircleIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/DotsCircleIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/DownloadIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/DragIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ExpandLessIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ExpandMoreIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/FaceFrownIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/FaceFrownIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/FaceNeutralIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/FaceNeutralIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/FaceSmileIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/FaceSmileIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/FileCodeIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/FileDocumentIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/FileIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/FileImageIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/FileModelIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/FilterIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/FolderBranchIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/FolderBranchIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/FolderFillIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/FolderIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/FontIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/FontIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/ForkIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/FullscreenExitIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/FullscreenIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/FunctionIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/FunctionIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/FunctionIcon.v2.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/FunctionIcon.v2.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/GearFillIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/GearIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/GiftIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/GiftIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/GitCommitIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/GitCommitIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/GlobeIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/GlobeIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/GridDashIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/GridIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/H1Icon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/H2Icon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/H3Icon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/HistoryIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/HomeIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ImageIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/IndentDecreaseIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/IndentIncreaseIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/InfinityIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/InfoFillIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/InfoIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ItalicIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/ItalicIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/KeyIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/KeyIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/KeyboardIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/LayerIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/LettersIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/LettersIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/LightningIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/LinkIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/LinkOffIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ListBorderIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ListIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/LoadingIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/LockFillIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/LockIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/LockUnlockedIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/MIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/MenuIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/MenuIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/MinusBoxIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/MinusCircleFillIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/MinusCircleIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ModelsIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/NewWindowIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/NoIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/NotebookIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/NotificationIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/NotificationOffIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/NotificationOffIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/NumbersIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/NumbersIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/OfficeIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/OverflowIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/PageBottomIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/PageFirstIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/PageLastIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/PageTopIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/PencilIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/PinCancelIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/PinFillIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/PinIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/PipelineIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/PipelineIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/PipelineIcon.v2.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/PipelineIcon.v2.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/PlayCircleFillIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/PlayCircleIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/PlayIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/PlugIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/PlugIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/PlusCircleFillIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/PlusCircleIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/PlusIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/PlusSquareIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/QueryEditorIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/QueryIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/QuestionMarkFillIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/QuestionMarkIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ReaderModeIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/RedoIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/RefreshIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ReposIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/SaveIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/SaveIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/SchoolIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/SearchIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/SecurityIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ShareIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/SidebarAutoIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/SidebarCollapseIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/SidebarExpandIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/SidebarIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/SlidersIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/SlidersIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/SortAscendingIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/SortAscendingIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/SortDescendingIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/SortDescendingIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/SortUnsortedIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/SortUnsortedIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/SpeechBubbleIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/SpeechBubblePlusIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/StarFillIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/StarIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/StopCircleFillIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/StopCircleIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/StopIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/StorefrontIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/StorefrontIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/StreamIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/SyncIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/TableIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/TableInfinityIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/TableInfinityIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/TableLightningIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/TableLightningIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/TableViewIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/TableViewIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/TextBoxIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/TextBoxIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/TextBoxIcon.v2.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/TextBoxIcon.v2.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/ThumbsDownIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/ThumbsDownIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/ThumbsUpIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/ThumbsUpIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/TrashIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/TreeIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/UnderlineIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/UnderlineIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/UndoIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/UploadIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/UsbIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/UserBadgeIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/UserCircleIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/UserGroupIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/UserIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/VariableIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/VariableIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/VisibleIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/VisibleOffIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/WarningFillIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/WarningIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/WorkspacesIcon.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/WorkspacesIcon.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/XCircleFillIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/XCircleIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ZoomInIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/ZoomOutIcon.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/index.d.ts +53 -35
- package/dist/design-system/Icon/__generated/icons/index.d.ts.map +1 -1
- package/dist/design-system/Input/Input.d.ts +1 -0
- package/dist/design-system/Input/Input.d.ts.map +1 -1
- package/dist/design-system/Input/Input.test.d.ts +2 -0
- package/dist/design-system/Input/Input.test.d.ts.map +1 -0
- package/dist/design-system/LegacyNotification/LegacyNotification.d.ts +42 -0
- package/dist/design-system/LegacyNotification/LegacyNotification.d.ts.map +1 -0
- package/dist/design-system/LegacyNotification/LegacyNotification.test.d.ts +2 -0
- package/dist/design-system/LegacyNotification/LegacyNotification.test.d.ts.map +1 -0
- package/dist/design-system/LegacyNotification/index.d.ts +2 -0
- package/dist/design-system/LegacyNotification/index.d.ts.map +1 -0
- package/dist/design-system/LegacyPopover/LegacyPopover.d.ts +16 -0
- package/dist/design-system/LegacyPopover/LegacyPopover.d.ts.map +1 -0
- package/dist/design-system/LegacyPopover/index.d.ts +2 -0
- package/dist/design-system/LegacyPopover/index.d.ts.map +1 -0
- package/dist/design-system/Modal/Modal.d.ts.map +1 -1
- package/dist/design-system/Notification/Notification.d.ts +20 -30
- package/dist/design-system/Notification/Notification.d.ts.map +1 -1
- package/dist/design-system/Notification/index.d.ts +1 -1
- package/dist/design-system/Notification/index.d.ts.map +1 -1
- package/dist/design-system/Pagination/index.d.ts +2 -3
- package/dist/design-system/Pagination/index.d.ts.map +1 -1
- package/dist/design-system/Popover/Popover.d.ts +9 -5
- package/dist/design-system/Popover/Popover.d.ts.map +1 -1
- package/dist/design-system/Popover/Popover.test.d.ts +2 -0
- package/dist/design-system/Popover/Popover.test.d.ts.map +1 -0
- package/dist/design-system/Popover/index.d.ts +1 -1
- package/dist/design-system/Popover/index.d.ts.map +1 -1
- package/dist/design-system/Radio/Radio.d.ts.map +1 -1
- package/dist/design-system/SegmentedControl/SegmentedControl.d.ts +3 -1
- package/dist/design-system/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/design-system/Select/Select.d.ts +25 -6
- package/dist/design-system/Select/Select.d.ts.map +1 -1
- package/dist/design-system/Skeleton/Skeleton.d.ts +1 -0
- package/dist/design-system/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/design-system/SplitButton/Dropdown/DropdownButton.d.ts +1 -1
- package/dist/design-system/SplitButton/Dropdown/DropdownButton.d.ts.map +1 -1
- package/dist/design-system/SplitButton/SplitButton.d.ts.map +1 -1
- package/dist/design-system/TableUI/Table.d.ts +31 -0
- package/dist/design-system/TableUI/Table.d.ts.map +1 -0
- package/dist/design-system/TableUI/TableCell.d.ts +20 -0
- package/dist/design-system/TableUI/TableCell.d.ts.map +1 -0
- package/dist/design-system/TableUI/TableFilterInput.d.ts +11 -0
- package/dist/design-system/TableUI/TableFilterInput.d.ts.map +1 -0
- package/dist/design-system/TableUI/TableFilterLayout.d.ts +15 -0
- package/dist/design-system/TableUI/TableFilterLayout.d.ts.map +1 -0
- package/dist/design-system/TableUI/TableHeader.d.ts +32 -0
- package/dist/design-system/TableUI/TableHeader.d.ts.map +1 -0
- package/dist/design-system/TableUI/TableRow.d.ts +20 -0
- package/dist/design-system/TableUI/TableRow.d.ts.map +1 -0
- package/dist/design-system/TableUI/TableRowAction.d.ts +15 -0
- package/dist/design-system/TableUI/TableRowAction.d.ts.map +1 -0
- package/dist/design-system/TableUI/TableRowSelectCell.d.ts +17 -0
- package/dist/design-system/TableUI/TableRowSelectCell.d.ts.map +1 -0
- package/dist/design-system/TableUI/TableSkeleton.d.ts +27 -0
- package/dist/design-system/TableUI/TableSkeleton.d.ts.map +1 -0
- package/dist/design-system/TableUI/index.d.ts +9 -123
- package/dist/design-system/TableUI/index.d.ts.map +1 -1
- package/dist/design-system/TableUI/tableStyles.d.ts +22 -0
- package/dist/design-system/TableUI/tableStyles.d.ts.map +1 -0
- package/dist/design-system/Tabs/index.d.ts.map +1 -1
- package/dist/design-system/Tag/index.d.ts.map +1 -1
- package/dist/design-system/Typography/Link.d.ts.map +1 -1
- package/dist/design-system/Typography/Text.d.ts.map +1 -1
- package/dist/design-system/index.d.ts +3 -2
- package/dist/design-system/index.d.ts.map +1 -1
- package/dist/design-system/utils/accessibility.d.ts +9 -0
- package/dist/design-system/utils/accessibility.d.ts.map +1 -0
- package/dist/design-system/utils/accessibility.test.d.ts +2 -0
- package/dist/design-system/utils/accessibility.test.d.ts.map +1 -0
- package/dist/design-system/utils/index.d.ts +2 -0
- package/dist/design-system/utils/index.d.ts.map +1 -0
- package/dist/design-system/utils/safex.d.ts +15 -0
- package/dist/design-system/utils/safex.d.ts.map +1 -0
- package/dist/design-system/utils/safex.test.d.ts +2 -0
- package/dist/design-system/utils/safex.test.d.ts.map +1 -0
- package/dist/development/ChatUI/ChatInput.d.ts +11 -0
- package/dist/development/ChatUI/ChatInput.d.ts.map +1 -0
- package/dist/development/ChatUI/CodeSnippet.d.ts +9 -0
- package/dist/development/ChatUI/CodeSnippet.d.ts.map +1 -0
- package/dist/development/ChatUI/Feedback.d.ts +6 -0
- package/dist/development/ChatUI/Feedback.d.ts.map +1 -0
- package/dist/development/ChatUI/Message.d.ts +8 -0
- package/dist/development/ChatUI/Message.d.ts.map +1 -0
- package/dist/development/ChatUI/MessageBody.d.ts +7 -0
- package/dist/development/ChatUI/MessageBody.d.ts.map +1 -0
- package/dist/development/ChatUI/MessageHeader.d.ts +10 -0
- package/dist/development/ChatUI/MessageHeader.d.ts.map +1 -0
- package/dist/development/ChatUI/MessagePagination.d.ts +9 -0
- package/dist/development/ChatUI/MessagePagination.d.ts.map +1 -0
- package/dist/development/ChatUI/index.d.ts +37 -0
- package/dist/development/ChatUI/index.d.ts.map +1 -0
- package/dist/development/SelectV2/Select.d.ts +7 -0
- package/dist/development/SelectV2/Select.d.ts.map +1 -0
- package/dist/development/SelectV2/SelectContent.d.ts +6 -0
- package/dist/development/SelectV2/SelectContent.d.ts.map +1 -0
- package/dist/development/SelectV2/SelectOption.d.ts +6 -0
- package/dist/development/SelectV2/SelectOption.d.ts.map +1 -0
- package/dist/development/SelectV2/SelectOptionGroup.d.ts +7 -0
- package/dist/development/SelectV2/SelectOptionGroup.d.ts.map +1 -0
- package/dist/development/SelectV2/SelectTrigger.d.ts +6 -0
- package/dist/development/SelectV2/SelectTrigger.d.ts.map +1 -0
- package/dist/development/SelectV2/hooks/useSelectContext.d.ts +2 -0
- package/dist/development/SelectV2/hooks/useSelectContext.d.ts.map +1 -0
- package/dist/development/SelectV2/index.d.ts +6 -0
- package/dist/development/SelectV2/index.d.ts.map +1 -0
- package/dist/development/SelectV2/providers/SelectContext.d.ts +11 -0
- package/dist/development/SelectV2/providers/SelectContext.d.ts.map +1 -0
- package/dist/development/index.d.ts +1 -0
- package/dist/development/index.d.ts.map +1 -1
- package/dist/development.js +452 -6
- package/dist/development.js.map +1 -1
- package/dist/dubois-colors.less +202 -0
- package/dist/flags.d.ts +0 -1
- package/dist/flags.d.ts.map +1 -1
- package/dist/index-mfe.css +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +3845 -7649
- package/dist/index.js.map +1 -1
- package/dist/test-utils/enzyme/utils.d.ts.map +1 -1
- package/dist/test-utils/enzyme.js +5 -6
- package/dist/test-utils/enzyme.js.map +1 -1
- package/dist/test-utils/rtl.js.map +1 -1
- package/dist/theme/breakpoints.d.ts +14 -0
- package/dist/theme/breakpoints.d.ts.map +1 -0
- package/dist/theme/generalVariables.d.ts +0 -1
- package/dist/theme/generalVariables.d.ts.map +1 -1
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/useDesignSystemTheme-3d2c1acb.js.map +1 -1
- package/dist/useDesignSystemTheme-c859571c.js +468 -0
- package/dist/useDesignSystemTheme-c859571c.js.map +1 -0
- package/dist/useDesignSystemTheme-c867a35d.js +470 -0
- package/dist/useDesignSystemTheme-c867a35d.js.map +1 -0
- package/dist/useDesignSystemTheme-ef39204e.js +468 -0
- package/dist/useDesignSystemTheme-ef39204e.js.map +1 -0
- package/package.json +21 -21
|
@@ -0,0 +1,2074 @@
|
|
|
1
|
+
import React__default, { createContext, useContext, useMemo, useEffect, forwardRef } from 'react';
|
|
2
|
+
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
3
|
+
import { useTheme, ThemeProvider, css } from '@emotion/react';
|
|
4
|
+
import { notification, ConfigProvider, Button as Button$1, Input as Input$1, Typography as Typography$1 } from 'antd';
|
|
5
|
+
import chroma from 'chroma-js';
|
|
6
|
+
import AntDIcon from '@ant-design/icons';
|
|
7
|
+
import _isNil from 'lodash/isNil';
|
|
8
|
+
import _endsWith from 'lodash/endsWith';
|
|
9
|
+
import _isBoolean from 'lodash/isBoolean';
|
|
10
|
+
import _isNumber from 'lodash/isNumber';
|
|
11
|
+
import _isString from 'lodash/isString';
|
|
12
|
+
import _mapValues from 'lodash/mapValues';
|
|
13
|
+
import unitless from '@emotion/unitless';
|
|
14
|
+
|
|
15
|
+
// Border variables
|
|
16
|
+
const borders = {
|
|
17
|
+
borderRadiusMd: 4
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// eslint-disable-next-line import/no-anonymous-default-export
|
|
21
|
+
var borders$1 = {
|
|
22
|
+
...borders
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* These values are based on AntD's breakpoints which follow BootStrap 4 media query rules.
|
|
27
|
+
* The numerical values represent the min-width of the given size.
|
|
28
|
+
* AntD values: https://ant.design/components/grid#col
|
|
29
|
+
* Bootstrap: https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
const breakpoints = {
|
|
33
|
+
xs: 0,
|
|
34
|
+
sm: 576,
|
|
35
|
+
md: 768,
|
|
36
|
+
lg: 992,
|
|
37
|
+
xl: 1200,
|
|
38
|
+
xxl: 1600
|
|
39
|
+
};
|
|
40
|
+
const mediaQueries = {
|
|
41
|
+
xs: '@media (max-width: 575.98px)',
|
|
42
|
+
sm: `@media (min-width: ${breakpoints.sm}px)`,
|
|
43
|
+
md: `@media (min-width: ${breakpoints.md}px)`,
|
|
44
|
+
lg: `@media (min-width: ${breakpoints.lg}px)`,
|
|
45
|
+
xl: `@media (min-width: ${breakpoints.xl}px)`,
|
|
46
|
+
xxl: `@media (min-width: ${breakpoints.xxl}px)`
|
|
47
|
+
};
|
|
48
|
+
const responsive = {
|
|
49
|
+
breakpoints,
|
|
50
|
+
mediaQueries
|
|
51
|
+
};
|
|
52
|
+
var responsive$1 = responsive;
|
|
53
|
+
|
|
54
|
+
// Exported from go/designsystem/colorsheet
|
|
55
|
+
const colorPalettePrimary = {
|
|
56
|
+
primary: '#2272B4',
|
|
57
|
+
blue100: '#F0F8FF',
|
|
58
|
+
blue200: '#D7EDFE',
|
|
59
|
+
blue300: '#BAE1FC',
|
|
60
|
+
blue400: '#8FCDFF',
|
|
61
|
+
blue500: '#4299E0',
|
|
62
|
+
blue600: '#2272B4',
|
|
63
|
+
blue700: '#0E538B',
|
|
64
|
+
blue800: '#04355D',
|
|
65
|
+
green100: '#F3FCF6',
|
|
66
|
+
green200: '#D4F7DF',
|
|
67
|
+
green300: '#B1ECC5',
|
|
68
|
+
green400: '#8DDDA8',
|
|
69
|
+
green500: '#3CAA60',
|
|
70
|
+
green600: '#277C43',
|
|
71
|
+
green700: '#115026',
|
|
72
|
+
green800: '#093919',
|
|
73
|
+
white: '#FFFFFF',
|
|
74
|
+
grey100: '#F2F5F7',
|
|
75
|
+
grey200: '#E4ECF1',
|
|
76
|
+
grey300: '#CDDAE5',
|
|
77
|
+
grey400: '#BDCDDB',
|
|
78
|
+
grey500: '#8196A7',
|
|
79
|
+
grey600: '#5D7283',
|
|
80
|
+
grey700: '#44535F',
|
|
81
|
+
grey800: '#1F272D',
|
|
82
|
+
red100: '#FFF5F7',
|
|
83
|
+
red200: '#FDE2E8',
|
|
84
|
+
red300: '#FBD0D8',
|
|
85
|
+
red400: '#F792A6',
|
|
86
|
+
red500: '#E65B77',
|
|
87
|
+
red600: '#C82D4C',
|
|
88
|
+
red700: '#9E102C',
|
|
89
|
+
red800: '#630316',
|
|
90
|
+
yellow100: '#FFF9EB',
|
|
91
|
+
yellow200: '#FCEACA',
|
|
92
|
+
yellow300: '#F8D4A5',
|
|
93
|
+
yellow400: '#F2BE88',
|
|
94
|
+
yellow500: '#DE7921',
|
|
95
|
+
yellow600: '#BE501E',
|
|
96
|
+
yellow700: '#93320B',
|
|
97
|
+
yellow800: '#5F1B02'
|
|
98
|
+
};
|
|
99
|
+
const colorPaletteSecondary = {
|
|
100
|
+
brown: '#A6630C',
|
|
101
|
+
coral: '#C83243',
|
|
102
|
+
charcoal: '#5D7283',
|
|
103
|
+
indigo: '#434A93',
|
|
104
|
+
lemon: '#FACB66',
|
|
105
|
+
lime: '#308613',
|
|
106
|
+
pink: '#B45091',
|
|
107
|
+
purple: '#8A63BF',
|
|
108
|
+
teal: '#04867D',
|
|
109
|
+
turquoise: '#157CBC'
|
|
110
|
+
};
|
|
111
|
+
const lightColorList = {
|
|
112
|
+
backgroundPrimary: colorPalettePrimary.white,
|
|
113
|
+
actionDangerPrimaryBackgroundDefault: colorPalettePrimary.red600,
|
|
114
|
+
actionDangerPrimaryBackgroundHover: colorPalettePrimary.red700,
|
|
115
|
+
actionDangerPrimaryBackgroundPress: colorPalettePrimary.red800,
|
|
116
|
+
actionDangerDefaultBackgroundDefault: chroma(colorPalettePrimary.red600).alpha(0).hex(),
|
|
117
|
+
actionDangerDefaultBackgroundHover: chroma(colorPalettePrimary.red600).alpha(0.08).hex(),
|
|
118
|
+
actionDangerDefaultBackgroundPress: chroma(colorPalettePrimary.red600).alpha(0.16).hex(),
|
|
119
|
+
actionDangerDefaultBorderDefault: colorPalettePrimary.red600,
|
|
120
|
+
actionDangerDefaultBorderHover: colorPalettePrimary.red700,
|
|
121
|
+
actionDangerDefaultBorderPress: colorPalettePrimary.red800,
|
|
122
|
+
actionDangerDefaultTextDefault: colorPalettePrimary.red600,
|
|
123
|
+
actionDangerDefaultTextHover: colorPalettePrimary.red700,
|
|
124
|
+
actionDangerDefaultTextPress: colorPalettePrimary.red800,
|
|
125
|
+
actionDefaultBackgroundDefault: chroma(colorPalettePrimary.blue800).alpha(0).hex(),
|
|
126
|
+
actionDefaultBackgroundHover: chroma(colorPalettePrimary.blue600).alpha(0.08).hex(),
|
|
127
|
+
actionDefaultBackgroundPress: chroma(colorPalettePrimary.blue600).alpha(0.16).hex(),
|
|
128
|
+
actionDefaultBorderDefault: colorPalettePrimary.grey300,
|
|
129
|
+
actionDefaultBorderFocus: colorPalettePrimary.blue600,
|
|
130
|
+
actionDefaultBorderHover: colorPalettePrimary.blue700,
|
|
131
|
+
actionDefaultBorderPress: colorPalettePrimary.blue800,
|
|
132
|
+
actionDefaultTextDefault: colorPalettePrimary.grey800,
|
|
133
|
+
actionDefaultTextHover: colorPalettePrimary.blue700,
|
|
134
|
+
actionDefaultTextPress: colorPalettePrimary.blue800,
|
|
135
|
+
actionDisabledBackground: colorPalettePrimary.grey200,
|
|
136
|
+
actionDisabledText: colorPalettePrimary.grey400,
|
|
137
|
+
actionPrimaryBackgroundDefault: colorPalettePrimary.blue600,
|
|
138
|
+
actionPrimaryBackgroundHover: colorPalettePrimary.blue700,
|
|
139
|
+
actionPrimaryBackgroundPress: colorPalettePrimary.blue800,
|
|
140
|
+
actionPrimaryTextDefault: colorPalettePrimary.white,
|
|
141
|
+
actionPrimaryTextHover: colorPalettePrimary.white,
|
|
142
|
+
actionPrimaryTextPress: colorPalettePrimary.white,
|
|
143
|
+
actionTertiaryBackgroundDefault: chroma(colorPalettePrimary.blue600).alpha(0).hex(),
|
|
144
|
+
actionTertiaryBackgroundHover: chroma(colorPalettePrimary.blue600).alpha(0.08).hex(),
|
|
145
|
+
actionTertiaryBackgroundPress: chroma(colorPalettePrimary.blue600).alpha(0.16).hex(),
|
|
146
|
+
actionTertiaryTextDefault: colorPalettePrimary.blue600,
|
|
147
|
+
actionTertiaryTextHover: colorPalettePrimary.blue700,
|
|
148
|
+
actionTertiaryTextPress: colorPalettePrimary.blue800,
|
|
149
|
+
backgroundDanger: chroma(colorPalettePrimary.red100).alpha(0.08).hex(),
|
|
150
|
+
backgroundSecondary: colorPalettePrimary.grey100,
|
|
151
|
+
backgroundWarning: chroma(colorPalettePrimary.yellow100).alpha(0.08).hex(),
|
|
152
|
+
backgroundValidationDanger: colorPalettePrimary.red100,
|
|
153
|
+
backgroundValidationSuccess: colorPalettePrimary.blue100,
|
|
154
|
+
backgroundValidationWarning: colorPalettePrimary.yellow100,
|
|
155
|
+
border: colorPalettePrimary.grey300,
|
|
156
|
+
borderDecorative: colorPalettePrimary.grey200,
|
|
157
|
+
borderValidationDanger: colorPalettePrimary.red300,
|
|
158
|
+
borderValidationWarning: colorPalettePrimary.yellow300,
|
|
159
|
+
textPrimary: colorPalettePrimary.grey800,
|
|
160
|
+
textSecondary: colorPalettePrimary.grey600,
|
|
161
|
+
textPlaceholder: colorPalettePrimary.grey400,
|
|
162
|
+
textValidationDanger: colorPalettePrimary.red600,
|
|
163
|
+
textValidationSuccess: colorPalettePrimary.green600,
|
|
164
|
+
textValidationWarning: colorPalettePrimary.yellow600,
|
|
165
|
+
textValidationInfo: colorPalettePrimary.grey600,
|
|
166
|
+
overlayOverlay: chroma(colorPalettePrimary.grey100).alpha(0.72).hex(),
|
|
167
|
+
// Tags
|
|
168
|
+
tagDefault: chroma(colorPalettePrimary.grey600).alpha(0.08).hex(),
|
|
169
|
+
tagBrown: colorPaletteSecondary.brown,
|
|
170
|
+
tagCoral: colorPaletteSecondary.coral,
|
|
171
|
+
tagCharcoal: colorPalettePrimary.grey600,
|
|
172
|
+
tagIndigo: colorPaletteSecondary.indigo,
|
|
173
|
+
tagLemon: colorPaletteSecondary.lemon,
|
|
174
|
+
tagLime: colorPaletteSecondary.lime,
|
|
175
|
+
tagPink: colorPaletteSecondary.pink,
|
|
176
|
+
tagPurple: colorPaletteSecondary.purple,
|
|
177
|
+
tagTeal: colorPaletteSecondary.teal,
|
|
178
|
+
tagTurquoise: colorPaletteSecondary.turquoise,
|
|
179
|
+
tagText: colorPalettePrimary.white,
|
|
180
|
+
tagHover: chroma(colorPalettePrimary.blue400).alpha(0.08).hex(),
|
|
181
|
+
tagPress: chroma(colorPalettePrimary.blue400).alpha(0.16).hex(),
|
|
182
|
+
tagIconHover: chroma(colorPalettePrimary.white).alpha(0.8).hex(),
|
|
183
|
+
tagIconPress: chroma(colorPalettePrimary.white).alpha(0.76).hex(),
|
|
184
|
+
// Typography
|
|
185
|
+
typographyCodeBg: chroma(colorPalettePrimary.grey600).alpha(0.08).hex(),
|
|
186
|
+
// Table
|
|
187
|
+
tableRowHover: chroma(colorPalettePrimary.grey600).alpha(0.04).hex(),
|
|
188
|
+
tooltipBackgroundTooltip: colorPalettePrimary.grey800
|
|
189
|
+
};
|
|
190
|
+
const darkColorList = {
|
|
191
|
+
actionDangerPrimaryBackgroundDefault: chroma(colorPalettePrimary.red400).alpha(0.84).hex(),
|
|
192
|
+
actionDangerPrimaryBackgroundHover: chroma(colorPalettePrimary.red400).alpha(0.72).hex(),
|
|
193
|
+
actionDangerPrimaryBackgroundPress: chroma(colorPalettePrimary.red400).alpha(0.6).hex(),
|
|
194
|
+
actionDangerDefaultBackgroundDefault: chroma(colorPalettePrimary.red400).alpha(0).hex(),
|
|
195
|
+
actionDangerDefaultBackgroundHover: chroma(colorPalettePrimary.red400).alpha(0.08).hex(),
|
|
196
|
+
actionDangerDefaultBackgroundPress: chroma(colorPalettePrimary.red400).alpha(0.16).hex(),
|
|
197
|
+
actionDangerDefaultBorderDefault: colorPalettePrimary.red400,
|
|
198
|
+
actionDangerDefaultBorderHover: chroma(colorPalettePrimary.red400).alpha(0.72).hex(),
|
|
199
|
+
actionDangerDefaultBorderPress: chroma(colorPalettePrimary.red400).alpha(0.6).hex(),
|
|
200
|
+
actionDangerDefaultTextDefault: colorPalettePrimary.red400,
|
|
201
|
+
actionDangerDefaultTextHover: chroma(colorPalettePrimary.red400).alpha(0.72).hex(),
|
|
202
|
+
actionDangerDefaultTextPress: chroma(colorPalettePrimary.red400).alpha(0.6).hex(),
|
|
203
|
+
actionDefaultBackgroundDefault: chroma(colorPalettePrimary.blue400).alpha(0).hex(),
|
|
204
|
+
actionDefaultBackgroundHover: chroma(colorPalettePrimary.blue400).alpha(0.08).hex(),
|
|
205
|
+
actionDefaultBackgroundPress: chroma(colorPalettePrimary.blue400).alpha(0.16).hex(),
|
|
206
|
+
actionDefaultBorderDefault: chroma(colorPalettePrimary.white).alpha(0.6).hex(),
|
|
207
|
+
actionDefaultBorderFocus: chroma(colorPalettePrimary.blue400).alpha(0.84).hex(),
|
|
208
|
+
actionDefaultBorderHover: chroma(colorPalettePrimary.blue400).alpha(0.8).hex(),
|
|
209
|
+
actionDefaultBorderPress: chroma(colorPalettePrimary.blue400).alpha(0.76).hex(),
|
|
210
|
+
actionDefaultTextDefault: chroma(colorPalettePrimary.white).alpha(0.84).hex(),
|
|
211
|
+
actionDefaultTextHover: chroma(colorPalettePrimary.blue400).alpha(0.8).hex(),
|
|
212
|
+
actionDefaultTextPress: chroma(colorPalettePrimary.blue400).alpha(0.76).hex(),
|
|
213
|
+
actionDisabledBackground: chroma(colorPalettePrimary.white).alpha(0.24).hex(),
|
|
214
|
+
actionDisabledText: chroma(colorPalettePrimary.white).alpha(0.4).hex(),
|
|
215
|
+
actionPrimaryBackgroundDefault: chroma(colorPalettePrimary.blue400).alpha(0.84).hex(),
|
|
216
|
+
actionPrimaryBackgroundHover: chroma(colorPalettePrimary.blue400).alpha(0.8).hex(),
|
|
217
|
+
actionPrimaryBackgroundPress: chroma(colorPalettePrimary.blue400).alpha(0.76).hex(),
|
|
218
|
+
actionPrimaryTextDefault: colorPalettePrimary.grey800,
|
|
219
|
+
actionPrimaryTextHover: colorPalettePrimary.grey800,
|
|
220
|
+
actionPrimaryTextPress: colorPalettePrimary.grey800,
|
|
221
|
+
actionTertiaryBackgroundDefault: chroma(colorPalettePrimary.blue400).alpha(0).hex(),
|
|
222
|
+
actionTertiaryBackgroundHover: chroma(colorPalettePrimary.blue400).alpha(0.08).hex(),
|
|
223
|
+
actionTertiaryBackgroundPress: chroma(colorPalettePrimary.blue400).alpha(0.16).hex(),
|
|
224
|
+
actionTertiaryTextDefault: chroma(colorPalettePrimary.blue400).alpha(0.84).hex(),
|
|
225
|
+
actionTertiaryTextHover: chroma(colorPalettePrimary.blue400).alpha(0.8).hex(),
|
|
226
|
+
actionTertiaryTextPress: chroma(colorPalettePrimary.blue400).alpha(0.76).hex(),
|
|
227
|
+
backgroundPrimary: colorPalettePrimary.grey800,
|
|
228
|
+
backgroundSecondary: '#283035',
|
|
229
|
+
backgroundValidationDanger: 'transparent',
|
|
230
|
+
backgroundValidationSuccess: 'transparent',
|
|
231
|
+
backgroundValidationWarning: 'transparent',
|
|
232
|
+
border: chroma(colorPalettePrimary.white).alpha(0.48).hex(),
|
|
233
|
+
borderDecorative: chroma(colorPalettePrimary.white).alpha(0.24).hex(),
|
|
234
|
+
borderValidationDanger: colorPalettePrimary.red300,
|
|
235
|
+
borderValidationWarning: colorPalettePrimary.yellow300,
|
|
236
|
+
textPrimary: chroma(colorPalettePrimary.white).alpha(0.84).hex(),
|
|
237
|
+
textSecondary: chroma(colorPalettePrimary.white).alpha(0.6).hex(),
|
|
238
|
+
textPlaceholder: chroma(colorPalettePrimary.grey400).alpha(0.84).hex(),
|
|
239
|
+
textValidationDanger: chroma(colorPalettePrimary.red400).alpha(0.84).hex(),
|
|
240
|
+
textValidationSuccess: chroma(colorPalettePrimary.green400).alpha(0.84).hex(),
|
|
241
|
+
textValidationWarning: chroma(colorPalettePrimary.yellow400).alpha(0.84).hex(),
|
|
242
|
+
textValidationInfo: chroma(colorPalettePrimary.white).alpha(0.6).hex(),
|
|
243
|
+
overlayOverlay: chroma(colorPalettePrimary.grey800).alpha(0.72).hex(),
|
|
244
|
+
// Tags
|
|
245
|
+
tagDefault: chroma(colorPalettePrimary.white).alpha(0.16).hex(),
|
|
246
|
+
tagBrown: chroma(colorPaletteSecondary.brown).alpha(0.84).hex(),
|
|
247
|
+
tagCoral: chroma(colorPaletteSecondary.coral).alpha(0.84).hex(),
|
|
248
|
+
tagCharcoal: chroma(colorPalettePrimary.grey600).alpha(0.84).hex(),
|
|
249
|
+
tagIndigo: chroma(colorPaletteSecondary.indigo).alpha(0.84).hex(),
|
|
250
|
+
tagLemon: chroma(colorPaletteSecondary.lemon).alpha(0.84).hex(),
|
|
251
|
+
tagLime: chroma(colorPaletteSecondary.lime).alpha(0.84).hex(),
|
|
252
|
+
tagPink: chroma(colorPaletteSecondary.pink).alpha(0.84).hex(),
|
|
253
|
+
tagPurple: chroma(colorPaletteSecondary.purple).alpha(0.84).hex(),
|
|
254
|
+
tagTeal: chroma(colorPaletteSecondary.teal).alpha(0.84).hex(),
|
|
255
|
+
tagTurquoise: chroma(colorPaletteSecondary.turquoise).alpha(0.84).hex(),
|
|
256
|
+
tagText: chroma(colorPalettePrimary.white).alpha(0.84).hex(),
|
|
257
|
+
tagHover: chroma(colorPalettePrimary.blue400).alpha(0.08).hex(),
|
|
258
|
+
tagPress: chroma(colorPalettePrimary.blue400).alpha(0.16).hex(),
|
|
259
|
+
tagIconHover: chroma(colorPalettePrimary.white).alpha(0.8).hex(),
|
|
260
|
+
tagIconPress: chroma(colorPalettePrimary.white).alpha(0.76).hex(),
|
|
261
|
+
// Typography
|
|
262
|
+
typographyCodeBg: chroma(colorPalettePrimary.white).alpha(0.16).hex(),
|
|
263
|
+
// Table
|
|
264
|
+
tableRowHover: chroma(colorPalettePrimary.white).alpha(0.16).hex(),
|
|
265
|
+
tooltipBackgroundTooltip: chroma(colorPalettePrimary.white).alpha(0.6).hex(),
|
|
266
|
+
// Missing in list
|
|
267
|
+
backgroundDanger: 'rgba(200,45,76,0.08)',
|
|
268
|
+
backgroundWarning: 'rgba(222,121,33,0.08)'
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
const darkColors = {
|
|
272
|
+
...darkColorList,
|
|
273
|
+
...colorPalettePrimary,
|
|
274
|
+
...colorPaletteSecondary
|
|
275
|
+
};
|
|
276
|
+
const lightColors = {
|
|
277
|
+
...lightColorList,
|
|
278
|
+
...colorPalettePrimary,
|
|
279
|
+
...colorPaletteSecondary
|
|
280
|
+
};
|
|
281
|
+
function getSemanticColors(isDarkMode) {
|
|
282
|
+
return isDarkMode ? darkColors : lightColors;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// TODO (FEINF-1674): Remove when removing USE_NEW_RADIO_STYLES
|
|
286
|
+
/*
|
|
287
|
+
Colors that need to be replaced by semantic colors.
|
|
288
|
+
*/
|
|
289
|
+
const deprecatedColors = {
|
|
290
|
+
// Radio Colors
|
|
291
|
+
radioInteractiveAvailable: colorPalettePrimary.primary,
|
|
292
|
+
radioInteractiveHover: '#186099',
|
|
293
|
+
radioInteractivePress: '#0D4F85',
|
|
294
|
+
radioDisabled: '#A2AEB8',
|
|
295
|
+
radioDefaultBorder: '#64727D',
|
|
296
|
+
radioDefaultBackground: '#FFFFFF',
|
|
297
|
+
radioInteractiveHoverSecondary: 'rgba(34, 115, 181, 0.08)',
|
|
298
|
+
// Fade of Interactive Available
|
|
299
|
+
radioInteractivePressSecondary: 'rgba(34, 115, 181, 0.16)' // Fade of Interactive Available
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
function getColors(isDarkMode) {
|
|
303
|
+
return {
|
|
304
|
+
...deprecatedColors,
|
|
305
|
+
...getSemanticColors(isDarkMode)
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// eslint-disable-next-line import/no-anonymous-default-export
|
|
310
|
+
var antdVars = {
|
|
311
|
+
// IMPORTANT: Do not read this directly from components. Use `React.useContext`.
|
|
312
|
+
'ant-prefix': 'du-bois'
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
const DEFAULT_SPACING_UNIT = 8;
|
|
316
|
+
const MODAL_PADDING = 40;
|
|
317
|
+
const spacing = {
|
|
318
|
+
xs: DEFAULT_SPACING_UNIT / 2,
|
|
319
|
+
sm: DEFAULT_SPACING_UNIT,
|
|
320
|
+
md: DEFAULT_SPACING_UNIT * 2,
|
|
321
|
+
lg: DEFAULT_SPACING_UNIT * 3
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
// Less variables that are used by AntD
|
|
325
|
+
({
|
|
326
|
+
defaultPaddingLg: spacing.lg,
|
|
327
|
+
defaultPaddingMd: spacing.md,
|
|
328
|
+
defaultPaddingSm: spacing.sm,
|
|
329
|
+
defaultPaddingXs: spacing.sm,
|
|
330
|
+
defaultPaddingXss: spacing.xs,
|
|
331
|
+
paddingLg: spacing.md,
|
|
332
|
+
// TODO: Check if there is a better alternative with team
|
|
333
|
+
paddingMd: spacing.sm,
|
|
334
|
+
paddingSm: spacing.sm,
|
|
335
|
+
paddingXs: spacing.xs,
|
|
336
|
+
paddingXss: 0,
|
|
337
|
+
marginSm: 12,
|
|
338
|
+
marginLg: spacing.lg,
|
|
339
|
+
// Button
|
|
340
|
+
btnPaddingHorizontalBase: DEFAULT_SPACING_UNIT * 2,
|
|
341
|
+
btnPaddingHorizontalLg: DEFAULT_SPACING_UNIT * 2,
|
|
342
|
+
btnPaddingHorizontalSm: DEFAULT_SPACING_UNIT * 2,
|
|
343
|
+
// Input
|
|
344
|
+
inputPaddingHorizontal: DEFAULT_SPACING_UNIT * 1.5,
|
|
345
|
+
inputPaddingHorizontalBase: DEFAULT_SPACING_UNIT * 1.5,
|
|
346
|
+
inputPaddingHorizontalSm: DEFAULT_SPACING_UNIT * 1.5,
|
|
347
|
+
inputPaddingHorizontalLg: DEFAULT_SPACING_UNIT * 1.5,
|
|
348
|
+
inputPaddingVertical: spacing.xs + 1,
|
|
349
|
+
inputPaddingVerticalBase: spacing.xs + 1,
|
|
350
|
+
inputPaddingVerticalSm: spacing.xs + 1,
|
|
351
|
+
inputPaddingVerticalLg: spacing.xs + 1,
|
|
352
|
+
// Modal
|
|
353
|
+
modalPadding: MODAL_PADDING,
|
|
354
|
+
modalLessPadding: MODAL_PADDING - 20,
|
|
355
|
+
modalHeaderPadding: `${MODAL_PADDING}px ${MODAL_PADDING}px ${MODAL_PADDING - 20}px`,
|
|
356
|
+
modalHeaderCloseSize: MODAL_PADDING * 2 + 22,
|
|
357
|
+
modalHeaderBorderWidth: 0,
|
|
358
|
+
modalBodyPadding: `0 ${MODAL_PADDING}px`,
|
|
359
|
+
modalFooterPaddingVertical: 0,
|
|
360
|
+
modalFooterPaddingHorizontal: 0,
|
|
361
|
+
modalFooterBorderWidth: 0,
|
|
362
|
+
// Switch
|
|
363
|
+
switchPadding: 0,
|
|
364
|
+
switchHeight: 16,
|
|
365
|
+
switchMinWidth: 28,
|
|
366
|
+
switchPinSize: 14
|
|
367
|
+
});
|
|
368
|
+
var spacing$1 = spacing;
|
|
369
|
+
|
|
370
|
+
const heightBase = 40;
|
|
371
|
+
const borderWidth = 1;
|
|
372
|
+
const antdGeneralVariables = {
|
|
373
|
+
classnamePrefix: antdVars['ant-prefix'],
|
|
374
|
+
iconfontCssPrefix: 'anticon',
|
|
375
|
+
borderRadiusBase: 4,
|
|
376
|
+
borderWidth: borderWidth,
|
|
377
|
+
heightSm: 32,
|
|
378
|
+
heightBase: heightBase,
|
|
379
|
+
iconSize: 24,
|
|
380
|
+
iconFontSize: 16,
|
|
381
|
+
buttonHeight: heightBase,
|
|
382
|
+
// Height available within button (for label and icon). Same for middle and small buttons.
|
|
383
|
+
buttonInnerHeight: heightBase - spacing$1.sm * 2 - borderWidth * 2
|
|
384
|
+
};
|
|
385
|
+
const getShadowVariables = isDarkMode => {
|
|
386
|
+
if (isDarkMode) {
|
|
387
|
+
return {
|
|
388
|
+
shadowLow: '0px 4px 16px rgba(0, 0, 0, 0.12)',
|
|
389
|
+
shadowHigh: '0px 8px 24px rgba(0, 0, 0, 0.2);'
|
|
390
|
+
};
|
|
391
|
+
} else {
|
|
392
|
+
return {
|
|
393
|
+
shadowLow: '0px 4px 16px rgba(31, 39, 45, 0.12)',
|
|
394
|
+
shadowHigh: '0px 8px 24px rgba(31, 39, 45, 0.2)'
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
var generalVariables = antdGeneralVariables;
|
|
399
|
+
|
|
400
|
+
const FONT_SIZE_BASE = 13;
|
|
401
|
+
|
|
402
|
+
// Less variables that are used by AntD
|
|
403
|
+
const antdTypography = {
|
|
404
|
+
fontSizeSm: 12,
|
|
405
|
+
fontSizeBase: FONT_SIZE_BASE,
|
|
406
|
+
fontSizeMd: FONT_SIZE_BASE,
|
|
407
|
+
fontSizeLg: 18,
|
|
408
|
+
fontSizeXl: 22,
|
|
409
|
+
fontSizeXxl: 32,
|
|
410
|
+
lineHeightSm: '16px',
|
|
411
|
+
lineHeightBase: '20px',
|
|
412
|
+
lineHeightMd: '20px',
|
|
413
|
+
lineHeightLg: '24px',
|
|
414
|
+
lineHeightXl: '28px',
|
|
415
|
+
lineHeightXxl: '40px',
|
|
416
|
+
typographyBoldFontWeight: 600
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
// eslint-disable-next-line import/no-anonymous-default-export
|
|
420
|
+
var typography = {
|
|
421
|
+
...antdTypography
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
const defaultOptions = {
|
|
425
|
+
enableAnimation: false,
|
|
426
|
+
zIndexBase: 1000
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
// Function to get variables for a certain theme.
|
|
430
|
+
// End users should use useDesignSystemTheme instead.
|
|
431
|
+
function getTheme(isDarkMode) {
|
|
432
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultOptions;
|
|
433
|
+
return {
|
|
434
|
+
colors: getColors(isDarkMode),
|
|
435
|
+
spacing: spacing$1,
|
|
436
|
+
general: {
|
|
437
|
+
...generalVariables,
|
|
438
|
+
...getShadowVariables(isDarkMode)
|
|
439
|
+
},
|
|
440
|
+
typography,
|
|
441
|
+
borders: borders$1,
|
|
442
|
+
responsive: responsive$1,
|
|
443
|
+
isDarkMode,
|
|
444
|
+
options
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
function getClassNamePrefix(theme) {
|
|
449
|
+
const antdThemeName = theme.isDarkMode ? 'dark' : 'light';
|
|
450
|
+
return `${theme.general.classnamePrefix}-${antdThemeName}`;
|
|
451
|
+
}
|
|
452
|
+
function getPrefixedClassNameFromTheme(theme, className) {
|
|
453
|
+
return [getClassNamePrefix(theme), className].filter(Boolean).join('-');
|
|
454
|
+
}
|
|
455
|
+
function useDesignSystemTheme() {
|
|
456
|
+
const emotionTheme = useTheme();
|
|
457
|
+
// Graceful fallback to default theme in case a test or developer forgot context.
|
|
458
|
+
const theme = emotionTheme && emotionTheme.general ? emotionTheme : getTheme(false);
|
|
459
|
+
return {
|
|
460
|
+
theme: theme,
|
|
461
|
+
classNamePrefix: getClassNamePrefix(theme),
|
|
462
|
+
getPrefixedClassName: className => getPrefixedClassNameFromTheme(theme, className)
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
// This is a simple typed HOC wrapper around the useDesignSystemTheme hook, for use in older react components.
|
|
466
|
+
function WithDesignSystemThemeHoc(Component) {
|
|
467
|
+
return function WrappedWithDesignSystemTheme(props) {
|
|
468
|
+
const themeValues = useDesignSystemTheme();
|
|
469
|
+
return jsx(Component, {
|
|
470
|
+
...props,
|
|
471
|
+
designSystemThemeApi: themeValues
|
|
472
|
+
});
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
const DuboisContextDefaults = {
|
|
477
|
+
enableAnimation: false,
|
|
478
|
+
// Prefer to use useDesignSystemTheme.getPrefixedClassName instead
|
|
479
|
+
getPrefixCls: suffix => suffix ? `du-bois-${suffix}` : 'du-bois',
|
|
480
|
+
flags: {}
|
|
481
|
+
};
|
|
482
|
+
const DesignSystemThemeContext = /*#__PURE__*/createContext({
|
|
483
|
+
isDarkMode: false
|
|
484
|
+
});
|
|
485
|
+
const DesignSystemContext = /*#__PURE__*/createContext(DuboisContextDefaults);
|
|
486
|
+
const DU_BOIS_ENABLE_ANIMATION_CLASSNAME = 'du-bois-enable-animation';
|
|
487
|
+
function getAnimationCss(enableAnimation) {
|
|
488
|
+
const disableAnimationCss = {
|
|
489
|
+
animationDuration: '0s !important',
|
|
490
|
+
transition: 'none !important'
|
|
491
|
+
};
|
|
492
|
+
return enableAnimation ? {} : {
|
|
493
|
+
// Apply to the current element
|
|
494
|
+
...disableAnimationCss,
|
|
495
|
+
'&::before': disableAnimationCss,
|
|
496
|
+
'&::after': disableAnimationCss,
|
|
497
|
+
// Also apply to all child elements with a class that starts with our prefix
|
|
498
|
+
[`[class*=du-bois]:not(.${DU_BOIS_ENABLE_ANIMATION_CLASSNAME}, .${DU_BOIS_ENABLE_ANIMATION_CLASSNAME} *)`]: {
|
|
499
|
+
...disableAnimationCss,
|
|
500
|
+
// Also target any pseudo-elements associated with those elements, since these can also be animated.
|
|
501
|
+
'&::before': disableAnimationCss,
|
|
502
|
+
'&::after': disableAnimationCss
|
|
503
|
+
}
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
const DesignSystemProviderPropsContext = /*#__PURE__*/React__default.createContext(null);
|
|
507
|
+
const AntDConfigProviderPropsContext = /*#__PURE__*/React__default.createContext(null);
|
|
508
|
+
|
|
509
|
+
/** Only to be accessed by SupportsDuBoisThemes, except for special exceptions like tests and storybook. Ask in #dubois first if you need to use it. */
|
|
510
|
+
const DesignSystemThemeProvider = _ref => {
|
|
511
|
+
let {
|
|
512
|
+
isDarkMode = false,
|
|
513
|
+
children
|
|
514
|
+
} = _ref;
|
|
515
|
+
return jsx(DesignSystemThemeContext.Provider, {
|
|
516
|
+
value: {
|
|
517
|
+
isDarkMode
|
|
518
|
+
},
|
|
519
|
+
children: children
|
|
520
|
+
});
|
|
521
|
+
};
|
|
522
|
+
const DesignSystemProvider = _ref2 => {
|
|
523
|
+
let {
|
|
524
|
+
isDarkMode: deprecatedDarkModeProp,
|
|
525
|
+
children,
|
|
526
|
+
enableAnimation = false,
|
|
527
|
+
zIndexBase = 1000,
|
|
528
|
+
getPopupContainer,
|
|
529
|
+
flags = {}
|
|
530
|
+
} = _ref2;
|
|
531
|
+
const {
|
|
532
|
+
isDarkMode: contextDarkModeVal
|
|
533
|
+
} = useContext(DesignSystemThemeContext);
|
|
534
|
+
const isDarkMode = deprecatedDarkModeProp !== null && deprecatedDarkModeProp !== void 0 ? deprecatedDarkModeProp : contextDarkModeVal;
|
|
535
|
+
const theme = useMemo(() => getTheme(isDarkMode, {
|
|
536
|
+
enableAnimation,
|
|
537
|
+
zIndexBase
|
|
538
|
+
}),
|
|
539
|
+
// TODO: revisit this
|
|
540
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
541
|
+
[isDarkMode, zIndexBase]);
|
|
542
|
+
const providerPropsContext = useMemo(() => ({
|
|
543
|
+
isDarkMode,
|
|
544
|
+
enableAnimation,
|
|
545
|
+
zIndexBase,
|
|
546
|
+
getPopupContainer,
|
|
547
|
+
flags
|
|
548
|
+
}), [isDarkMode, enableAnimation, zIndexBase, getPopupContainer, flags]);
|
|
549
|
+
const classNamePrefix = getClassNamePrefix(theme);
|
|
550
|
+
const value = useMemo(() => {
|
|
551
|
+
return {
|
|
552
|
+
enableAnimation,
|
|
553
|
+
isDarkMode,
|
|
554
|
+
getPrefixCls: suffix => getPrefixedClassNameFromTheme(theme, suffix),
|
|
555
|
+
getPopupContainer,
|
|
556
|
+
flags
|
|
557
|
+
};
|
|
558
|
+
}, [enableAnimation, theme, isDarkMode, getPopupContainer, flags]);
|
|
559
|
+
useEffect(() => {
|
|
560
|
+
return () => {
|
|
561
|
+
// when the design system context is unmounted, make sure the notification cache is also cleaned up
|
|
562
|
+
notification.destroy();
|
|
563
|
+
};
|
|
564
|
+
}, []);
|
|
565
|
+
return jsx(DesignSystemProviderPropsContext.Provider, {
|
|
566
|
+
value: providerPropsContext,
|
|
567
|
+
children: jsx(ThemeProvider, {
|
|
568
|
+
theme: theme,
|
|
569
|
+
children: jsx(AntDConfigProviderPropsContext.Provider, {
|
|
570
|
+
value: {
|
|
571
|
+
prefixCls: classNamePrefix,
|
|
572
|
+
getPopupContainer
|
|
573
|
+
},
|
|
574
|
+
children: jsx(DesignSystemContext.Provider, {
|
|
575
|
+
value: value,
|
|
576
|
+
children: children
|
|
577
|
+
})
|
|
578
|
+
})
|
|
579
|
+
})
|
|
580
|
+
});
|
|
581
|
+
};
|
|
582
|
+
const ApplyDesignSystemContextOverrides = _ref3 => {
|
|
583
|
+
let {
|
|
584
|
+
enableAnimation,
|
|
585
|
+
zIndexBase,
|
|
586
|
+
getPopupContainer,
|
|
587
|
+
flags,
|
|
588
|
+
children
|
|
589
|
+
} = _ref3;
|
|
590
|
+
const parentDesignSystemProviderProps = useContext(DesignSystemProviderPropsContext);
|
|
591
|
+
if (parentDesignSystemProviderProps === null) {
|
|
592
|
+
throw new Error(`ApplyDesignSystemContextOverrides cannot be used standalone - DesignSystemProvider must exist in the React context`);
|
|
593
|
+
}
|
|
594
|
+
const newProps = useMemo(() => ({
|
|
595
|
+
...parentDesignSystemProviderProps,
|
|
596
|
+
enableAnimation: enableAnimation !== null && enableAnimation !== void 0 ? enableAnimation : parentDesignSystemProviderProps.enableAnimation,
|
|
597
|
+
zIndexBase: zIndexBase !== null && zIndexBase !== void 0 ? zIndexBase : parentDesignSystemProviderProps.zIndexBase,
|
|
598
|
+
getPopupContainer: getPopupContainer !== null && getPopupContainer !== void 0 ? getPopupContainer : parentDesignSystemProviderProps.getPopupContainer,
|
|
599
|
+
flags: {
|
|
600
|
+
...parentDesignSystemProviderProps.flags,
|
|
601
|
+
...flags
|
|
602
|
+
}
|
|
603
|
+
}), [parentDesignSystemProviderProps, enableAnimation, zIndexBase, getPopupContainer, flags]);
|
|
604
|
+
return jsx(DesignSystemProvider, {
|
|
605
|
+
...newProps,
|
|
606
|
+
children: children
|
|
607
|
+
});
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
// This is a more-specific version of `ApplyDesignSystemContextOverrides` that only allows overriding the flags.
|
|
611
|
+
const ApplyDesignSystemFlags = _ref4 => {
|
|
612
|
+
let {
|
|
613
|
+
flags,
|
|
614
|
+
children
|
|
615
|
+
} = _ref4;
|
|
616
|
+
const parentDesignSystemProviderProps = useContext(DesignSystemProviderPropsContext);
|
|
617
|
+
if (parentDesignSystemProviderProps === null) {
|
|
618
|
+
throw new Error(`ApplyDesignSystemFlags cannot be used standalone - DesignSystemProvider must exist in the React context`);
|
|
619
|
+
}
|
|
620
|
+
const newProps = useMemo(() => ({
|
|
621
|
+
...parentDesignSystemProviderProps,
|
|
622
|
+
flags: {
|
|
623
|
+
...parentDesignSystemProviderProps.flags,
|
|
624
|
+
...flags
|
|
625
|
+
}
|
|
626
|
+
}), [parentDesignSystemProviderProps, flags]);
|
|
627
|
+
return jsx(DesignSystemProvider, {
|
|
628
|
+
...newProps,
|
|
629
|
+
children: children
|
|
630
|
+
});
|
|
631
|
+
};
|
|
632
|
+
const DesignSystemAntDConfigProvider = _ref5 => {
|
|
633
|
+
let {
|
|
634
|
+
children
|
|
635
|
+
} = _ref5;
|
|
636
|
+
const antdContext = useAntDConfigProviderContext();
|
|
637
|
+
return jsx(ConfigProvider, {
|
|
638
|
+
...antdContext,
|
|
639
|
+
children: children
|
|
640
|
+
});
|
|
641
|
+
};
|
|
642
|
+
const useAntDConfigProviderContext = () => {
|
|
643
|
+
var _useContext;
|
|
644
|
+
return (_useContext = useContext(AntDConfigProviderPropsContext)) !== null && _useContext !== void 0 ? _useContext : {
|
|
645
|
+
prefixCls: undefined
|
|
646
|
+
};
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* When using AntD components inside Design System wrapper components (e.g. Modal, Collapse etc),
|
|
651
|
+
* we don't want Design System's prefix class to override them.
|
|
652
|
+
*
|
|
653
|
+
* Since all Design System's components have are wrapped with DesignSystemAntDConfigProvider,
|
|
654
|
+
* this won't affect their own prefixCls, but just allow nested antd components to keep their ant prefix.
|
|
655
|
+
*/
|
|
656
|
+
const RestoreAntDDefaultClsPrefix = _ref6 => {
|
|
657
|
+
let {
|
|
658
|
+
children
|
|
659
|
+
} = _ref6;
|
|
660
|
+
return jsx(ConfigProvider, {
|
|
661
|
+
prefixCls: "ant",
|
|
662
|
+
children: children
|
|
663
|
+
});
|
|
664
|
+
};
|
|
665
|
+
|
|
666
|
+
function useDesignSystemContext() {
|
|
667
|
+
return useContext(DesignSystemContext);
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
function useDesignSystemFlags() {
|
|
671
|
+
const context = useDesignSystemContext();
|
|
672
|
+
return context.flags;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
const getIconEmotionStyles = theme => {
|
|
676
|
+
return /*#__PURE__*/css({
|
|
677
|
+
fontSize: theme.general.iconFontSize
|
|
678
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:getIconEmotionStyles;");
|
|
679
|
+
};
|
|
680
|
+
const getIconValidationColor = (theme, color) => {
|
|
681
|
+
switch (color) {
|
|
682
|
+
case 'success':
|
|
683
|
+
return theme.colors.textValidationSuccess;
|
|
684
|
+
case 'warning':
|
|
685
|
+
return theme.colors.textValidationWarning;
|
|
686
|
+
case 'danger':
|
|
687
|
+
return theme.colors.textValidationDanger;
|
|
688
|
+
default:
|
|
689
|
+
return color;
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
const Icon = props => {
|
|
693
|
+
const {
|
|
694
|
+
component: Component,
|
|
695
|
+
dangerouslySetAntdProps,
|
|
696
|
+
color,
|
|
697
|
+
style,
|
|
698
|
+
...otherProps
|
|
699
|
+
} = props;
|
|
700
|
+
const {
|
|
701
|
+
theme
|
|
702
|
+
} = useDesignSystemTheme();
|
|
703
|
+
const MemoizedComponent = useMemo(() => Component ? _ref => {
|
|
704
|
+
let {
|
|
705
|
+
fill,
|
|
706
|
+
...iconProps
|
|
707
|
+
} = _ref;
|
|
708
|
+
return (
|
|
709
|
+
// We don't rely on top-level fills for our colors. Fills are specified
|
|
710
|
+
// with "currentColor" on children of the top-most svg.
|
|
711
|
+
jsx(Component, {
|
|
712
|
+
fill: "none",
|
|
713
|
+
...iconProps
|
|
714
|
+
})
|
|
715
|
+
);
|
|
716
|
+
} : undefined, [Component]);
|
|
717
|
+
return jsx(DesignSystemAntDConfigProvider, {
|
|
718
|
+
children: jsx(AntDIcon, {
|
|
719
|
+
css: getIconEmotionStyles(theme),
|
|
720
|
+
component: MemoizedComponent,
|
|
721
|
+
style: {
|
|
722
|
+
color: getIconValidationColor(theme, color),
|
|
723
|
+
...style
|
|
724
|
+
},
|
|
725
|
+
...otherProps,
|
|
726
|
+
...dangerouslySetAntdProps
|
|
727
|
+
})
|
|
728
|
+
});
|
|
729
|
+
};
|
|
730
|
+
|
|
731
|
+
function SvgChevronLeftIcon(props) {
|
|
732
|
+
return jsx("svg", {
|
|
733
|
+
width: "1em",
|
|
734
|
+
height: "1em",
|
|
735
|
+
viewBox: "0 0 16 16",
|
|
736
|
+
fill: "none",
|
|
737
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
738
|
+
...props,
|
|
739
|
+
children: jsx("path", {
|
|
740
|
+
fillRule: "evenodd",
|
|
741
|
+
clipRule: "evenodd",
|
|
742
|
+
d: "M7.083 8L10 10.947 8.958 12 5 8l3.958-4L10 5.053 7.083 8z",
|
|
743
|
+
fill: "currentColor"
|
|
744
|
+
})
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
function ChevronLeftIcon(props) {
|
|
748
|
+
return jsx(Icon, {
|
|
749
|
+
...props,
|
|
750
|
+
component: SvgChevronLeftIcon
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
function SvgChevronRightIcon(props) {
|
|
755
|
+
return jsx("svg", {
|
|
756
|
+
width: "1em",
|
|
757
|
+
height: "1em",
|
|
758
|
+
viewBox: "0 0 16 16",
|
|
759
|
+
fill: "none",
|
|
760
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
761
|
+
...props,
|
|
762
|
+
children: jsx("path", {
|
|
763
|
+
fillRule: "evenodd",
|
|
764
|
+
clipRule: "evenodd",
|
|
765
|
+
d: "M8.917 8L6 5.053 7.042 4 11 8l-3.958 4L6 10.947 8.917 8z",
|
|
766
|
+
fill: "currentColor"
|
|
767
|
+
})
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
function ChevronRightIcon(props) {
|
|
771
|
+
return jsx(Icon, {
|
|
772
|
+
...props,
|
|
773
|
+
component: SvgChevronRightIcon
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
function SvgCloseIcon(props) {
|
|
778
|
+
return jsx("svg", {
|
|
779
|
+
width: "1em",
|
|
780
|
+
height: "1em",
|
|
781
|
+
viewBox: "0 0 16 16",
|
|
782
|
+
fill: "none",
|
|
783
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
784
|
+
...props,
|
|
785
|
+
children: jsx("path", {
|
|
786
|
+
fillRule: "evenodd",
|
|
787
|
+
clipRule: "evenodd",
|
|
788
|
+
d: "M6.97 8.03L2 3.06 3.06 2l4.97 4.97L13 2l1.06 1.06-4.969 4.97 4.97 4.97L13 14.06 8.03 9.092l-4.97 4.97L2 13l4.97-4.97z",
|
|
789
|
+
fill: "currentColor"
|
|
790
|
+
})
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
function CloseIcon(props) {
|
|
794
|
+
return jsx(Icon, {
|
|
795
|
+
...props,
|
|
796
|
+
component: SvgCloseIcon
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
function SvgFaceFrownIcon(props) {
|
|
801
|
+
return jsxs("svg", {
|
|
802
|
+
width: "1em",
|
|
803
|
+
height: "1em",
|
|
804
|
+
viewBox: "0 0 16 16",
|
|
805
|
+
fill: "none",
|
|
806
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
807
|
+
...props,
|
|
808
|
+
children: [jsxs("g", {
|
|
809
|
+
clipPath: "url(#FaceFrownIcon_svg__clip0_16320_32311)",
|
|
810
|
+
fill: "currentColor",
|
|
811
|
+
children: [jsx("path", {
|
|
812
|
+
d: "M6 5.25a.75.75 0 000 1.5h.007a.75.75 0 000-1.5H6zM9.25 6a.75.75 0 01.75-.75h.007a.75.75 0 010 1.5H10A.75.75 0 019.25 6zM10.07 11.12a.75.75 0 001.197-.903l-.001-.001v-.001l-.003-.003-.005-.006-.015-.02a2.95 2.95 0 00-.217-.246 4.717 4.717 0 00-.627-.546C9.86 9 9.04 8.584 8 8.584s-1.858.416-2.4.81a4.716 4.716 0 00-.795.733 2.87 2.87 0 00-.048.06l-.015.019-.005.006-.002.003-.031.044.03-.042a.75.75 0 101.22.875 3.219 3.219 0 01.529-.485c.375-.273.89-.523 1.517-.523.627 0 1.142.25 1.517.523a3.219 3.219 0 01.529.485l.021.025.002.003z"
|
|
813
|
+
}), jsx("path", {
|
|
814
|
+
fillRule: "evenodd",
|
|
815
|
+
clipRule: "evenodd",
|
|
816
|
+
d: "M8 .583a7.417 7.417 0 100 14.834A7.417 7.417 0 008 .583zM2.083 8a5.917 5.917 0 1111.834 0A5.917 5.917 0 012.083 8z"
|
|
817
|
+
})]
|
|
818
|
+
}), jsx("defs", {
|
|
819
|
+
children: jsx("clipPath", {
|
|
820
|
+
id: "FaceFrownIcon_svg__clip0_16320_32311",
|
|
821
|
+
children: jsx("path", {
|
|
822
|
+
fill: "#fff",
|
|
823
|
+
d: "M0 0h16v16H0z"
|
|
824
|
+
})
|
|
825
|
+
})
|
|
826
|
+
})]
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
function FaceFrownIcon(props) {
|
|
830
|
+
return jsx(Icon, {
|
|
831
|
+
...props,
|
|
832
|
+
component: SvgFaceFrownIcon
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
function SvgFaceNeutralIcon(props) {
|
|
837
|
+
return jsxs("svg", {
|
|
838
|
+
width: "1em",
|
|
839
|
+
height: "1em",
|
|
840
|
+
viewBox: "0 0 16 16",
|
|
841
|
+
fill: "none",
|
|
842
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
843
|
+
...props,
|
|
844
|
+
children: [jsxs("g", {
|
|
845
|
+
clipPath: "url(#FaceNeutralIcon_svg__clip0_16320_32309)",
|
|
846
|
+
fillRule: "evenodd",
|
|
847
|
+
clipRule: "evenodd",
|
|
848
|
+
fill: "currentColor",
|
|
849
|
+
children: [jsx("path", {
|
|
850
|
+
d: "M8 2.083a5.917 5.917 0 100 11.834A5.917 5.917 0 008 2.084zM.583 8a7.417 7.417 0 1114.834 0A7.417 7.417 0 01.583 8z"
|
|
851
|
+
}), jsx("path", {
|
|
852
|
+
d: "M4.583 10a.75.75 0 01.75-.75h5.334a.75.75 0 110 1.5H5.333a.75.75 0 01-.75-.75zM5.25 6A.75.75 0 016 5.25h.007a.75.75 0 010 1.5H6A.75.75 0 015.25 6zM9.25 6a.75.75 0 01.75-.75h.007a.75.75 0 110 1.5H10A.75.75 0 019.25 6z"
|
|
853
|
+
})]
|
|
854
|
+
}), jsx("defs", {
|
|
855
|
+
children: jsx("clipPath", {
|
|
856
|
+
id: "FaceNeutralIcon_svg__clip0_16320_32309",
|
|
857
|
+
children: jsx("path", {
|
|
858
|
+
fill: "#fff",
|
|
859
|
+
d: "M0 0h16v16H0z"
|
|
860
|
+
})
|
|
861
|
+
})
|
|
862
|
+
})]
|
|
863
|
+
});
|
|
864
|
+
}
|
|
865
|
+
function FaceNeutralIcon(props) {
|
|
866
|
+
return jsx(Icon, {
|
|
867
|
+
...props,
|
|
868
|
+
component: SvgFaceNeutralIcon
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
function SvgFaceSmileIcon(props) {
|
|
873
|
+
return jsxs("svg", {
|
|
874
|
+
width: "1em",
|
|
875
|
+
height: "1em",
|
|
876
|
+
viewBox: "0 0 16 16",
|
|
877
|
+
fill: "none",
|
|
878
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
879
|
+
...props,
|
|
880
|
+
children: [jsxs("g", {
|
|
881
|
+
clipPath: "url(#FaceSmileIcon_svg__clip0_16320_32307)",
|
|
882
|
+
fill: "currentColor",
|
|
883
|
+
children: [jsx("path", {
|
|
884
|
+
fillRule: "evenodd",
|
|
885
|
+
clipRule: "evenodd",
|
|
886
|
+
d: "M8 2.083a5.917 5.917 0 100 11.834A5.917 5.917 0 008 2.084zM.583 8a7.417 7.417 0 1114.834 0A7.417 7.417 0 01.583 8z"
|
|
887
|
+
}), jsx("path", {
|
|
888
|
+
d: "M4.883 8.733a.75.75 0 011.048.147l.002.003.021.026a3.216 3.216 0 00.529.485c.375.273.89.523 1.517.523.627 0 1.142-.25 1.517-.523a3.215 3.215 0 00.55-.511.75.75 0 011.2.9l.029-.042-.03.043-.001.002-.002.002-.005.007-.015.019a3.878 3.878 0 01-.217.247c-.144.15-.354.348-.627.546-.54.393-1.359.81-2.399.81s-1.858-.417-2.4-.81a4.716 4.716 0 01-.795-.734 2.643 2.643 0 01-.048-.059l-.015-.02-.005-.006-.002-.002v-.002h-.002a.75.75 0 01.15-1.05z"
|
|
889
|
+
}), jsx("path", {
|
|
890
|
+
fillRule: "evenodd",
|
|
891
|
+
clipRule: "evenodd",
|
|
892
|
+
d: "M5.25 6A.75.75 0 016 5.25h.007a.75.75 0 010 1.5H6A.75.75 0 015.25 6zM9.25 6a.75.75 0 01.75-.75h.007a.75.75 0 110 1.5H10A.75.75 0 019.25 6z"
|
|
893
|
+
})]
|
|
894
|
+
}), jsx("defs", {
|
|
895
|
+
children: jsx("clipPath", {
|
|
896
|
+
id: "FaceSmileIcon_svg__clip0_16320_32307",
|
|
897
|
+
children: jsx("path", {
|
|
898
|
+
fill: "#fff",
|
|
899
|
+
d: "M0 0h16v16H0z"
|
|
900
|
+
})
|
|
901
|
+
})
|
|
902
|
+
})]
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
function FaceSmileIcon(props) {
|
|
906
|
+
return jsx(Icon, {
|
|
907
|
+
...props,
|
|
908
|
+
component: SvgFaceSmileIcon
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
function SvgNewWindowIcon(props) {
|
|
913
|
+
return jsxs("svg", {
|
|
914
|
+
width: "1em",
|
|
915
|
+
height: "1em",
|
|
916
|
+
viewBox: "0 0 16 16",
|
|
917
|
+
fill: "none",
|
|
918
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
919
|
+
...props,
|
|
920
|
+
children: [jsx("path", {
|
|
921
|
+
d: "M10 1h5v5h-1.5V3.56L8.53 8.53 7.47 7.47l4.97-4.97H10V1z",
|
|
922
|
+
fill: "currentColor"
|
|
923
|
+
}), jsx("path", {
|
|
924
|
+
d: "M1 2.75A.75.75 0 011.75 2H8v1.5H2.5v10h10V8H14v6.25a.75.75 0 01-.75.75H1.75a.75.75 0 01-.75-.75V2.75z",
|
|
925
|
+
fill: "currentColor"
|
|
926
|
+
})]
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
function NewWindowIcon(props) {
|
|
930
|
+
return jsx(Icon, {
|
|
931
|
+
...props,
|
|
932
|
+
component: SvgNewWindowIcon
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
const ColorVars = {
|
|
937
|
+
primary: 'textPrimary',
|
|
938
|
+
secondary: 'textSecondary',
|
|
939
|
+
info: 'textValidationInfo',
|
|
940
|
+
error: 'textValidationDanger',
|
|
941
|
+
success: 'textValidationSuccess',
|
|
942
|
+
warning: 'textValidationWarning'
|
|
943
|
+
};
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* Recursively appends `!important` to all CSS properties in an Emotion `CSSObject`.
|
|
947
|
+
* Used to ensure that we always override Ant styles, without worrying about selector precedence.
|
|
948
|
+
*/
|
|
949
|
+
function importantify(obj) {
|
|
950
|
+
return _mapValues(obj, (value, key) => {
|
|
951
|
+
if (_isString(value) || _isNumber(value) || _isBoolean(value)) {
|
|
952
|
+
// Make sure we don't double-append important
|
|
953
|
+
if (_isString(value) && _endsWith(value, '!important')) {
|
|
954
|
+
return value;
|
|
955
|
+
}
|
|
956
|
+
if (_isNumber(value)) {
|
|
957
|
+
if (unitless[key]) {
|
|
958
|
+
return `${value}!important`;
|
|
959
|
+
}
|
|
960
|
+
return `${value}px!important`;
|
|
961
|
+
}
|
|
962
|
+
return `${value}!important`;
|
|
963
|
+
}
|
|
964
|
+
if (_isNil(value)) {
|
|
965
|
+
return value;
|
|
966
|
+
}
|
|
967
|
+
return importantify(value);
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
/**
|
|
972
|
+
* Returns a text color, in case of invalid/missing key and missing fallback color it will return textPrimary
|
|
973
|
+
* @param theme
|
|
974
|
+
* @param key - key of TypographyColor
|
|
975
|
+
* @param fallbackColor - color to return as fallback -- used to remove tertiary check inline
|
|
976
|
+
*/
|
|
977
|
+
function getTypographyColor(theme, key, fallbackColor) {
|
|
978
|
+
if (theme && key && Object(theme.colors).hasOwnProperty(ColorVars[key])) {
|
|
979
|
+
return theme.colors[ColorVars[key]];
|
|
980
|
+
}
|
|
981
|
+
return fallbackColor !== null && fallbackColor !== void 0 ? fallbackColor : theme.colors.textPrimary;
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
/**
|
|
985
|
+
* Returns validation color based on state, has default validation colors if params are not provided
|
|
986
|
+
* @param theme
|
|
987
|
+
* @param validationState
|
|
988
|
+
* @param errorColor
|
|
989
|
+
* @param warningColor
|
|
990
|
+
* @param successColor
|
|
991
|
+
*/
|
|
992
|
+
function getValidationStateColor(theme, validationState) {
|
|
993
|
+
let {
|
|
994
|
+
errorColor,
|
|
995
|
+
warningColor,
|
|
996
|
+
successColor
|
|
997
|
+
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
998
|
+
switch (validationState) {
|
|
999
|
+
case 'error':
|
|
1000
|
+
return errorColor || theme.colors.actionDangerPrimaryBackgroundDefault;
|
|
1001
|
+
case 'warning':
|
|
1002
|
+
return warningColor || theme.colors.textValidationWarning;
|
|
1003
|
+
case 'success':
|
|
1004
|
+
return successColor || theme.colors.textValidationSuccess;
|
|
1005
|
+
default:
|
|
1006
|
+
return undefined;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
function getDefaultStyles(theme) {
|
|
1011
|
+
return {
|
|
1012
|
+
backgroundColor: theme.colors.actionDefaultBackgroundDefault,
|
|
1013
|
+
borderColor: theme.colors.actionDefaultBorderDefault,
|
|
1014
|
+
color: theme.colors.actionDefaultTextDefault,
|
|
1015
|
+
lineHeight: theme.typography.lineHeightBase,
|
|
1016
|
+
textDecoration: 'none',
|
|
1017
|
+
'&:hover': {
|
|
1018
|
+
backgroundColor: theme.colors.actionDefaultBackgroundHover,
|
|
1019
|
+
borderColor: theme.colors.actionDefaultBorderHover,
|
|
1020
|
+
color: theme.colors.actionDefaultTextHover
|
|
1021
|
+
},
|
|
1022
|
+
'&:active': {
|
|
1023
|
+
backgroundColor: theme.colors.actionDefaultBackgroundPress,
|
|
1024
|
+
borderColor: theme.colors.actionDefaultBorderPress,
|
|
1025
|
+
color: theme.colors.actionDefaultTextPress
|
|
1026
|
+
}
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
function getPrimaryStyles(theme) {
|
|
1030
|
+
return {
|
|
1031
|
+
backgroundColor: theme.colors.actionPrimaryBackgroundDefault,
|
|
1032
|
+
borderColor: 'transparent',
|
|
1033
|
+
color: theme.colors.actionPrimaryTextDefault,
|
|
1034
|
+
textShadow: 'none',
|
|
1035
|
+
'&:hover': {
|
|
1036
|
+
backgroundColor: theme.colors.actionPrimaryBackgroundHover,
|
|
1037
|
+
borderColor: 'transparent',
|
|
1038
|
+
color: theme.colors.actionPrimaryTextHover
|
|
1039
|
+
},
|
|
1040
|
+
'&:active': {
|
|
1041
|
+
backgroundColor: theme.colors.actionPrimaryBackgroundPress,
|
|
1042
|
+
borderColor: 'transparent',
|
|
1043
|
+
color: theme.colors.actionPrimaryTextPress
|
|
1044
|
+
}
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
function getLinkStyles$1(theme) {
|
|
1048
|
+
return {
|
|
1049
|
+
backgroundColor: theme.colors.actionTertiaryBackgroundDefault,
|
|
1050
|
+
borderColor: theme.colors.actionTertiaryBackgroundDefault,
|
|
1051
|
+
color: theme.colors.actionTertiaryTextDefault,
|
|
1052
|
+
'&:hover': {
|
|
1053
|
+
backgroundColor: theme.colors.actionTertiaryBackgroundHover,
|
|
1054
|
+
borderColor: 'transparent',
|
|
1055
|
+
color: theme.colors.actionTertiaryTextHover
|
|
1056
|
+
},
|
|
1057
|
+
'&:active': {
|
|
1058
|
+
backgroundColor: theme.colors.actionTertiaryBackgroundPress,
|
|
1059
|
+
borderColor: 'transparent',
|
|
1060
|
+
color: theme.colors.actionTertiaryTextPress
|
|
1061
|
+
},
|
|
1062
|
+
'&[disabled]:hover': {
|
|
1063
|
+
background: 'none',
|
|
1064
|
+
color: theme.colors.actionDisabledText
|
|
1065
|
+
}
|
|
1066
|
+
};
|
|
1067
|
+
}
|
|
1068
|
+
function getPrimaryDangerStyles(theme) {
|
|
1069
|
+
return {
|
|
1070
|
+
backgroundColor: theme.colors.actionDangerPrimaryBackgroundDefault,
|
|
1071
|
+
borderColor: 'transparent',
|
|
1072
|
+
color: theme.colors.white,
|
|
1073
|
+
'&:hover': {
|
|
1074
|
+
backgroundColor: theme.colors.actionDangerPrimaryBackgroundHover,
|
|
1075
|
+
borderColor: 'transparent',
|
|
1076
|
+
color: theme.colors.white
|
|
1077
|
+
},
|
|
1078
|
+
'&:active': {
|
|
1079
|
+
backgroundColor: theme.colors.actionDangerPrimaryBackgroundPress,
|
|
1080
|
+
borderColor: 'transparent',
|
|
1081
|
+
color: theme.colors.white
|
|
1082
|
+
},
|
|
1083
|
+
'&:focus-visible': {
|
|
1084
|
+
outlineColor: theme.colors.actionDangerPrimaryBackgroundDefault
|
|
1085
|
+
}
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1088
|
+
function getSecondaryDangerStyles(theme) {
|
|
1089
|
+
return {
|
|
1090
|
+
backgroundColor: theme.colors.actionDangerDefaultBackgroundDefault,
|
|
1091
|
+
borderColor: theme.colors.actionDangerDefaultBorderDefault,
|
|
1092
|
+
color: theme.colors.actionDangerDefaultTextDefault,
|
|
1093
|
+
'&:hover': {
|
|
1094
|
+
backgroundColor: theme.colors.actionDangerDefaultBackgroundHover,
|
|
1095
|
+
borderColor: theme.colors.actionDangerDefaultBorderHover,
|
|
1096
|
+
color: theme.colors.actionDangerDefaultTextHover
|
|
1097
|
+
},
|
|
1098
|
+
'&:active': {
|
|
1099
|
+
backgroundColor: theme.colors.actionDangerDefaultBackgroundPress,
|
|
1100
|
+
borderColor: theme.colors.actionDangerDefaultBorderPress,
|
|
1101
|
+
color: theme.colors.actionDangerDefaultTextPress
|
|
1102
|
+
},
|
|
1103
|
+
'&:focus-visible': {
|
|
1104
|
+
outlineColor: theme.colors.actionDangerPrimaryBackgroundDefault
|
|
1105
|
+
}
|
|
1106
|
+
};
|
|
1107
|
+
}
|
|
1108
|
+
function getDisabledStyles(theme) {
|
|
1109
|
+
return {
|
|
1110
|
+
backgroundColor: theme.colors.actionDisabledBackground,
|
|
1111
|
+
borderColor: 'transparent',
|
|
1112
|
+
color: theme.colors.actionDisabledText,
|
|
1113
|
+
'&:hover': {
|
|
1114
|
+
backgroundColor: theme.colors.actionDisabledBackground,
|
|
1115
|
+
borderColor: 'transparent',
|
|
1116
|
+
color: theme.colors.actionDisabledText
|
|
1117
|
+
},
|
|
1118
|
+
'&:active': {
|
|
1119
|
+
backgroundColor: theme.colors.actionDisabledBackground,
|
|
1120
|
+
borderColor: 'transparent',
|
|
1121
|
+
color: theme.colors.actionDisabledText
|
|
1122
|
+
}
|
|
1123
|
+
};
|
|
1124
|
+
}
|
|
1125
|
+
function getDisabledTertiaryStyles(theme) {
|
|
1126
|
+
return {
|
|
1127
|
+
backgroundColor: theme.colors.actionTertiaryBackgroundDefault,
|
|
1128
|
+
borderColor: 'transparent',
|
|
1129
|
+
color: theme.colors.actionDisabledText,
|
|
1130
|
+
'&:hover': {
|
|
1131
|
+
backgroundColor: theme.colors.actionTertiaryBackgroundDefault,
|
|
1132
|
+
borderColor: 'transparent',
|
|
1133
|
+
color: theme.colors.actionDisabledText
|
|
1134
|
+
},
|
|
1135
|
+
'&:active': {
|
|
1136
|
+
backgroundColor: theme.colors.actionTertiaryBackgroundDefault,
|
|
1137
|
+
borderColor: 'transparent',
|
|
1138
|
+
color: theme.colors.actionDisabledText
|
|
1139
|
+
}
|
|
1140
|
+
};
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
function getEndIconClsName(theme) {
|
|
1144
|
+
return `${theme.general.iconfontCssPrefix}-btn-end-icon`;
|
|
1145
|
+
}
|
|
1146
|
+
const getButtonEmotionStyles = _ref => {
|
|
1147
|
+
let {
|
|
1148
|
+
theme,
|
|
1149
|
+
classNamePrefix,
|
|
1150
|
+
loading,
|
|
1151
|
+
withIcon,
|
|
1152
|
+
onlyIcon,
|
|
1153
|
+
isAnchor,
|
|
1154
|
+
enableAnimation,
|
|
1155
|
+
size,
|
|
1156
|
+
type,
|
|
1157
|
+
isFlex,
|
|
1158
|
+
useFocusPseudoClass,
|
|
1159
|
+
forceIconStyles
|
|
1160
|
+
} = _ref;
|
|
1161
|
+
const clsIcon = `.${theme.general.iconfontCssPrefix}`;
|
|
1162
|
+
const clsEndIcon = `.${getEndIconClsName(theme)}`;
|
|
1163
|
+
const clsLoadingIcon = `.${classNamePrefix}-btn-loading-icon`;
|
|
1164
|
+
const clsIconOnly = `.${classNamePrefix}-btn-icon-only`;
|
|
1165
|
+
const classPrimary = `.${classNamePrefix}-btn-primary`;
|
|
1166
|
+
const classLink = `.${classNamePrefix}-btn-link`;
|
|
1167
|
+
const classDangerous = `.${classNamePrefix}-btn-dangerous`;
|
|
1168
|
+
const SMALL_BUTTON_HEIGHT = 24;
|
|
1169
|
+
const tertiaryColors = {
|
|
1170
|
+
background: theme.colors.actionTertiaryBackgroundDefault,
|
|
1171
|
+
color: theme.colors.actionTertiaryTextDefault,
|
|
1172
|
+
'&:hover': {
|
|
1173
|
+
background: theme.colors.actionTertiaryBackgroundHover,
|
|
1174
|
+
color: theme.colors.actionTertiaryTextHover
|
|
1175
|
+
},
|
|
1176
|
+
'&:active': {
|
|
1177
|
+
background: theme.colors.actionTertiaryBackgroundPress,
|
|
1178
|
+
color: theme.colors.actionTertiaryTextPress
|
|
1179
|
+
}
|
|
1180
|
+
};
|
|
1181
|
+
const iconCss = {
|
|
1182
|
+
fontSize: theme.general.iconFontSize,
|
|
1183
|
+
...(!isFlex && {
|
|
1184
|
+
// verticalAlign used by AntD to move icon and label to center
|
|
1185
|
+
// TODO(schs): Try to move buttons to flexbox to solve this. Main problem is that flex-inline and inline-block
|
|
1186
|
+
// behave differently (vertically align of multiple buttons is off). See https://codepen.io/qfactor/pen/JXVzBe
|
|
1187
|
+
verticalAlign: -4,
|
|
1188
|
+
...(onlyIcon && {
|
|
1189
|
+
verticalAlign: -3
|
|
1190
|
+
}),
|
|
1191
|
+
// verticalAlign used by AntD to move icon and label to center
|
|
1192
|
+
// TODO(schs): Try to move buttons to flexbox to solve this. Main problem is that flex-inline and inline-block
|
|
1193
|
+
// behave differently (vertically align of multiple buttons is off). See https://codepen.io/qfactor/pen/JXVzBe
|
|
1194
|
+
// Need to make sure not to apply this to regular buttons as it will offset the icons
|
|
1195
|
+
...(!onlyIcon && {
|
|
1196
|
+
verticalAlign: -3
|
|
1197
|
+
})
|
|
1198
|
+
}),
|
|
1199
|
+
lineHeight: 0,
|
|
1200
|
+
...(size === 'small' && {
|
|
1201
|
+
lineHeight: theme.typography.lineHeightSm,
|
|
1202
|
+
...((onlyIcon || forceIconStyles) && {
|
|
1203
|
+
fontSize: 16,
|
|
1204
|
+
...(isFlex && {
|
|
1205
|
+
height: 16
|
|
1206
|
+
})
|
|
1207
|
+
})
|
|
1208
|
+
})
|
|
1209
|
+
};
|
|
1210
|
+
const inactiveIconCss = {
|
|
1211
|
+
color: theme.colors.grey600
|
|
1212
|
+
};
|
|
1213
|
+
const endIconCssSelector = `span > ${clsEndIcon} > ${clsIcon}`;
|
|
1214
|
+
const styles = {
|
|
1215
|
+
lineHeight: theme.typography.lineHeightBase,
|
|
1216
|
+
boxShadow: 'none',
|
|
1217
|
+
height: theme.general.heightSm,
|
|
1218
|
+
...(isFlex && {
|
|
1219
|
+
display: 'inline-flex',
|
|
1220
|
+
alignItems: 'center',
|
|
1221
|
+
justifyContent: 'center',
|
|
1222
|
+
verticalAlign: 'middle'
|
|
1223
|
+
}),
|
|
1224
|
+
...(!onlyIcon && !forceIconStyles && {
|
|
1225
|
+
'&&': {
|
|
1226
|
+
padding: '4px 12px',
|
|
1227
|
+
...(size === 'small' && {
|
|
1228
|
+
padding: '0 8px'
|
|
1229
|
+
})
|
|
1230
|
+
}
|
|
1231
|
+
}),
|
|
1232
|
+
...((onlyIcon || forceIconStyles) && {
|
|
1233
|
+
width: theme.general.heightSm
|
|
1234
|
+
}),
|
|
1235
|
+
...(size === 'small' && {
|
|
1236
|
+
height: SMALL_BUTTON_HEIGHT,
|
|
1237
|
+
lineHeight: theme.typography.lineHeightBase,
|
|
1238
|
+
...((onlyIcon || forceIconStyles) && {
|
|
1239
|
+
width: SMALL_BUTTON_HEIGHT,
|
|
1240
|
+
paddingTop: 0,
|
|
1241
|
+
paddingBottom: 0,
|
|
1242
|
+
verticalAlign: 'middle'
|
|
1243
|
+
})
|
|
1244
|
+
}),
|
|
1245
|
+
'&:focus-visible': {
|
|
1246
|
+
outlineStyle: 'solid',
|
|
1247
|
+
outlineWidth: '2px',
|
|
1248
|
+
outlineOffset: '1px',
|
|
1249
|
+
outlineColor: theme.isDarkMode ? theme.colors.actionDefaultBorderFocus : theme.colors.primary
|
|
1250
|
+
},
|
|
1251
|
+
...getDefaultStyles(theme),
|
|
1252
|
+
[`&${classPrimary}`]: {
|
|
1253
|
+
...getPrimaryStyles(theme)
|
|
1254
|
+
},
|
|
1255
|
+
[`&${classLink}`]: {
|
|
1256
|
+
...getLinkStyles$1(theme),
|
|
1257
|
+
...(type === 'link' && {
|
|
1258
|
+
padding: 'unset',
|
|
1259
|
+
height: 'auto',
|
|
1260
|
+
border: 'none',
|
|
1261
|
+
boxShadow: 'none',
|
|
1262
|
+
'&[disabled],&:hover': {
|
|
1263
|
+
background: 'none'
|
|
1264
|
+
}
|
|
1265
|
+
})
|
|
1266
|
+
},
|
|
1267
|
+
[`&${classDangerous}${classPrimary}`]: {
|
|
1268
|
+
...getPrimaryDangerStyles(theme)
|
|
1269
|
+
},
|
|
1270
|
+
[`&${classDangerous}`]: {
|
|
1271
|
+
...getSecondaryDangerStyles(theme)
|
|
1272
|
+
},
|
|
1273
|
+
[`&[disabled], &${classDangerous}:disabled`]: {
|
|
1274
|
+
...getDisabledStyles(theme),
|
|
1275
|
+
...((onlyIcon || forceIconStyles) && {
|
|
1276
|
+
backgroundColor: 'transparent',
|
|
1277
|
+
'&:hover': {
|
|
1278
|
+
backgroundColor: 'transparent'
|
|
1279
|
+
},
|
|
1280
|
+
'&:active': {
|
|
1281
|
+
backgroundColor: 'transparent'
|
|
1282
|
+
}
|
|
1283
|
+
})
|
|
1284
|
+
},
|
|
1285
|
+
// Loading styles
|
|
1286
|
+
...(loading && {
|
|
1287
|
+
'::before': {
|
|
1288
|
+
opacity: 0
|
|
1289
|
+
},
|
|
1290
|
+
[`${clsLoadingIcon}`]: {
|
|
1291
|
+
...(onlyIcon ? {
|
|
1292
|
+
// In case of only icon, the icon is already centered but vertically not aligned, this fixes that
|
|
1293
|
+
verticalAlign: 'middle'
|
|
1294
|
+
} : {
|
|
1295
|
+
// Position loading indicator in center
|
|
1296
|
+
// This would break vertical centering of loading circle when onlyIcon is true
|
|
1297
|
+
position: 'absolute'
|
|
1298
|
+
}),
|
|
1299
|
+
...(!isFlex && !forceIconStyles && {
|
|
1300
|
+
// Normally we'd do `transform: translateX(-50%)` but `antd` crushes that with injected inline `style`.
|
|
1301
|
+
left: 'calc(50% - 7px)'
|
|
1302
|
+
}),
|
|
1303
|
+
// Re-enable animation for the loading spinner, since it can be disabled by the global animation CSS.
|
|
1304
|
+
svg: {
|
|
1305
|
+
animationDuration: '1s !important'
|
|
1306
|
+
}
|
|
1307
|
+
},
|
|
1308
|
+
[`& > ${clsLoadingIcon} .anticon`]: {
|
|
1309
|
+
paddingRight: 0 // to horizontally center icon
|
|
1310
|
+
},
|
|
1311
|
+
|
|
1312
|
+
[`> :not(${clsLoadingIcon})`]: {
|
|
1313
|
+
// Hide all content except loading icon
|
|
1314
|
+
opacity: 0,
|
|
1315
|
+
visibility: 'hidden',
|
|
1316
|
+
// Add horizontal space for icon
|
|
1317
|
+
...(withIcon && {
|
|
1318
|
+
paddingLeft: theme.spacing.sm * 2 + 14
|
|
1319
|
+
})
|
|
1320
|
+
}
|
|
1321
|
+
}),
|
|
1322
|
+
// Icon styles
|
|
1323
|
+
[`> ${clsIcon} + span, > span + ${clsIcon}`]: {
|
|
1324
|
+
marginRight: 0,
|
|
1325
|
+
marginLeft: theme.spacing.xs
|
|
1326
|
+
},
|
|
1327
|
+
[`> ${clsIcon}`]: iconCss,
|
|
1328
|
+
[`> ${endIconCssSelector}`]: {
|
|
1329
|
+
...iconCss,
|
|
1330
|
+
marginLeft: theme.spacing.sm
|
|
1331
|
+
},
|
|
1332
|
+
...(!type && {
|
|
1333
|
+
[`&:enabled:not(:hover):not(:active) > ${clsIcon}`]: inactiveIconCss
|
|
1334
|
+
}),
|
|
1335
|
+
...(!type && {
|
|
1336
|
+
[`&:enabled:not(:hover):not(:active) > ${endIconCssSelector}`]: inactiveIconCss
|
|
1337
|
+
}),
|
|
1338
|
+
// Disable animations
|
|
1339
|
+
[`&[${classNamePrefix}-click-animating-without-extra-node='true']::after`]: {
|
|
1340
|
+
display: 'none'
|
|
1341
|
+
},
|
|
1342
|
+
[`&${clsIconOnly}`]: {
|
|
1343
|
+
border: 'none',
|
|
1344
|
+
[`&:enabled:not(${classLink})`]: {
|
|
1345
|
+
...tertiaryColors,
|
|
1346
|
+
color: theme.colors.textSecondary,
|
|
1347
|
+
'&:hover > .anticon': {
|
|
1348
|
+
color: tertiaryColors['&:hover'].color
|
|
1349
|
+
},
|
|
1350
|
+
'&:active > .anticon': {
|
|
1351
|
+
color: tertiaryColors['&:active'].color
|
|
1352
|
+
}
|
|
1353
|
+
},
|
|
1354
|
+
[`&:enabled:not(${classLink}) > .anticon`]: {
|
|
1355
|
+
color: theme.colors.textSecondary
|
|
1356
|
+
},
|
|
1357
|
+
...(isAnchor && {
|
|
1358
|
+
lineHeight: `${theme.general.heightSm}px`,
|
|
1359
|
+
...getLinkStyles$1(theme),
|
|
1360
|
+
'&:disabled': {
|
|
1361
|
+
color: theme.colors.actionDisabledText
|
|
1362
|
+
}
|
|
1363
|
+
}),
|
|
1364
|
+
'&[disabled]:hover': {
|
|
1365
|
+
backgroundColor: 'transparent'
|
|
1366
|
+
}
|
|
1367
|
+
},
|
|
1368
|
+
[`&:focus`]: {
|
|
1369
|
+
...(useFocusPseudoClass && {
|
|
1370
|
+
outlineStyle: 'solid',
|
|
1371
|
+
outlineWidth: '2px',
|
|
1372
|
+
outlineOffset: '1px',
|
|
1373
|
+
outlineColor: theme.isDarkMode ? theme.colors.actionDefaultBorderFocus : theme.colors.primary
|
|
1374
|
+
}),
|
|
1375
|
+
[`${clsLoadingIcon}`]: {
|
|
1376
|
+
...(onlyIcon && {
|
|
1377
|
+
// Mitigate wrong left offset for loading state with onlyIcon
|
|
1378
|
+
left: 0
|
|
1379
|
+
})
|
|
1380
|
+
}
|
|
1381
|
+
},
|
|
1382
|
+
...(forceIconStyles && {
|
|
1383
|
+
padding: '0 6px',
|
|
1384
|
+
lineHeight: theme.typography.lineHeightSm,
|
|
1385
|
+
color: theme.colors.textSecondary,
|
|
1386
|
+
'& > span': {
|
|
1387
|
+
verticalAlign: -1,
|
|
1388
|
+
height: theme.general.heightSm / 2,
|
|
1389
|
+
width: theme.general.heightSm / 2
|
|
1390
|
+
},
|
|
1391
|
+
[`& > ${clsLoadingIcon} .anticon`]: {
|
|
1392
|
+
// left: `calc(50% - 6px)!important`,
|
|
1393
|
+
height: theme.general.heightSm / 2,
|
|
1394
|
+
width: theme.general.heightSm / 2,
|
|
1395
|
+
padding: 0
|
|
1396
|
+
}
|
|
1397
|
+
}),
|
|
1398
|
+
...getAnimationCss(enableAnimation)
|
|
1399
|
+
};
|
|
1400
|
+
|
|
1401
|
+
// Moved outside main style object because state & selector matching in the already existing object keys can create bugs and unwanted overwrites
|
|
1402
|
+
const typeStyles = {
|
|
1403
|
+
...(type === 'tertiary' && {
|
|
1404
|
+
[`&:enabled:not(${clsIconOnly})`]: tertiaryColors,
|
|
1405
|
+
[`&${classLink}[disabled]`]: {
|
|
1406
|
+
...getDisabledTertiaryStyles(theme)
|
|
1407
|
+
}
|
|
1408
|
+
})
|
|
1409
|
+
};
|
|
1410
|
+
const importantStyles = importantify(styles);
|
|
1411
|
+
const importantTypeStyles = importantify(typeStyles);
|
|
1412
|
+
return /*#__PURE__*/css(importantStyles, importantTypeStyles, process.env.NODE_ENV === "production" ? "" : ";label:getButtonEmotionStyles;");
|
|
1413
|
+
};
|
|
1414
|
+
const Button = /* #__PURE__ */(() => {
|
|
1415
|
+
const Button = /*#__PURE__*/forwardRef(function Button( // Keep size out of props passed to AntD to make deprecation and eventual removal have 0 impact
|
|
1416
|
+
_ref2, ref) {
|
|
1417
|
+
let {
|
|
1418
|
+
dangerouslySetAntdProps,
|
|
1419
|
+
children,
|
|
1420
|
+
size,
|
|
1421
|
+
type,
|
|
1422
|
+
endIcon,
|
|
1423
|
+
dangerouslySetForceIconStyles,
|
|
1424
|
+
dangerouslyUseFocusPseudoClass,
|
|
1425
|
+
...props
|
|
1426
|
+
} = _ref2;
|
|
1427
|
+
const {
|
|
1428
|
+
theme,
|
|
1429
|
+
classNamePrefix
|
|
1430
|
+
} = useDesignSystemTheme();
|
|
1431
|
+
const {
|
|
1432
|
+
USE_FLEX_BUTTON: isFlex
|
|
1433
|
+
} = useDesignSystemFlags();
|
|
1434
|
+
const clsEndIcon = getEndIconClsName(theme);
|
|
1435
|
+
return jsx(DesignSystemAntDConfigProvider, {
|
|
1436
|
+
children: jsx(Button$1, {
|
|
1437
|
+
...props,
|
|
1438
|
+
css: getButtonEmotionStyles({
|
|
1439
|
+
theme,
|
|
1440
|
+
classNamePrefix,
|
|
1441
|
+
loading: Boolean(props.loading),
|
|
1442
|
+
withIcon: Boolean(props.icon),
|
|
1443
|
+
onlyIcon: Boolean((props.icon || endIcon) && !children),
|
|
1444
|
+
isAnchor: Boolean(props.href && !type),
|
|
1445
|
+
danger: Boolean(props.danger),
|
|
1446
|
+
enableAnimation: theme.options.enableAnimation,
|
|
1447
|
+
size: size || 'middle',
|
|
1448
|
+
type,
|
|
1449
|
+
isFlex,
|
|
1450
|
+
forceIconStyles: Boolean(dangerouslySetForceIconStyles),
|
|
1451
|
+
useFocusPseudoClass: Boolean(dangerouslyUseFocusPseudoClass)
|
|
1452
|
+
}),
|
|
1453
|
+
href: props.disabled ? undefined : props.href,
|
|
1454
|
+
...dangerouslySetAntdProps,
|
|
1455
|
+
ref: ref,
|
|
1456
|
+
type: type === 'tertiary' ? 'link' : type,
|
|
1457
|
+
children: children && jsxs("span", {
|
|
1458
|
+
style: {
|
|
1459
|
+
visibility: props !== null && props !== void 0 && props.loading ? 'hidden' : 'visible',
|
|
1460
|
+
...(isFlex && {
|
|
1461
|
+
display: 'inline-flex',
|
|
1462
|
+
alignItems: 'center'
|
|
1463
|
+
})
|
|
1464
|
+
},
|
|
1465
|
+
children: [children, endIcon && jsx("span", {
|
|
1466
|
+
className: clsEndIcon,
|
|
1467
|
+
style: {
|
|
1468
|
+
...(isFlex && {
|
|
1469
|
+
display: 'inline-flex',
|
|
1470
|
+
alignItems: 'center'
|
|
1471
|
+
})
|
|
1472
|
+
},
|
|
1473
|
+
children: endIcon
|
|
1474
|
+
})]
|
|
1475
|
+
})
|
|
1476
|
+
})
|
|
1477
|
+
});
|
|
1478
|
+
});
|
|
1479
|
+
|
|
1480
|
+
// This is needed for other Ant components that wrap Button, such as Tooltip, to correctly
|
|
1481
|
+
// identify it as an Ant button.
|
|
1482
|
+
// This should be removed if the component is rewritten to no longer be a wrapper around Ant.
|
|
1483
|
+
// See: https://github.com/ant-design/ant-design/blob/6dd39c1f89b4d6632e6ed022ff1bc275ca1e0f1f/components/button/button.tsx#L291
|
|
1484
|
+
Button.__ANT_BUTTON = true;
|
|
1485
|
+
return Button;
|
|
1486
|
+
})();
|
|
1487
|
+
|
|
1488
|
+
const getInputEmotionStyles = (clsPrefix, theme, _ref, useTransparent) => {
|
|
1489
|
+
let {
|
|
1490
|
+
validationState
|
|
1491
|
+
} = _ref;
|
|
1492
|
+
const inputClass = `.${clsPrefix}-input`;
|
|
1493
|
+
const affixClass = `.${clsPrefix}-input-affix-wrapper`;
|
|
1494
|
+
const affixClassFocused = `.${clsPrefix}-input-affix-wrapper-focused`;
|
|
1495
|
+
const clearIcon = `.${clsPrefix}-input-clear-icon`;
|
|
1496
|
+
const prefixIcon = `.${clsPrefix}-input-prefix`;
|
|
1497
|
+
const suffixIcon = `.${clsPrefix}-input-suffix`;
|
|
1498
|
+
const validationColor = getValidationStateColor(theme, validationState);
|
|
1499
|
+
const styles = {
|
|
1500
|
+
'&&': {
|
|
1501
|
+
lineHeight: theme.typography.lineHeightBase,
|
|
1502
|
+
minHeight: theme.general.heightSm,
|
|
1503
|
+
...(validationState && {
|
|
1504
|
+
borderColor: validationColor
|
|
1505
|
+
}),
|
|
1506
|
+
'&:hover': {
|
|
1507
|
+
borderColor: validationState ? validationColor : theme.colors.actionPrimaryBackgroundHover
|
|
1508
|
+
},
|
|
1509
|
+
'&:focus': {
|
|
1510
|
+
outlineColor: validationState ? validationColor : theme.colors.actionPrimaryBackgroundDefault,
|
|
1511
|
+
outlineWidth: 2,
|
|
1512
|
+
outlineOffset: -2,
|
|
1513
|
+
outlineStyle: 'solid',
|
|
1514
|
+
boxShadow: 'none',
|
|
1515
|
+
borderColor: 'transparent'
|
|
1516
|
+
},
|
|
1517
|
+
'&:disabled': {
|
|
1518
|
+
backgroundColor: theme.colors.actionDisabledBackground,
|
|
1519
|
+
color: theme.colors.actionDisabledText
|
|
1520
|
+
}
|
|
1521
|
+
},
|
|
1522
|
+
[`&${inputClass}, ${inputClass}`]: {
|
|
1523
|
+
...(useTransparent && {
|
|
1524
|
+
backgroundColor: 'transparent'
|
|
1525
|
+
})
|
|
1526
|
+
},
|
|
1527
|
+
[`&${affixClass}`]: {
|
|
1528
|
+
...(useTransparent && {
|
|
1529
|
+
backgroundColor: 'transparent'
|
|
1530
|
+
}),
|
|
1531
|
+
lineHeight: theme.typography.lineHeightBase,
|
|
1532
|
+
paddingTop: 5,
|
|
1533
|
+
paddingBottom: 5,
|
|
1534
|
+
minHeight: theme.general.heightSm,
|
|
1535
|
+
'::before': {
|
|
1536
|
+
lineHeight: theme.typography.lineHeightBase
|
|
1537
|
+
},
|
|
1538
|
+
'&:hover': {
|
|
1539
|
+
borderColor: theme.colors.actionPrimaryBackgroundHover
|
|
1540
|
+
},
|
|
1541
|
+
[`input.${clsPrefix}-input`]: {
|
|
1542
|
+
borderRadius: 0
|
|
1543
|
+
}
|
|
1544
|
+
},
|
|
1545
|
+
[`&${affixClassFocused}`]: {
|
|
1546
|
+
boxShadow: 'none',
|
|
1547
|
+
'&&, &:focus': {
|
|
1548
|
+
outlineColor: theme.colors.actionPrimaryBackgroundDefault,
|
|
1549
|
+
outlineWidth: 2,
|
|
1550
|
+
outlineOffset: -2,
|
|
1551
|
+
outlineStyle: 'solid',
|
|
1552
|
+
boxShadow: 'none',
|
|
1553
|
+
borderColor: 'transparent'
|
|
1554
|
+
}
|
|
1555
|
+
},
|
|
1556
|
+
[clearIcon]: {
|
|
1557
|
+
fontSize: theme.general.iconFontSize
|
|
1558
|
+
},
|
|
1559
|
+
[prefixIcon]: {
|
|
1560
|
+
marginRight: theme.spacing.sm,
|
|
1561
|
+
color: theme.colors.textSecondary
|
|
1562
|
+
},
|
|
1563
|
+
[suffixIcon]: {
|
|
1564
|
+
marginLeft: theme.spacing.sm,
|
|
1565
|
+
color: theme.colors.textSecondary
|
|
1566
|
+
},
|
|
1567
|
+
...getAnimationCss(theme.options.enableAnimation)
|
|
1568
|
+
};
|
|
1569
|
+
return /*#__PURE__*/css(importantify(styles), process.env.NODE_ENV === "production" ? "" : ";label:getInputEmotionStyles;");
|
|
1570
|
+
};
|
|
1571
|
+
const getInputGroupStyling = (clsPrefix, theme) => {
|
|
1572
|
+
const inputClass = `.${clsPrefix}-input`;
|
|
1573
|
+
const buttonClass = `.${clsPrefix}-btn`;
|
|
1574
|
+
return /*#__PURE__*/css({
|
|
1575
|
+
display: 'inline-flex !important',
|
|
1576
|
+
width: 'auto',
|
|
1577
|
+
[`& > ${inputClass}`]: {
|
|
1578
|
+
flexGrow: 1,
|
|
1579
|
+
'&:disabled': {
|
|
1580
|
+
border: 'none',
|
|
1581
|
+
'&:hover': {
|
|
1582
|
+
borderRight: `1px solid ${theme.colors.actionDisabledText} !important`
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
},
|
|
1586
|
+
[`& > ${buttonClass} > span`]: {
|
|
1587
|
+
verticalAlign: 'middle'
|
|
1588
|
+
},
|
|
1589
|
+
[`& > ${buttonClass}:disabled, & > ${buttonClass}:disabled:hover`]: {
|
|
1590
|
+
borderLeft: `1px solid ${theme.colors.actionDisabledText} !important`
|
|
1591
|
+
}
|
|
1592
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:getInputGroupStyling;");
|
|
1593
|
+
};
|
|
1594
|
+
const TextArea = /*#__PURE__*/forwardRef(function TextArea(_ref2, ref) {
|
|
1595
|
+
let {
|
|
1596
|
+
validationState,
|
|
1597
|
+
autoComplete = 'off',
|
|
1598
|
+
dangerouslySetAntdProps,
|
|
1599
|
+
dangerouslyAppendEmotionCSS,
|
|
1600
|
+
...props
|
|
1601
|
+
} = _ref2;
|
|
1602
|
+
const {
|
|
1603
|
+
classNamePrefix,
|
|
1604
|
+
theme
|
|
1605
|
+
} = useDesignSystemTheme();
|
|
1606
|
+
const {
|
|
1607
|
+
USE_TRANSPARENT_INPUT: useTransparent
|
|
1608
|
+
} = useDesignSystemFlags();
|
|
1609
|
+
return jsx(DesignSystemAntDConfigProvider, {
|
|
1610
|
+
children: jsx(Input$1.TextArea, {
|
|
1611
|
+
ref: ref,
|
|
1612
|
+
autoComplete: autoComplete,
|
|
1613
|
+
css: [getInputEmotionStyles(classNamePrefix, theme, {
|
|
1614
|
+
validationState
|
|
1615
|
+
}, useTransparent), dangerouslyAppendEmotionCSS, process.env.NODE_ENV === "production" ? "" : ";label:TextArea;"],
|
|
1616
|
+
...props,
|
|
1617
|
+
...dangerouslySetAntdProps
|
|
1618
|
+
})
|
|
1619
|
+
});
|
|
1620
|
+
});
|
|
1621
|
+
const Password = /*#__PURE__*/forwardRef(function Password(_ref3, ref) {
|
|
1622
|
+
let {
|
|
1623
|
+
validationState,
|
|
1624
|
+
autoComplete = 'off',
|
|
1625
|
+
dangerouslySetAntdProps,
|
|
1626
|
+
dangerouslyAppendEmotionCSS,
|
|
1627
|
+
...props
|
|
1628
|
+
} = _ref3;
|
|
1629
|
+
const {
|
|
1630
|
+
classNamePrefix,
|
|
1631
|
+
theme
|
|
1632
|
+
} = useDesignSystemTheme();
|
|
1633
|
+
const {
|
|
1634
|
+
USE_TRANSPARENT_INPUT: useTransparent
|
|
1635
|
+
} = useDesignSystemFlags();
|
|
1636
|
+
return jsx(DesignSystemAntDConfigProvider, {
|
|
1637
|
+
children: jsx(Input$1.Password, {
|
|
1638
|
+
visibilityToggle: false,
|
|
1639
|
+
ref: ref,
|
|
1640
|
+
autoComplete: autoComplete,
|
|
1641
|
+
css: [getInputEmotionStyles(classNamePrefix, theme, {
|
|
1642
|
+
validationState
|
|
1643
|
+
}, useTransparent), dangerouslyAppendEmotionCSS, process.env.NODE_ENV === "production" ? "" : ";label:Password;"],
|
|
1644
|
+
...props,
|
|
1645
|
+
...dangerouslySetAntdProps
|
|
1646
|
+
})
|
|
1647
|
+
});
|
|
1648
|
+
});
|
|
1649
|
+
const DuboisInput = /*#__PURE__*/forwardRef(function Input(_ref4, ref) {
|
|
1650
|
+
let {
|
|
1651
|
+
validationState,
|
|
1652
|
+
autoComplete = 'off',
|
|
1653
|
+
dangerouslySetAntdProps,
|
|
1654
|
+
dangerouslyAppendEmotionCSS,
|
|
1655
|
+
onChange,
|
|
1656
|
+
onClear,
|
|
1657
|
+
...props
|
|
1658
|
+
} = _ref4;
|
|
1659
|
+
const {
|
|
1660
|
+
classNamePrefix,
|
|
1661
|
+
theme
|
|
1662
|
+
} = useDesignSystemTheme();
|
|
1663
|
+
const {
|
|
1664
|
+
USE_TRANSPARENT_INPUT: useTransparent
|
|
1665
|
+
} = useDesignSystemFlags();
|
|
1666
|
+
const handleChange = e => {
|
|
1667
|
+
// If the input is cleared, call the onClear handler, but only
|
|
1668
|
+
// if the event is not an input event -- which is the case when you click the
|
|
1669
|
+
// ant-provided (X) button.
|
|
1670
|
+
if (!e.target.value && e.nativeEvent instanceof InputEvent === false && onClear) {
|
|
1671
|
+
onClear === null || onClear === void 0 ? void 0 : onClear();
|
|
1672
|
+
} else {
|
|
1673
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
1674
|
+
}
|
|
1675
|
+
};
|
|
1676
|
+
return jsx(DesignSystemAntDConfigProvider, {
|
|
1677
|
+
children: jsx(Input$1, {
|
|
1678
|
+
autoComplete: autoComplete,
|
|
1679
|
+
ref: ref,
|
|
1680
|
+
css: [getInputEmotionStyles(classNamePrefix, theme, {
|
|
1681
|
+
validationState
|
|
1682
|
+
}, useTransparent), dangerouslyAppendEmotionCSS, process.env.NODE_ENV === "production" ? "" : ";label:DuboisInput;"],
|
|
1683
|
+
onChange: handleChange,
|
|
1684
|
+
...props,
|
|
1685
|
+
...dangerouslySetAntdProps
|
|
1686
|
+
})
|
|
1687
|
+
});
|
|
1688
|
+
});
|
|
1689
|
+
const Group = _ref5 => {
|
|
1690
|
+
let {
|
|
1691
|
+
dangerouslySetAntdProps,
|
|
1692
|
+
dangerouslyAppendEmotionCSS,
|
|
1693
|
+
compact = true,
|
|
1694
|
+
...props
|
|
1695
|
+
} = _ref5;
|
|
1696
|
+
const {
|
|
1697
|
+
classNamePrefix,
|
|
1698
|
+
theme
|
|
1699
|
+
} = useDesignSystemTheme();
|
|
1700
|
+
return jsx(DesignSystemAntDConfigProvider, {
|
|
1701
|
+
children: jsx(Input$1.Group, {
|
|
1702
|
+
css: [getInputGroupStyling(classNamePrefix, theme), dangerouslyAppendEmotionCSS, process.env.NODE_ENV === "production" ? "" : ";label:Group;"],
|
|
1703
|
+
compact: compact,
|
|
1704
|
+
...props,
|
|
1705
|
+
...dangerouslySetAntdProps
|
|
1706
|
+
})
|
|
1707
|
+
});
|
|
1708
|
+
};
|
|
1709
|
+
|
|
1710
|
+
// Properly creates the namespace and dot-notation components with correct types.
|
|
1711
|
+
const InputNamespace = /* #__PURE__ */Object.assign(DuboisInput, {
|
|
1712
|
+
TextArea,
|
|
1713
|
+
Password,
|
|
1714
|
+
Group
|
|
1715
|
+
});
|
|
1716
|
+
const Input = InputNamespace;
|
|
1717
|
+
|
|
1718
|
+
// TODO: I'm doing this to support storybook's docgen;
|
|
1719
|
+
// We should remove this once we have a better storybook integration,
|
|
1720
|
+
// since these will be exposed in the library's exports.
|
|
1721
|
+
const __INTERNAL_DO_NOT_USE__TextArea = TextArea;
|
|
1722
|
+
const __INTERNAL_DO_NOT_USE__Password = Password;
|
|
1723
|
+
const __INTERNAL_DO_NOT_USE_DEDUPE__Group = Group;
|
|
1724
|
+
|
|
1725
|
+
const Spacer = _ref => {
|
|
1726
|
+
let {
|
|
1727
|
+
size = 'md',
|
|
1728
|
+
shrinks,
|
|
1729
|
+
...props
|
|
1730
|
+
} = _ref;
|
|
1731
|
+
const {
|
|
1732
|
+
theme
|
|
1733
|
+
} = useDesignSystemTheme();
|
|
1734
|
+
const spacingValues = {
|
|
1735
|
+
xs: theme.spacing.xs,
|
|
1736
|
+
sm: theme.spacing.sm,
|
|
1737
|
+
md: theme.spacing.md,
|
|
1738
|
+
lg: theme.spacing.lg
|
|
1739
|
+
};
|
|
1740
|
+
return jsx("div", {
|
|
1741
|
+
css: /*#__PURE__*/css({
|
|
1742
|
+
height: spacingValues[size],
|
|
1743
|
+
...(shrinks === false ? {
|
|
1744
|
+
flexShrink: 0
|
|
1745
|
+
} : undefined)
|
|
1746
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:Spacer;"),
|
|
1747
|
+
...props
|
|
1748
|
+
});
|
|
1749
|
+
};
|
|
1750
|
+
|
|
1751
|
+
const getLinkStyles = (theme, clsPrefix) => {
|
|
1752
|
+
const classTypography = `.${clsPrefix}-typography`;
|
|
1753
|
+
const styles = {
|
|
1754
|
+
[`&${classTypography}, &${classTypography}:focus`]: {
|
|
1755
|
+
color: theme.colors.actionTertiaryTextDefault
|
|
1756
|
+
},
|
|
1757
|
+
[`&${classTypography}:hover, &${classTypography}:hover .anticon`]: {
|
|
1758
|
+
color: theme.colors.actionTertiaryTextHover,
|
|
1759
|
+
textDecoration: 'underline'
|
|
1760
|
+
},
|
|
1761
|
+
[`&${classTypography}:active, &${classTypography}:active .anticon`]: {
|
|
1762
|
+
color: theme.colors.actionTertiaryTextPress,
|
|
1763
|
+
textDecoration: 'underline'
|
|
1764
|
+
},
|
|
1765
|
+
[`&${classTypography}:focus-visible`]: {
|
|
1766
|
+
textDecoration: 'underline'
|
|
1767
|
+
},
|
|
1768
|
+
'.anticon': {
|
|
1769
|
+
fontSize: 12
|
|
1770
|
+
}
|
|
1771
|
+
};
|
|
1772
|
+
return /*#__PURE__*/css(styles, process.env.NODE_ENV === "production" ? "" : ";label:getLinkStyles;");
|
|
1773
|
+
};
|
|
1774
|
+
const getEllipsisNewTabLinkStyles = () => {
|
|
1775
|
+
const styles = {
|
|
1776
|
+
paddingRight: 'calc(2px + 1em)',
|
|
1777
|
+
// 1em for icon
|
|
1778
|
+
position: 'relative'
|
|
1779
|
+
};
|
|
1780
|
+
return /*#__PURE__*/css(styles, process.env.NODE_ENV === "production" ? "" : ";label:getEllipsisNewTabLinkStyles;");
|
|
1781
|
+
};
|
|
1782
|
+
const getIconStyles = theme => {
|
|
1783
|
+
const styles = {
|
|
1784
|
+
marginLeft: 2,
|
|
1785
|
+
color: theme.colors.actionTertiaryTextDefault
|
|
1786
|
+
};
|
|
1787
|
+
return /*#__PURE__*/css(styles, process.env.NODE_ENV === "production" ? "" : ";label:getIconStyles;");
|
|
1788
|
+
};
|
|
1789
|
+
const getEllipsisIconStyles = useNewIcons => {
|
|
1790
|
+
const styles = {
|
|
1791
|
+
position: 'absolute',
|
|
1792
|
+
right: 0,
|
|
1793
|
+
bottom: 0,
|
|
1794
|
+
top: 0,
|
|
1795
|
+
display: 'flex',
|
|
1796
|
+
alignItems: 'center',
|
|
1797
|
+
...(useNewIcons && {
|
|
1798
|
+
fontSize: 12
|
|
1799
|
+
})
|
|
1800
|
+
};
|
|
1801
|
+
return /*#__PURE__*/css(styles, process.env.NODE_ENV === "production" ? "" : ";label:getEllipsisIconStyles;");
|
|
1802
|
+
};
|
|
1803
|
+
function Link(_ref) {
|
|
1804
|
+
let {
|
|
1805
|
+
dangerouslySetAntdProps,
|
|
1806
|
+
...props
|
|
1807
|
+
} = _ref;
|
|
1808
|
+
const {
|
|
1809
|
+
children,
|
|
1810
|
+
openInNewTab,
|
|
1811
|
+
...restProps
|
|
1812
|
+
} = props;
|
|
1813
|
+
const {
|
|
1814
|
+
theme,
|
|
1815
|
+
classNamePrefix
|
|
1816
|
+
} = useDesignSystemTheme();
|
|
1817
|
+
const newTabProps = {
|
|
1818
|
+
rel: 'noopener noreferrer',
|
|
1819
|
+
target: '_blank'
|
|
1820
|
+
};
|
|
1821
|
+
const linkProps = openInNewTab ? {
|
|
1822
|
+
...restProps,
|
|
1823
|
+
...newTabProps
|
|
1824
|
+
} : {
|
|
1825
|
+
...restProps
|
|
1826
|
+
};
|
|
1827
|
+
const linkStyles = props.ellipsis && openInNewTab ? [getLinkStyles(theme, classNamePrefix), getEllipsisNewTabLinkStyles()] : getLinkStyles(theme, classNamePrefix);
|
|
1828
|
+
const iconStyles = props.ellipsis ? [getIconStyles(theme), getEllipsisIconStyles()] : getIconStyles(theme);
|
|
1829
|
+
return jsx(DesignSystemAntDConfigProvider, {
|
|
1830
|
+
children: jsxs(Typography$1.Link, {
|
|
1831
|
+
"aria-disabled": linkProps.disabled,
|
|
1832
|
+
css: linkStyles,
|
|
1833
|
+
...linkProps,
|
|
1834
|
+
...dangerouslySetAntdProps,
|
|
1835
|
+
children: [children, openInNewTab ? jsx(NewWindowIcon, {
|
|
1836
|
+
css: iconStyles,
|
|
1837
|
+
...newTabProps
|
|
1838
|
+
}) : null]
|
|
1839
|
+
})
|
|
1840
|
+
});
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
const {
|
|
1844
|
+
Paragraph: AntDParagraph
|
|
1845
|
+
} = Typography$1;
|
|
1846
|
+
function getParagraphEmotionStyles(theme, props) {
|
|
1847
|
+
return /*#__PURE__*/css({
|
|
1848
|
+
'&&': {
|
|
1849
|
+
fontSize: theme.typography.fontSizeBase,
|
|
1850
|
+
lineHeight: theme.typography.lineHeightBase,
|
|
1851
|
+
color: getTypographyColor(theme, props.color, theme.colors.textPrimary)
|
|
1852
|
+
}
|
|
1853
|
+
}, props.disabled && {
|
|
1854
|
+
'&&': {
|
|
1855
|
+
color: theme.colors.actionDisabledText
|
|
1856
|
+
}
|
|
1857
|
+
}, props.withoutMargins && {
|
|
1858
|
+
'&&': {
|
|
1859
|
+
marginTop: 0,
|
|
1860
|
+
marginBottom: 0
|
|
1861
|
+
}
|
|
1862
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:getParagraphEmotionStyles;");
|
|
1863
|
+
}
|
|
1864
|
+
function Paragraph(userProps) {
|
|
1865
|
+
const {
|
|
1866
|
+
dangerouslySetAntdProps,
|
|
1867
|
+
withoutMargins,
|
|
1868
|
+
color,
|
|
1869
|
+
...props
|
|
1870
|
+
} = userProps;
|
|
1871
|
+
const {
|
|
1872
|
+
theme
|
|
1873
|
+
} = useDesignSystemTheme();
|
|
1874
|
+
return jsx(DesignSystemAntDConfigProvider, {
|
|
1875
|
+
children: jsx(AntDParagraph, {
|
|
1876
|
+
...props,
|
|
1877
|
+
className: props.className,
|
|
1878
|
+
css: getParagraphEmotionStyles(theme, userProps),
|
|
1879
|
+
...dangerouslySetAntdProps
|
|
1880
|
+
})
|
|
1881
|
+
});
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
const {
|
|
1885
|
+
Text: AntDText
|
|
1886
|
+
} = Typography$1;
|
|
1887
|
+
function getTextEmotionStyles(theme, props) {
|
|
1888
|
+
return /*#__PURE__*/css({
|
|
1889
|
+
'&&': {
|
|
1890
|
+
fontSize: theme.typography.fontSizeBase,
|
|
1891
|
+
lineHeight: theme.typography.lineHeightBase,
|
|
1892
|
+
color: getTypographyColor(theme, props.color, theme.colors.textPrimary)
|
|
1893
|
+
}
|
|
1894
|
+
}, props.disabled && {
|
|
1895
|
+
'&&': {
|
|
1896
|
+
color: theme.colors.actionDisabledText
|
|
1897
|
+
}
|
|
1898
|
+
}, props.hint && {
|
|
1899
|
+
'&&': {
|
|
1900
|
+
fontSize: theme.typography.fontSizeSm,
|
|
1901
|
+
lineHeight: theme.typography.lineHeightSm
|
|
1902
|
+
}
|
|
1903
|
+
}, props.bold && {
|
|
1904
|
+
'&&': {
|
|
1905
|
+
fontSize: theme.typography.fontSizeBase,
|
|
1906
|
+
fontWeight: theme.typography.typographyBoldFontWeight,
|
|
1907
|
+
lineHeight: theme.typography.lineHeightBase
|
|
1908
|
+
}
|
|
1909
|
+
}, props.code && {
|
|
1910
|
+
'&& > code': {
|
|
1911
|
+
fontSize: theme.typography.fontSizeBase,
|
|
1912
|
+
lineHeight: theme.typography.lineHeightBase,
|
|
1913
|
+
background: theme.colors.typographyCodeBg,
|
|
1914
|
+
fontFamily: 'monospace',
|
|
1915
|
+
borderRadius: theme.borders.borderRadiusMd,
|
|
1916
|
+
padding: '2px 4px',
|
|
1917
|
+
border: 'unset',
|
|
1918
|
+
margin: 0
|
|
1919
|
+
}
|
|
1920
|
+
}, props.size && {
|
|
1921
|
+
'&&': (() => {
|
|
1922
|
+
switch (props.size) {
|
|
1923
|
+
case 'xxl':
|
|
1924
|
+
return {
|
|
1925
|
+
fontSize: theme.typography.fontSizeXxl,
|
|
1926
|
+
lineHeight: theme.typography.lineHeightXxl
|
|
1927
|
+
};
|
|
1928
|
+
case 'xl':
|
|
1929
|
+
return {
|
|
1930
|
+
fontSize: theme.typography.fontSizeXl,
|
|
1931
|
+
lineHeight: theme.typography.lineHeightXl
|
|
1932
|
+
};
|
|
1933
|
+
case 'lg':
|
|
1934
|
+
return {
|
|
1935
|
+
fontSize: theme.typography.fontSizeLg,
|
|
1936
|
+
lineHeight: theme.typography.lineHeightLg
|
|
1937
|
+
};
|
|
1938
|
+
case 'sm':
|
|
1939
|
+
return {
|
|
1940
|
+
fontSize: theme.typography.fontSizeSm,
|
|
1941
|
+
lineHeight: theme.typography.lineHeightSm
|
|
1942
|
+
};
|
|
1943
|
+
default:
|
|
1944
|
+
return {
|
|
1945
|
+
fontSize: theme.typography.fontSizeMd,
|
|
1946
|
+
lineHeight: theme.typography.lineHeightMd
|
|
1947
|
+
};
|
|
1948
|
+
}
|
|
1949
|
+
})()
|
|
1950
|
+
}, props.withoutMargins && {
|
|
1951
|
+
'&&': {
|
|
1952
|
+
marginTop: 0,
|
|
1953
|
+
marginBottom: 0
|
|
1954
|
+
}
|
|
1955
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:getTextEmotionStyles;");
|
|
1956
|
+
}
|
|
1957
|
+
function Text(userProps) {
|
|
1958
|
+
// Omit props that are not supported by `antd`
|
|
1959
|
+
const {
|
|
1960
|
+
dangerouslySetAntdProps,
|
|
1961
|
+
bold,
|
|
1962
|
+
hint,
|
|
1963
|
+
withoutMargins,
|
|
1964
|
+
color,
|
|
1965
|
+
...props
|
|
1966
|
+
} = userProps;
|
|
1967
|
+
const {
|
|
1968
|
+
theme
|
|
1969
|
+
} = useDesignSystemTheme();
|
|
1970
|
+
return jsx(DesignSystemAntDConfigProvider, {
|
|
1971
|
+
children: jsx(AntDText, {
|
|
1972
|
+
...props,
|
|
1973
|
+
className: props.className,
|
|
1974
|
+
css: getTextEmotionStyles(theme, userProps),
|
|
1975
|
+
...dangerouslySetAntdProps
|
|
1976
|
+
})
|
|
1977
|
+
});
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
const {
|
|
1981
|
+
Title: AntDTitle
|
|
1982
|
+
} = Typography$1;
|
|
1983
|
+
function getLevelStyles(theme, props) {
|
|
1984
|
+
switch (props.level) {
|
|
1985
|
+
case 1:
|
|
1986
|
+
return /*#__PURE__*/css({
|
|
1987
|
+
'&&': {
|
|
1988
|
+
fontSize: theme.typography.fontSizeXxl,
|
|
1989
|
+
lineHeight: theme.typography.lineHeightXxl,
|
|
1990
|
+
fontWeight: theme.typography.typographyBoldFontWeight
|
|
1991
|
+
}
|
|
1992
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:getLevelStyles;");
|
|
1993
|
+
case 2:
|
|
1994
|
+
return /*#__PURE__*/css({
|
|
1995
|
+
'&&': {
|
|
1996
|
+
fontSize: theme.typography.fontSizeXl,
|
|
1997
|
+
lineHeight: theme.typography.lineHeightXl,
|
|
1998
|
+
fontWeight: theme.typography.typographyBoldFontWeight
|
|
1999
|
+
}
|
|
2000
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:getLevelStyles;");
|
|
2001
|
+
case 3:
|
|
2002
|
+
return /*#__PURE__*/css({
|
|
2003
|
+
'&&': {
|
|
2004
|
+
fontSize: theme.typography.fontSizeLg,
|
|
2005
|
+
lineHeight: theme.typography.lineHeightLg,
|
|
2006
|
+
fontWeight: theme.typography.typographyBoldFontWeight
|
|
2007
|
+
}
|
|
2008
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:getLevelStyles;");
|
|
2009
|
+
case 4:
|
|
2010
|
+
default:
|
|
2011
|
+
return /*#__PURE__*/css({
|
|
2012
|
+
'&&': {
|
|
2013
|
+
fontSize: theme.typography.fontSizeMd,
|
|
2014
|
+
lineHeight: theme.typography.lineHeightMd,
|
|
2015
|
+
fontWeight: theme.typography.typographyBoldFontWeight
|
|
2016
|
+
}
|
|
2017
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:getLevelStyles;");
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
function getTitleEmotionStyles(theme, props) {
|
|
2021
|
+
return /*#__PURE__*/css(getLevelStyles(theme, props), {
|
|
2022
|
+
'&&': {
|
|
2023
|
+
color: getTypographyColor(theme, props.color, theme.colors.textPrimary)
|
|
2024
|
+
}
|
|
2025
|
+
}, props.withoutMargins && {
|
|
2026
|
+
'&&': {
|
|
2027
|
+
marginTop: '0 !important',
|
|
2028
|
+
// override general styling
|
|
2029
|
+
marginBottom: '0 !important' // override general styling
|
|
2030
|
+
}
|
|
2031
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:getTitleEmotionStyles;");
|
|
2032
|
+
}
|
|
2033
|
+
function Title(userProps) {
|
|
2034
|
+
const {
|
|
2035
|
+
dangerouslySetAntdProps,
|
|
2036
|
+
withoutMargins,
|
|
2037
|
+
color,
|
|
2038
|
+
...props
|
|
2039
|
+
} = userProps;
|
|
2040
|
+
const {
|
|
2041
|
+
theme
|
|
2042
|
+
} = useDesignSystemTheme();
|
|
2043
|
+
return jsx(DesignSystemAntDConfigProvider, {
|
|
2044
|
+
children: jsx(AntDTitle, {
|
|
2045
|
+
...props,
|
|
2046
|
+
className: props.className,
|
|
2047
|
+
css: getTitleEmotionStyles(theme, userProps),
|
|
2048
|
+
...dangerouslySetAntdProps
|
|
2049
|
+
})
|
|
2050
|
+
});
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
const Typography = /* #__PURE__ */(() => {
|
|
2054
|
+
function Typography(_ref) {
|
|
2055
|
+
let {
|
|
2056
|
+
dangerouslySetAntdProps,
|
|
2057
|
+
...props
|
|
2058
|
+
} = _ref;
|
|
2059
|
+
return jsx(DesignSystemAntDConfigProvider, {
|
|
2060
|
+
children: jsx(Typography$1, {
|
|
2061
|
+
...props,
|
|
2062
|
+
...dangerouslySetAntdProps
|
|
2063
|
+
})
|
|
2064
|
+
});
|
|
2065
|
+
}
|
|
2066
|
+
Typography.Text = Text;
|
|
2067
|
+
Typography.Title = Title;
|
|
2068
|
+
Typography.Paragraph = Paragraph;
|
|
2069
|
+
Typography.Link = Link;
|
|
2070
|
+
return Typography;
|
|
2071
|
+
})();
|
|
2072
|
+
|
|
2073
|
+
export { ApplyDesignSystemContextOverrides as A, Button as B, CloseIcon as C, DesignSystemAntDConfigProvider as D, FaceFrownIcon as F, Icon as I, NewWindowIcon as N, RestoreAntDDefaultClsPrefix as R, Spacer as S, Typography as T, WithDesignSystemThemeHoc as W, __INTERNAL_DO_NOT_USE__TextArea as _, ChevronRightIcon as a, useDesignSystemFlags as b, DU_BOIS_ENABLE_ANIMATION_CLASSNAME as c, useDesignSystemContext as d, Input as e, getValidationStateColor as f, getAnimationCss as g, Title as h, importantify as i, ChevronLeftIcon as j, getDefaultStyles as k, getPrimaryStyles as l, getDisabledStyles as m, lightColorList as n, getButtonEmotionStyles as o, DesignSystemThemeContext as p, DesignSystemContext as q, DesignSystemThemeProvider as r, DesignSystemProvider as s, ApplyDesignSystemFlags as t, useDesignSystemTheme as u, useAntDConfigProviderContext as v, FaceNeutralIcon as w, FaceSmileIcon as x, __INTERNAL_DO_NOT_USE__Password as y, __INTERNAL_DO_NOT_USE_DEDUPE__Group as z };
|
|
2074
|
+
//# sourceMappingURL=Typography-1b037412.js.map
|