Commit Graph

37 Commits

Author SHA1 Message Date
rektdeckard
50b603b525 InfoPanel: massive overhaul to support mobile size and PNG download
This patch reworks the mobile breakpoint to allow whitespace wrapping of
code snippets and does away with horizontal scroll. Overall, the
usability and intuitiveness is much better, though readability of the
code itself takes a hit.

In addition, we added the ability to download an icon as a PNG thanks to
the svg2png-converter library. PNGs adopt the current preview weight and
color, and are sized at 256x256.
2020-10-04 23:15:51 -04:00
rektdeckard
bc8c00df3d IconGrid: stop icon preview from bounding on panel open 2020-10-04 16:13:00 -04:00
rektdeckard
2870f20ddf Header+Footer: further implement new spec 2020-10-04 01:30:15 -04:00
rektdeckard
fc685bae84 Warn: properly ellide error message text 2020-09-28 03:30:32 -04:00
rektdeckard
54f18db921 IconGridItem: nix the redundant ErrorBoundary 2020-09-28 01:18:38 -04:00
rektdeckard
9f3ec2d9d6 IconGrid: handle text overflow on empty search 2020-09-27 22:16:47 -04:00
rektdeckard
3fdc7bb87a InfoPanel: indicate lack of support for duotone weight in JS lib
While phosphor-icons uses an icon font implementation, we won't be able
to provide the duotone weight in that library. We now indicate lack of
support by disabling the code snippet and copy button.
2020-09-27 13:47:49 -04:00
rektdeckard
55bab04497 SearchInput+IconGrid: scroll to top of grid on search change
When the debounced search query changes, scroll to the top of the grid
if the query is not the empty string. This has the same smooth behavior
as the scroll buttons, which is not currently available on WebKit.
2020-09-26 00:41:48 -04:00
rektdeckard
22f066c6a9 components+hooks: refactor window measurement
We relocated window measurment logic into a hook, useGridSpans(), which
tells us the appropriate number of columns for the IconGrid. This is
useful for rendering an InfoPanel in the right place! In future we
should look into a custom implementation using ResizeObserver and
polyfills, and that may be extensible for other use-cases.
2020-09-24 19:24:00 -04:00
rektdeckard
80d4502207 App: update to phosphor-react@0.3.0 and replace renamed icons in-situ 2020-09-23 16:05:41 -04:00
rektdeckard
b01dd7b7e2 selectors: rename iconStyleAtom -> iconWeightAtom 2020-09-15 01:35:08 -04:00
rektdeckard
78a69c9f3b IconGrid: extract empty state into Warn component
The empty state now renders a Warn component, which can be used to show
empty queries, or to show an arbitrary error message.
2020-09-14 17:48:00 -04:00
rektdeckard
b4db1df589 components: memoize and streamline callbacks 2020-09-14 01:05:55 -04:00
rektdeckard
3c0ab1a051 IconGrid: improve empty-state rendering and animation
When search returns no results, the empty-list state now adopts the
current color theme and animates in. The IconGrid also takes up a
minimum of 80vh vertical space, whether the list is populated or empty.
2020-09-13 15:45:14 -04:00
rektdeckard
251b59c53c InfoPanel: add code snippet for Vue library
We now generate snippets for the phosphor-vue in addition to HTML and
React libraries. The panel interface may be getting a bit too cluttered,
and we should consider a redesign in the future.
2020-09-12 17:01:27 -04:00
rektdeckard
361cacdabd state+components: reimplement 'isDark' as a selector
We now have a consolidated source of truth for whether the UI should us
dark mode to accomodate a light icon color. This is a recoil selector
that derives from iconColorAtom.

In addition, we renamed styleQueryAtom -> iconStyleAtom for consistency.
2020-09-09 20:00:58 -04:00
rektdeckard
e1c4a72026 IconGrid: add overflow scroll on mobile breakpoint 2020-08-18 14:15:36 -04:00
rektdeckard
7cc707a942 InfoPanel: handle missing Clipboard API silently 2020-08-18 14:14:56 -04:00
rektdeckard
1d2bacd899 InfoPanel: make snippets keyboard-navigable and autoselected
Code snippets can now be navigated to be keyboard. Additionally,
focusing this way or by single-clicking will select the entire snippet
contents by default, then after a 50ms delay, allow for normal text
selection. This is a better experience for copying, especially on
mobile.
2020-08-17 13:06:05 -04:00
rektdeckard
192eb5b8eb InfoPanel: add breakpoints that simplify panel on mobile 2020-08-17 02:53:18 -04:00
rektdeckard
8faf7be451 IconGrid: switch to fill-style icon buttons 2020-08-17 02:19:55 -04:00
rektdeckard
017a05a769 Update to phosphor-react@0.2.0 2020-08-16 16:42:57 -04:00
rektdeckard
37d80d4b9d IconGrid: extract some inline styles 2020-08-15 20:02:55 -04:00
rektdeckard
d924ab8fc9 InfoPanel: downloaded SVGs now contain appropriate weight in filename 2020-08-10 16:06:11 -04:00
rektdeckard
ae4d6bedd2 IconGrid: revise grid item hover/active state styles 2020-08-07 14:43:33 -04:00
rektdeckard
0af7c55ed7 IconGrid: fix padding 2020-08-03 22:25:05 -04:00
rektdeckard
6b868aa59b IconGrid: adjust grid item and info panel hover/active states
This is now in compliance with the spec, using a single color with
opacity to render open/hovered/active GridItems and InfoPanels. We also
properly show background on open GridItems.
2020-08-03 18:22:41 -04:00
Tobias Fried
d1f22a3dbc ErrorBoundary: add error boundary to IconGrid 2020-07-31 20:01:25 -04:00
Tobias Fried
f79eb5a5d3 InfoPanel: show confirmation icons on successful SVG or snippet copy
This patch makes immediate use of useTransientState() to fire a
temporary state transition to show success/failure of copy action.

Note: we should handle error states using other icon.
2020-07-31 19:59:25 -04:00
rektdeckard
6941250d10 IconGrid: massive refactor including component extraction
This patch extracts InfoPanel from IconGridItem, adds style tweaks to
match the spec, and in general reduces prop-drilling by tapping into
recoil state for most config, and making use of IconContext to style
member icons where appropriate :)
2020-07-29 12:27:50 -04:00
rektdeckard
105a1abc96 IconGrid: drop virtualization approach and bump to phosphor-react@0.1.8 2020-07-29 12:20:53 -04:00
rektdeckard
ecb51191d8 Massive interactivity updates to all components 2020-07-24 14:40:07 -04:00
rektdeckard
19d9b8c7d2 Scaffold out UI components 2020-07-21 23:07:52 -04:00
Tobias Fried
016e6d987b Experiment with virtualization and Framer Motion 2020-07-19 17:51:35 -04:00
Tobias Fried
e1dfe6aed1 IconGrid: experiment with various list virtualization libraries 2020-07-17 13:24:00 -04:00
rektdeckard
8888227be1 Add sample icons and refactor Icon interface 2020-07-15 18:06:16 -04:00
Tobias Fried
3a9cf5dc99 Initial commit 2020-07-14 17:41:45 -04:00