Skip to content

Commit

Permalink
Update icons
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanqing committed Dec 11, 2024
1 parent 1af2c32 commit d39aa49
Show file tree
Hide file tree
Showing 61 changed files with 238 additions and 182 deletions.
File renamed without changes
2 changes: 1 addition & 1 deletion packages/ui/icons/Size 16/Chevron Down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/ui/icons/Size 16/Chevron Left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/ui/icons/Size 16/Chevron Up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions packages/ui/icons/Size 16/Menu Checkmark Breadcrumb.svg

This file was deleted.

3 changes: 0 additions & 3 deletions packages/ui/icons/Size 16/Menu Checkmark Checked.svg

This file was deleted.

3 changes: 0 additions & 3 deletions packages/ui/icons/Size 16/Menu Checkmark Mixed.svg

This file was deleted.

3 changes: 3 additions & 0 deletions packages/ui/icons/Size 24/Close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/ui/icons/Size 24/Ellipsis.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/ui/icons/Size 24/Minus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/ui/icons/Size 24/Plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/ui/icons/Size 24/Search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/ui/icons/Size 24/Text Align Center.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/ui/icons/Size 24/Text Align Left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/ui/icons/Size 24/Text Align Right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions packages/ui/icons/Size 8/Control Chevron Down.svg

This file was deleted.

3 changes: 0 additions & 3 deletions packages/ui/icons/Size 8/Control Chevron Up.svg

This file was deleted.

4 changes: 2 additions & 2 deletions packages/ui/src/components/checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ComponentChildren, h } from 'preact'
import { useCallback } from 'preact/hooks'

import { IconUi3CheckboxCheck16 } from '../../icons/icon-16/icon-ui-3-checkbox-check-16.js'
import { IconCheck16 } from '../../icons/icon-16/icon-check-16.js'
import { Event, EventHandler } from '../../types/event-handler.js'
import { FocusableComponentProps } from '../../types/focusable-component-props.js'
import { createClassName } from '../../utilities/create-class-name.js'
Expand Down Expand Up @@ -75,7 +75,7 @@ export const Checkbox = createComponent<HTMLInputElement, CheckboxProps>(
<div class={styles.box}>
{value === true ? (
<div class={styles.checkIcon}>
<IconUi3CheckboxCheck16 />
<IconCheck16 />
</div>
) : null}
</div>
Expand Down
6 changes: 1 addition & 5 deletions packages/ui/src/components/disclosure/disclosure.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@
.title .icon {
position: absolute;
left: var(--space-0);
display: none;
color: var(--figma-color-icon-tertiary);
}
.input:hover ~ .title .icon {
display: block;
color: var(--figma-color-icon);
}
.input:checked ~ .title .icon {
transform: rotate(90deg);
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/components/disclosure/disclosure.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ComponentChildren, Fragment, h } from 'preact'
import { useCallback } from 'preact/hooks'

import { IconUi3DisclosureChevron16 } from '../../icons/icon-16/icon-ui-3-disclosure-chevron-16.js'
import { IconChevronRight16 } from '../../icons/icon-16/icon-chevron-right-16.js'
import { Event, EventHandler } from '../../types/event-handler.js'
import { FocusableComponentProps } from '../../types/focusable-component-props.js'
import { createComponent } from '../../utilities/create-component.js'
Expand Down Expand Up @@ -57,7 +57,7 @@ export const Disclosure = createComponent<HTMLInputElement, DisclosureProps>(
/>
<div class={styles.title}>
<div class={styles.icon}>
<IconUi3DisclosureChevron16 />
<IconChevronRight16 />
</div>
{title}
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/dropdown/dropdown.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
}

.chevronIcon {
padding-right: calc(var(--space-8) - var(--border-width-1));
padding-right: var(--space-4);
color: var(--figma-color-icon);
}
.disabled .chevronIcon {
Expand Down
8 changes: 4 additions & 4 deletions packages/ui/src/components/dropdown/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { useCallback, useEffect, useRef, useState } from 'preact/hooks'
import menuStyles from '../../css/menu.module.css'
import { useMouseDownOutside } from '../../hooks/use-mouse-down-outside.js'
import { useScrollableMenu } from '../../hooks/use-scrollable-menu.js'
import { IconControlChevronDown8 } from '../../icons/icon-8/icon-control-chevron-down-8.js'
import { IconMenuCheckmarkChecked16 } from '../../icons/icon-16/icon-menu-checkmark-checked-16.js'
import { IconCheck16 } from '../../icons/icon-16/icon-check-16.js'
import { IconChevronDown16 } from '../../icons/icon-16/icon-chevron-down-16.js'
import { Event, EventHandler } from '../../types/event-handler.js'
import { createClassName } from '../../utilities/create-class-name.js'
import { createComponent } from '../../utilities/create-component.js'
Expand Down Expand Up @@ -322,7 +322,7 @@ export const Dropdown = createComponent<HTMLDivElement, DropdownProps>(
<div class={dropdownStyles.value}>{children}</div>
)}
<div class={dropdownStyles.chevronIcon}>
<IconControlChevronDown8 />
<IconChevronDown16 />
</div>
{createPortal(
<div
Expand Down Expand Up @@ -382,7 +382,7 @@ export const Dropdown = createComponent<HTMLDivElement, DropdownProps>(
/>
{option.value === value ? (
<div class={menuStyles.checkIcon}>
<IconMenuCheckmarkChecked16 />
<IconCheck16 />
</div>
) : null}
{typeof option.text === 'undefined'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { h, JSX } from 'preact'

import { useInitialFocus } from '../../../hooks/use-initial-focus/use-initial-focus.js'
import { IconPlus32 } from '../../../icons/icon-32/icon-plus-32.js'
import { IconPlus24 } from '../../../icons/icon-24/icon-plus-24.js'
import { IconButton } from '../icon-button.js'

export default {
Expand All @@ -15,7 +15,7 @@ export const Passive = function () {
}
return (
<IconButton onClick={handleClick}>
<IconPlus32 />
<IconPlus24 />
</IconButton>
)
}
Expand All @@ -26,7 +26,7 @@ export const Focused = function () {
}
return (
<IconButton {...useInitialFocus()} onClick={handleClick}>
<IconPlus32 />
<IconPlus24 />
</IconButton>
)
}
Expand All @@ -37,7 +37,7 @@ export const Disabled = function () {
}
return (
<IconButton disabled onClick={handleClick}>
<IconPlus32 />
<IconPlus24 />
</IconButton>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { h, JSX } from 'preact'
import { useState } from 'preact/hooks'

import { useInitialFocus } from '../../../hooks/use-initial-focus/use-initial-focus.js'
import { IconEllipsis32 } from '../../../icons/icon-32/icon-ellipsis-32.js'
import { IconEllipsis24 } from '../../../icons/icon-24/icon-ellipsis-24.js'
import { IconToggleButton } from '../icon-toggle-button.js'

export default {
Expand All @@ -20,7 +20,7 @@ export const Passive = function () {
}
return (
<IconToggleButton onChange={handleChange} value={value}>
<IconEllipsis32 />
<IconEllipsis24 />
</IconToggleButton>
)
}
Expand All @@ -38,7 +38,7 @@ export const Focused = function () {
onChange={handleChange}
value={value}
>
<IconEllipsis32 />
<IconEllipsis24 />
</IconToggleButton>
)
}
Expand All @@ -49,7 +49,7 @@ export const Disabled = function () {
}
return (
<IconToggleButton disabled onChange={handleChange} value={true}>
<IconEllipsis32 />
<IconEllipsis24 />
</IconToggleButton>
)
}
Expand All @@ -62,7 +62,7 @@ export const OnValueChange = function () {
}
return (
<IconToggleButton onValueChange={handleValueChange} value={value}>
<IconEllipsis32 />
<IconEllipsis24 />
</IconToggleButton>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { h, JSX } from 'preact'
import { useState } from 'preact/hooks'

import { useInitialFocus } from '../../../hooks/use-initial-focus/use-initial-focus.js'
import { IconEllipsis32 } from '../../../icons/icon-32/icon-ellipsis-32.js'
import { IconEllipsis24 } from '../../../icons/icon-24/icon-ellipsis-24.js'
import { IconToggleButton } from '../icon-toggle-button.js'

export default {
Expand All @@ -20,7 +20,7 @@ export const Passive = function () {
}
return (
<IconToggleButton onChange={handleChange} value={value}>
<IconEllipsis32 />
<IconEllipsis24 />
</IconToggleButton>
)
}
Expand All @@ -38,7 +38,7 @@ export const Focused = function () {
onChange={handleChange}
value={value}
>
<IconEllipsis32 />
<IconEllipsis24 />
</IconToggleButton>
)
}
Expand All @@ -49,7 +49,7 @@ export const Disabled = function () {
}
return (
<IconToggleButton disabled onChange={handleChange} value={false}>
<IconEllipsis32 />
<IconEllipsis24 />
</IconToggleButton>
)
}
Expand All @@ -62,7 +62,7 @@ export const OnValueChange = function () {
}
return (
<IconToggleButton onValueChange={handleValueChange} value={value}>
<IconEllipsis32 />
<IconEllipsis24 />
</IconToggleButton>
)
}
5 changes: 4 additions & 1 deletion packages/ui/src/components/modal/modal.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
border-bottom-width: 1px;
}

.closeButton {
display: flex;
}
.closeButtonLeft {
order: -1;
}
Expand All @@ -82,7 +85,7 @@
right: 0;
bottom: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.5); /* FIXME */
background-color: var(--color-bg-overlay);
opacity: 0;
pointer-events: none;
transition: opacity ease 0.3s;
Expand Down
11 changes: 6 additions & 5 deletions packages/ui/src/components/modal/modal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ComponentChild, h, RefObject, render } from 'preact'
import { useEffect, useRef } from 'preact/hooks'

import { IconCross32 } from '../../icons/icon-32/icon-cross-32.js'
import { IconClose24 } from '../../icons/icon-24/icon-close-24.js'
import { EventHandler } from '../../types/event-handler.js'
import { createClassName } from '../../utilities/create-class-name.js'
import { createComponent } from '../../utilities/create-component.js'
Expand Down Expand Up @@ -31,7 +31,7 @@ export type ModalPosition = 'bottom' | 'center' | 'left' | 'right'
export const Modal = createComponent<HTMLDivElement, ModalProps>(function (
{
children,
closeButtonIcon = <IconCross32 />,
closeButtonIcon = <IconClose24 />,
closeButtonPosition = 'right',
open,
transition = true,
Expand Down Expand Up @@ -170,11 +170,12 @@ export const Modal = createComponent<HTMLDivElement, ModalProps>(function (
</div>
{typeof onCloseButtonClick === 'undefined' ? null : (
<div
class={
class={createClassName([
styles.closeButton,
closeButtonPosition === 'left'
? styles.closeButtonLeft
: undefined
}
: null
])}
>
<IconButton onClick={onCloseButtonClick}>
{closeButtonIcon}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
display: block;
width: var(--space-16);
height: var(--space-16);
border: var(--border-width-4) solid var(--figma-color-bg);
border: var(--border-width-4) solid var(--figma-color-icon-onbrand);
border-radius: var(--space-8);
-webkit-appearance: none;
appearance: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

.searchIcon {
position: absolute;
top: var(--space-0);
left: var(--space-0);
top: var(--space-4);
left: var(--space-4);
color: var(--figma-color-icon-secondary);
pointer-events: none; /* so that clicking the icon focuses the textbox */
}
Expand All @@ -41,7 +41,7 @@
right: var(--space-0);
width: var(--space-32);
height: var(--space-32);
padding: var(--space-4);
padding: calc(var(--space-4) - var(--border-width-1));
color: var(--figma-color-icon-secondary);
}
.searchTextbox:not(.disabled) .clearButton:hover,
Expand All @@ -53,18 +53,13 @@
}

.clearButtonBox {
width: var(--space-24);
height: var(--space-24);
display: block;
border: var(--border-width-1) solid transparent;
border-radius: var(--border-radius-4);
}
.searchTextbox:not(.disabled) .clearButton:focus-visible .clearButtonBox {
border-color: var(--figma-color-border-selected);
}

.crossIcon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.clearButtonBox svg {
display: block;
}
Loading

0 comments on commit d39aa49

Please sign in to comment.