') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); refactor(ui): Implement new icon set by alexcarpenter · Pull Request #8319 · clerk/javascript · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cozy-suns-heal.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
'@clerk/ui': minor
---

Migrate to new icon set to create consistency across components.
9 changes: 6 additions & 3 deletions packages/ui/src/common/CreateOrganizationAction.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,9 +3,12 @@ import { useUser } from '@clerk/shared/react/index';
import { Action } from '../elements/Actions';
import { Add } from '../icons';

type CreateOrganizationActionProps = Omit<React.ComponentProps<typeof Action>, 'icon'>;
type CreateOrganizationActionProps = Omit<React.ComponentProps<typeof Action>, 'icon'> & {
icon?: React.ComponentProps<typeof Action>['icon'];
};

export const CreateOrganizationAction = (props: CreateOrganizationActionProps) => {
const { icon = Add, ...rest } = props;
const { user } = useUser();

if (!user?.createOrganizationEnabled) {
Expand All@@ -14,8 +17,8 @@ export const CreateOrganizationAction = (props: CreateOrganizationActionProps) =

return (
<Action
{...props}
icon={Add}
{...rest}
icon={icon}
/>
);
};
6 changes: 3 additions & 3 deletions packages/ui/src/common/EmailLinkStatusCard.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import { Col, descriptors, Flex, Flow, Icon, localizationKeys, Spinner, Text } f
import { Card } from '../elements/Card';
import { useCardState } from '../elements/contexts';
import { Header } from '../elements/Header';
import { ExclamationTriangle, SwitchArrows, TickShield } from '../icons';
import { ArrowLeftRight, ExclamationTriangle, ShieldCheck } from '../icons';
import type { InternalTheme } from '../styledSystem';
import { animations } from '../styledSystem';

Expand All@@ -19,8 +19,8 @@ type EmailLinkStatusCardProps = React.PropsWithChildren<{
}>;

const StatusToIcon: Record<Exclude<EmailLinkUIStatus, 'loading'>, React.ComponentType> = {
verified: TickShield,
verified_switch_tab: SwitchArrows,
verified: ShieldCheck,
verified_switch_tab: ArrowLeftRight,
expired: ExclamationTriangle,
failed: ExclamationTriangle,
client_mismatch: ExclamationTriangle,
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/common/organizations/OrganizationPreview.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ import { OrganizationPreview } from '@/ui/elements/OrganizationPreview';
import { PreviewButton } from '@/ui/elements/PreviewButton';

import { Box, Button, Col, descriptors, Flex, Spinner } from '../../customizables';
import { SwitchArrowRight } from '../../icons';
import { ArrowRight } from '../../icons';
import type { ThemableCssProp } from '../../styledSystem';
import { common } from '../../styledSystem';

Expand DownExpand Up@@ -132,7 +132,7 @@ export const OrganizationPreviewButton = (props: OrganizationPreviewButtonProps)
return (
<PreviewButton
sx={[sharedStyles]}
icon={SwitchArrowRight}
icon={ArrowRight}
{...props}
/>
);
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/src/components/APIKeys/CopyAPIKeyModal.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import { Form } from '@/ui/elements/Form';
import { FormButtons } from '@/ui/elements/FormButtons';
import { FormContainer } from '@/ui/elements/FormContainer';
import { useClipboard } from '@/ui/hooks';
import { Check, ClipboardOutline } from '@/ui/icons';
import { Checkmark, Clipboard } from '@/ui/icons';
import { localizationKeys } from '@/ui/localization';
import { useFormControl } from '@/ui/utils/useFormControl';

Expand DownExpand Up@@ -82,8 +82,8 @@ export const CopyAPIKeyModal = ({
value={apiKeySecret}
readOnly
sx={{ width: '100%' }}
copyIcon={ClipboardOutline}
copiedIcon={Check}
copyIcon={Clipboard}
copiedIcon={Checkmark}
/>
</Form.CommonInputWrapper>
</Form.ControlRow>
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/src/components/ConfigureSSO/elements/Step.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,7 +12,7 @@ import {
Text,
useLocalizations,
} from '@/customizables';
import { CaretLeft, CaretRight } from '@/icons';
import { ChevronLeft, ChevronRight } from '@/icons';
import { common, type PropsOfComponent } from '@/styledSystem';

import { ProfileCardFooter } from './ProfileCard';
Expand DownExpand Up@@ -142,7 +142,7 @@ const FooterPrevious = ({ onClick, isDisabled, isLoading, label = 'Previous' }:
onClick={handleClick}
>
<Icon
icon={CaretLeft}
icon={ChevronLeft}
size='sm'
sx={t => ({ marginInlineEnd: t.space.$1 })}
/>
Expand DownExpand Up@@ -172,7 +172,7 @@ const FooterContinue = ({ onClick, isDisabled, isLoading, label = 'Continue' }:
>
{labelText}
<Icon
icon={CaretRight}
icon={ChevronRight}
size='sm'
sx={t => ({ marginInlineStart: t.space.$1 })}
/>
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
import React from 'react';

import { Box, descriptors, Flex, Icon, SimpleButton, Text } from '@/customizables';
import { CaretRight, Check } from '@/icons';
import { ChevronRight, Checkmark } from '@/icons';

import type { StepperItemProps, StepperProps } from './types';

Expand All@@ -24,7 +24,7 @@ const Root = ({ children }: StepperProps): JSX.Element => {
{index < items.length - 1 && (
<Icon
elementDescriptor={descriptors.configureSSOStepperSeparator}
icon={CaretRight}
icon={ChevronRight}
size='md'
colorScheme='neutral'
/>
Expand DownExpand Up@@ -77,8 +77,9 @@ const Item = ({
>
{isCompleted && !isCurrent ? (
<Icon
icon={Check}
sx={theme => ({ width: theme.sizes.$2, height: theme.sizes.$2, color: theme.colors.$white })}
icon={Checkmark}
size='sm'
sx={theme => ({ color: theme.colors.$white })}
/>
) : (
<Text
Expand DownExpand Up@@ -127,7 +128,7 @@ const Skeleton = ({ totalSteps = 4 }: SkeletonProps): JSX.Element => (
{index < totalSteps - 1 && (
<Icon
elementDescriptor={descriptors.configureSSOStepperSeparator}
icon={CaretRight}
icon={ChevronRight}
size='md'
colorScheme='neutral'
sx={{ opacity: 0.16 }}
Expand Down
12 changes: 6 additions & 6 deletions packages/ui/src/components/ConfigureSSO/steps/ConfigureStep.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,7 @@ import { useCardState } from '@/elements/contexts';
import { Field } from '@/elements/FieldControl';
import { Form } from '@/elements/Form';
import { SegmentedControl } from '@/elements/SegmentedControl';
import { Check, ClipboardOutline, Close, Upload } from '@/icons';
import { Checkmark, Clipboard, Close, ArrowUpTray } from '@/icons';
import type { FormControlState } from '@/ui/utils/useFormControl';
import { useFormControl } from '@/ui/utils/useFormControl';
import { handleError } from '@/utils/errorHandler';
Expand DownExpand Up@@ -238,8 +238,8 @@ export const CreateAppSubStep = (): JSX.Element => {
<ClipboardInput
value={acsUrl}
readOnly
copyIcon={ClipboardOutline}
copiedIcon={Check}
copyIcon={Clipboard}
copiedIcon={Checkmark}
/>
</Form.CommonInputWrapper>
</Form.ControlRow>
Expand All@@ -249,8 +249,8 @@ export const CreateAppSubStep = (): JSX.Element => {
<ClipboardInput
value={spEntityId}
readOnly
copyIcon={ClipboardOutline}
copiedIcon={Check}
copyIcon={Clipboard}
copiedIcon={Checkmark}
/>
</Form.CommonInputWrapper>
</Form.ControlRow>
Expand DownExpand Up@@ -905,7 +905,7 @@ const ManualEntryPanel = ({
onClick={() => certInputRef.current?.click()}
>
<Icon
icon={Upload}
icon={ArrowUpTray}
size='sm'
colorScheme='neutral'
sx={t => ({ marginInlineEnd: t.space.$1 })}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,7 +33,7 @@ import { Drawer } from '@/elements/Drawer';
import { IconButton } from '@/elements/IconButton';
import { Pagination } from '@/elements/Pagination';
import { useClipboard, useSpinDelay } from '@/hooks';
import { Check, Copy, LinkIcon, RotateLeftRight } from '@/icons';
import { Checkmark, Copy, Link as LinkIcon, RotateLeftRight } from '@/icons';
import { common, mqu } from '@/styledSystem';
import { handleError } from '@/utils/errorHandler';

Expand DownExpand Up@@ -627,7 +627,7 @@ const FullMessageBlock = ({ message }: { message: string }): JSX.Element => {
variant='ghost'
colorScheme='neutral'
size='xs'
icon={hasCopied ? Check : Copy}
icon={hasCopied ? Checkmark : Copy}
aria-label={copyLabel}
onClick={() => onCopy()}
/>
Expand DownExpand Up@@ -756,7 +756,7 @@ const OpenTestUrlButton = ({ onTestRunCreated }: OpenTestUrlButtonProps): JSX.El
{isCreatingTestRun ? (
<Spinner
elementDescriptor={descriptors.spinner}
size='xs'
size='sm'
/>
) : (
<Icon
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
import { Box, descriptors, Flex, Heading, Icon, Link, localizationKeys, Span, Text } from '@/customizables';
import { ArrowRightIcon } from '@/icons';
import { ArrowRight } from '@/icons';

import type { LocalizationKey } from '../../../localization';

Expand DownExpand Up@@ -134,7 +134,7 @@ export const TestRunHowToFixSection = ({ errorCode }: TestRunHowToFixSectionProp
)}
/>
<Icon
icon={ArrowRightIcon}
icon={ArrowRight}
size='sm'
/>
</Link>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,7 +16,7 @@ import { useFormControl } from '@/ui/utils/useFormControl';

import { useWizard, Wizard } from '../../common';
import { Col, Icon } from '../../customizables';
import { Upload } from '../../icons';
import { ArrowUpTray } from '../../icons';
import type { LocalizationKey } from '../../localization';
import { localizationKeys } from '../../localization';
import { InviteMembersForm } from '../OrganizationProfile/InviteMembersForm';
Expand DownExpand Up@@ -157,7 +157,7 @@ export const CreateOrganizationForm = withCardStateProvider((props: CreateOrgani
icon={
<Icon
size='md'
icon={Upload}
icon={ArrowUpTray}
sx={t => ({
color: t.colors.$colorMutedForeground,
transitionDuration: t.transitionDuration.$controls,
Expand Down
5 changes: 2 additions & 3 deletions packages/ui/src/components/OAuthConsent/OrgSelect.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import { useRef } from 'react';

import { Box, Icon, Image, Text } from '@/ui/customizables';
import { Select, SelectButton, SelectOptionList } from '@/ui/elements/Select';
import { Check } from '@/ui/icons';
import { Checkmark } from '@/ui/icons';
import { common } from '@/ui/styledSystem';

export type OrgOption = {
Expand DownExpand Up@@ -66,8 +66,7 @@ export function OrgSelect({ options, value, onChange }: OrgSelectProps) {
</Text>
{isSelected && (
<Icon
icon={Check}
size='sm'
icon={Checkmark}
sx={theme => ({ color: theme.colors.$primary500 })}
/>
)}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@ import { SuccessPage } from '@/ui/elements/SuccessPage';
import { useWizard, Wizard } from '../../common';
import { descriptors, Flex, localizationKeys, Text } from '../../customizables';
import { useActionContext } from '../../elements/Action/ActionRoot';
import { Email } from '../../icons';
import { Envelope } from '../../icons';
import { InviteMembersForm } from './InviteMembersForm';
type InviteMembersScreenProps = {
onReset?: () => void;
Expand DownExpand Up@@ -57,7 +57,7 @@ export const InvitationsSentMessage = () => {
<IconCircle
boxElementDescriptor={descriptors.invitationsSentIconBox}
iconElementDescriptor={descriptors.invitationsSentIcon}
icon={Email}
icon={Envelope}
/>
<Text localizationKey={localizationKeys('organizationProfile.invitePage.successMessage')} />
</Flex>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,7 +12,7 @@ import { NotificationCountBadge, withProtect } from '../../common';
import { useEnvironment, useOrganizationSwitcherContext } from '../../contexts';
import { descriptors, Flex, localizationKeys } from '../../customizables';
import { RootBox } from '../../elements/RootBox';
import { CogFilled } from '../../icons';
import { Cog } from '../../icons';
import type { PropsOfComponent, ThemableCssProp } from '../../styledSystem';
import { OrganizationActionList } from './OtherOrganizationActions';

Expand DownExpand Up@@ -101,7 +101,7 @@ export const OrganizationSwitcherPopover = React.forwardRef<HTMLDivElement, Orga
iconBoxElementId={descriptors.organizationSwitcherPopoverActionButtonIconBox.setId('manageOrganization')}
iconElementDescriptor={descriptors.organizationSwitcherPopoverActionButtonIcon}
iconElementId={descriptors.organizationSwitcherPopoverActionButtonIcon.setId('manageOrganization')}
icon={CogFilled}
icon={Cog}
label={localizationKeys('organizationSwitcher.action__manageOrganization')}
onClick={() => handleItemClick()}
trailing={<NotificationCountBadgeManageButton />}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ import { UserInvitationSuggestionList } from './UserInvitationSuggestionList';
import type { UserMembershipListProps } from './UserMembershipList';
import { UserMembershipList } from './UserMembershipList';
import { CreateOrganizationAction } from '@/common/CreateOrganizationAction';
import { Add } from '@/icons';

export interface OrganizationActionListProps extends UserMembershipListProps {
onCreateOrganizationClick: React.MouseEventHandler;
Expand All@@ -21,6 +22,7 @@ const CreateOrganizationButton = ({
iconBoxElementId={descriptors.organizationSwitcherPopoverActionButtonIconBox.setId('createOrganization')}
iconElementDescriptor={descriptors.organizationSwitcherPopoverActionButtonIcon}
iconElementId={descriptors.organizationSwitcherPopoverActionButtonIcon.setId('createOrganization')}
icon={Add}
label={localizationKeys('organizationSwitcher.action__createOrganization')}
onClick={onCreateOrganizationClick}
sx={t => ({
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,7 +16,7 @@ import { InfiniteListSpinner } from '../../common';
import { useAcceptedInvitations } from '../../contexts';
import { Box, Button, descriptors, Flex, localizationKeys, Text } from '../../customizables';
import { useInView } from '../../hooks';
import { SwitchArrowRight } from '../../icons';
import { ArrowRight } from '../../icons';
import type { PropsOfComponent } from '../../styledSystem';
import { common } from '../../styledSystem';
import { organizationListParams, populateCacheUpdateItem } from './utils';
Expand DownExpand Up@@ -178,7 +178,7 @@ const InvitationPreview = withCardStateProvider(
return (
<PreviewButton
elementDescriptor={descriptors.organizationSwitcherPreviewButton}
icon={SwitchArrowRight}
icon={ArrowRight}
onClick={acceptedOrganization ? () => onOrganizationClick(acceptedOrganization) : undefined}
role='menuitem'
>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ import { InfiniteListSpinner } from '../../common';
import { useOrganizationSwitcherContext } from '../../contexts';
import { Box, descriptors, localizationKeys } from '../../customizables';
import { useInView } from '../../hooks';
import { SwitchArrowRight } from '../../icons';
import { ArrowRight } from '../../icons';
import { common } from '../../styledSystem';
import { organizationListParams } from './utils';

Expand DownExpand Up@@ -81,7 +81,7 @@ export const UserMembershipList = (props: UserMembershipListProps) => {
<PreviewButton
elementDescriptor={descriptors.organizationSwitcherPreviewButton}
elementId={descriptors.organizationSwitcherPreviewButton.setId('personal')}
icon={SwitchArrowRight}
icon={ArrowRight}
onClick={onPersonalWorkspaceClick}
role='menuitem'
>
Expand All@@ -97,7 +97,7 @@ export const UserMembershipList = (props: UserMembershipListProps) => {
key={organization.id}
elementDescriptor={descriptors.organizationSwitcherPreviewButton}
elementId={descriptors.organizationSwitcherPreviewButton.setId('organization')}
icon={SwitchArrowRight}
icon={ArrowRight}
onClick={() => onOrganizationClick(organization)}
role='menuitem'
sx={t => ({
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,7 @@ import {
useLocalizations,
} from '../../customizables';
import { useClipboard } from '../../hooks';
import { Check, Copy } from '../../icons';
import { Checkmark, Copy } from '../../icons';
import { useRouter } from '../../router';

export const PaymentAttemptPage = () => {
Expand DownExpand Up@@ -286,7 +286,7 @@ function CopyButton({ text, copyLabel = 'Copy' }: { text: string; copyLabel?: st
>
<Icon
size='sm'
icon={hasCopied ? Check : Copy}
icon={hasCopied ? Checkmark : Copy}
aria-hidden
/>
</Button>
Expand Down
Loading
Loading