Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hover & Focus state for Social Icons #670

Merged
merged 2 commits into from
Oct 11, 2023
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
2 changes: 1 addition & 1 deletion website/components/back-in-block/count.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ export function CountExample() {
</button>
</div>
);
}
}
2 changes: 1 addition & 1 deletion website/components/back-in-block/slideshow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ export function Slideshow({
</div>
</div>
);
}
}
2 changes: 1 addition & 1 deletion website/components/back-in-block/static-analysis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -852,4 +852,4 @@ export const descriptions = [

export const StaticAnalysisExample = () => {
return <Slideshow frames={frames} descriptions={descriptions} />;
};
};
2 changes: 1 addition & 1 deletion website/components/back-in-block/vdom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1568,4 +1568,4 @@ const descriptions = [

export const VDomExample = () => {
return <Slideshow frames={frames} descriptions={descriptions} />;
};
};
4 changes: 2 additions & 2 deletions website/components/home/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export function About() {
React at the speed of raw JS
</h2>
<p className="text-lg my-8 text-zinc-600 dark:text-zinc-300">
Million.js automatically optimizes React, making it run way faster. It's one
of the top performers in the{' '}
Million.js automatically optimizes React, making it run way
faster. It's one of the top performers in the{' '}
<a
href="https://krausest.github.io/js-framework-benchmark/2023/table_chrome_112.0.5615.49.html"
target="_blank"
Expand Down
28 changes: 28 additions & 0 deletions website/components/icons/discord-icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export function DiscordIcon() {
return (
<>
<svg
width="24"
height="24"
fill="currentColor"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 5 30.67 23.25"
>
<title>Discord</title>
<path d="M26.0015 6.9529C24.0021 6.03845 21.8787 5.37198 19.6623 5C19.3833 5.48048 19.0733 6.13144 18.8563 6.64292C16.4989 6.30193 14.1585 6.30193 11.8336 6.64292C11.6166 6.13144 11.2911 5.48048 11.0276 5C8.79575 5.37198 6.67235 6.03845 4.6869 6.9529C0.672601 12.8736 -0.41235 18.6548 0.130124 24.3585C2.79599 26.2959 5.36889 27.4739 7.89682 28.2489C8.51679 27.4119 9.07477 26.5129 9.55525 25.5675C8.64079 25.2265 7.77283 24.808 6.93587 24.312C7.15286 24.1571 7.36986 23.9866 7.57135 23.8161C12.6241 26.1255 18.0969 26.1255 23.0876 23.8161C23.3046 23.9866 23.5061 24.1571 23.7231 24.312C22.8861 24.808 22.0182 25.2265 21.1037 25.5675C21.5842 26.5129 22.1422 27.4119 22.7621 28.2489C25.2885 27.4739 27.8769 26.2959 30.5288 24.3585C31.1952 17.7559 29.4733 12.0212 26.0015 6.9529ZM10.2527 20.8402C8.73376 20.8402 7.49382 19.4608 7.49382 17.7714C7.49382 16.082 8.70276 14.7025 10.2527 14.7025C11.7871 14.7025 13.0425 16.082 13.0115 17.7714C13.0115 19.4608 11.7871 20.8402 10.2527 20.8402ZM20.4373 20.8402C18.9183 20.8402 17.6768 19.4608 17.6768 17.7714C17.6768 16.082 18.8873 14.7025 20.4373 14.7025C21.9717 14.7025 23.2271 16.082 23.1961 17.7714C23.1961 19.4608 21.9872 20.8402 20.4373 20.8402Z"></path>
</svg>
<style jsx>
{`
svg {
transition: fill 0.5s ease;
}

svg:hover,
svg:focus {
fill: #6f42c1;
}
`}
</style>
</>
);
}
22 changes: 22 additions & 0 deletions website/components/icons/github-icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export function GitHubIcon() {
return (
<>
<svg width="24" height="24" fill="currentColor" viewBox="3 3 18 18">
<title>GitHub</title>
<path d="M12 3C7.0275 3 3 7.12937 3 12.2276C3 16.3109 5.57625 19.7597 9.15374 20.9824C9.60374 21.0631 9.77249 20.7863 9.77249 20.5441C9.77249 20.3249 9.76125 19.5982 9.76125 18.8254C7.5 19.2522 6.915 18.2602 6.735 17.7412C6.63375 17.4759 6.19499 16.6569 5.8125 16.4378C5.4975 16.2647 5.0475 15.838 5.80124 15.8264C6.51 15.8149 7.01625 16.4954 7.18499 16.7723C7.99499 18.1679 9.28875 17.7758 9.80625 17.5335C9.885 16.9337 10.1212 16.53 10.38 16.2993C8.3775 16.0687 6.285 15.2728 6.285 11.7432C6.285 10.7397 6.63375 9.9092 7.20749 9.26326C7.1175 9.03257 6.8025 8.08674 7.2975 6.81794C7.2975 6.81794 8.05125 6.57571 9.77249 7.76377C10.4925 7.55615 11.2575 7.45234 12.0225 7.45234C12.7875 7.45234 13.5525 7.55615 14.2725 7.76377C15.9937 6.56418 16.7475 6.81794 16.7475 6.81794C17.2424 8.08674 16.9275 9.03257 16.8375 9.26326C17.4113 9.9092 17.76 10.7281 17.76 11.7432C17.76 15.2843 15.6563 16.0687 13.6537 16.2993C13.98 16.5877 14.2613 17.1414 14.2613 18.0065C14.2613 19.2407 14.25 20.2326 14.25 20.5441C14.25 20.7863 14.4188 21.0746 14.8688 20.9824C16.6554 20.364 18.2079 19.1866 19.3078 17.6162C20.4077 16.0457 20.9995 14.1611 21 12.2276C21 7.12937 16.9725 3 12 3Z"></path>
</svg>
<style jsx>
{`
svg {
transition: fill 0.5s ease;
}

svg:hover,
svg:focus {
fill: #6f42c1;
}
`}
</style>
</>
);
}
49 changes: 49 additions & 0 deletions website/components/icons/twitter-x-icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
export function TwitterXIcon() {
return (
<>
<a
style={{ padding: '0.5rem' }}
target="_blank"
href="https://twitter.com/milliondotjs"
aria-label="Million.js twitter"
rel="nofollow noreferrer"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="currentColor"
className="feather feather-twitter"
>
<path d="M16.99 0H20.298L13.071 8.26L21.573 19.5H14.916L9.702 12.683L3.736 19.5H0.426L8.156 10.665L0 0H6.826L11.539 6.231L16.99 0ZM15.829 17.52H17.662L5.83 1.876H3.863L15.829 17.52Z"></path>
</svg>
<style jsx>
{`
svg {
transition: fill 0.5s ease;
}

svg:hover,
svg:focus {
fill: #6f42c1;
}
`}
</style>
</a>
<a
href="/~https://github.com/sponsors/aidenybai"
target="_blank"
className="hidden sm:block"
>
<iframe
src="/~https://github.com/sponsors/aidenybai/button"
title="Sponsor aidenybai"
height="32"
width="114"
className="rounded-md border-0 dark:invert invert-0"
></iframe>
</a>
</>
);
}
66 changes: 51 additions & 15 deletions website/components/million-library/block-878fb9ae.d.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,57 @@
import { P as Props, a as VElement, V as VNode, A as AbstractBlock, E as Edit } from './types-35702ad2.js';
import {
P as Props,
a as VElement,
V as VNode,
A as AbstractBlock,
E as Edit,
} from './types-35702ad2.js';

declare const block: (fn: (props?: Props) => VElement, unwrap?: ((vnode: any) => VNode) | undefined, shouldUpdate?: ((oldProps: Props, newProps: Props) => boolean) | undefined) => (props?: Props | null, key?: string, shouldUpdateCurrentBlock?: ((oldProps: Props, newProps: Props) => boolean) | undefined) => Block;
declare const mount: (block: AbstractBlock, parent?: HTMLElement) => HTMLElement;
declare const patch: (oldBlock: AbstractBlock, newBlock: AbstractBlock) => HTMLElement;
declare const block: (
fn: (props?: Props) => VElement,
unwrap?: ((vnode: any) => VNode) | undefined,
shouldUpdate?: ((oldProps: Props, newProps: Props) => boolean) | undefined,
) => (
props?: Props | null,
key?: string,
shouldUpdateCurrentBlock?:
| ((oldProps: Props, newProps: Props) => boolean)
| undefined,
) => Block;
declare const mount: (
block: AbstractBlock,
parent?: HTMLElement,
) => HTMLElement;
declare const patch: (
oldBlock: AbstractBlock,
newBlock: AbstractBlock,
) => HTMLElement;
declare class Block extends AbstractBlock {
r: HTMLElement;
e: Edit[];
constructor(root: HTMLElement, edits: Edit[], props?: Props | null, key?: string, shouldUpdate?: (oldProps: Props, newProps: Props) => boolean, getElements?: (root: HTMLElement) => HTMLElement[]);
m(parent?: HTMLElement, refNode?: Node | null): HTMLElement;
p(newBlock: AbstractBlock): HTMLElement;
v(block?: AbstractBlock | null, refNode?: Node | null): void;
x(): void;
u(_oldProps: Props, _newProps: Props): boolean;
s(): string;
t(): HTMLElement | null | undefined;
r: HTMLElement;
e: Edit[];
constructor(
root: HTMLElement,
edits: Edit[],
props?: Props | null,
key?: string,
shouldUpdate?: (oldProps: Props, newProps: Props) => boolean,
getElements?: (root: HTMLElement) => HTMLElement[],
);
m(parent?: HTMLElement, refNode?: Node | null): HTMLElement;
p(newBlock: AbstractBlock): HTMLElement;
v(block?: AbstractBlock | null, refNode?: Node | null): void;
x(): void;
u(_oldProps: Props, _newProps: Props): boolean;
s(): string;
t(): HTMLElement | null | undefined;
}
declare const stringToDOM: (content: string) => HTMLElement;
declare const withKey: (value: any, key: string) => any;

export { Block as B, block as b, mount as m, patch as p, stringToDOM as s, withKey as w };
export {
Block as B,
block as b,
mount as m,
patch as p,
stringToDOM as s,
withKey as w,
};
30 changes: 20 additions & 10 deletions website/components/million-library/compiler.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,32 @@ import * as _babel_core from '@babel/core';
import { NodePath } from '@babel/core';
import * as t from '@babel/types';

declare const _default: (api: object, options: Record<string, any> | null | undefined, dirname: string) => {
name: string;
visitor: {
CallExpression(this: _babel_core.PluginPass, path: NodePath<t.CallExpression>): void;
};
declare const _default: (
api: object,
options: Record<string, any> | null | undefined,
dirname: string,
) => {
name: string;
visitor: {
CallExpression(
this: _babel_core.PluginPass,
path: NodePath<t.CallExpression>,
): void;
};
};

interface UserOptions {
ignoreFiles?: string[];
memo?: boolean;
mode: 'react' | 'next' | 'react-server' | 'optimize';
ignoreFiles?: string[];
memo?: boolean;
mode: 'react' | 'next' | 'react-server' | 'optimize';
}

declare const unplugin: _unplugin.UnpluginInstance<UserOptions | undefined, boolean>;
declare const unplugin: _unplugin.UnpluginInstance<
UserOptions | undefined,
boolean
>;
declare const next: (nextConfig?: Record<string, any>) => {
webpack(config: Record<string, any>, options: Record<string, any>): any;
webpack(config: Record<string, any>, options: Record<string, any>): any;
};

export { _default as babelPlugin, unplugin as default, next, unplugin };
6 changes: 5 additions & 1 deletion website/components/million-library/jsx-runtime.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { P as Props, V as VNode } from './types-35702ad2.js';

declare const h: (type: string, props?: Props | null, ...children: VNode[]) => VNode;
declare const h: (
type: string,
props?: Props | null,
...children: VNode[]
) => VNode;

export { h as createElement, h, h as jsx, h as jsxs };
40 changes: 28 additions & 12 deletions website/components/million-library/million.d.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,37 @@
export { B as Block, b as block, m as mount, p as patch, s as stringToDOM, w as withKey } from './block-878fb9ae.js';
export {
B as Block,
b as block,
m as mount,
p as patch,
s as stringToDOM,
w as withKey,
} from './block-878fb9ae.js';
import { A as AbstractBlock, V as VNode, E as Edit } from './types-35702ad2.js';
export { A as AbstractBlock, P as Props, a as VElement, V as VNode } from './types-35702ad2.js';
export {
A as AbstractBlock,
P as Props,
a as VElement,
V as VNode,
} from './types-35702ad2.js';

declare const mapArray: (children: AbstractBlock[]) => ArrayBlock;
declare class ArrayBlock extends AbstractBlock {
b: AbstractBlock[];
constructor(children: AbstractBlock[]);
v(): void;
p(fragment: ArrayBlock): HTMLElement;
m(parent: HTMLElement, refNode?: Node | null): HTMLElement;
x(): void;
u(): boolean;
s(): string;
t(): HTMLElement | null | undefined;
b: AbstractBlock[];
constructor(children: AbstractBlock[]);
v(): void;
p(fragment: ArrayBlock): HTMLElement;
m(parent: HTMLElement, refNode?: Node | null): HTMLElement;
x(): void;
u(): boolean;
s(): string;
t(): HTMLElement | null | undefined;
}

declare const renderToTemplate: (vnode: VNode, edits?: Edit[], path?: number[]) => string;
declare const renderToTemplate: (
vnode: VNode,
edits?: Edit[],
path?: number[],
) => string;

declare const firstChild$: () => any;
declare const nextSibling$: () => any;
Expand Down
22 changes: 15 additions & 7 deletions website/components/million-library/react-server.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import * as react from 'react';
import { FunctionComponent, ComponentProps } from 'react';

declare const block: (Component: FunctionComponent) => (props: ComponentProps<any>) => react.DOMElement<react.DOMAttributes<Element>, Element> | react.CElement<any, react.Component<any, any, any>>;
declare const block: (
Component: FunctionComponent,
) => (
props: ComponentProps<any>,
) =>
| react.DOMElement<react.DOMAttributes<Element>, Element>
| react.CElement<any, react.Component<any, any, any>>;
declare function For(props: {
each: any[];
children: (item: any, index: number) => any;
}): react.FunctionComponentElement<{
each: any[];
children: (item: any, index: number) => any;
}> | react.DOMElement<react.DOMAttributes<Element>, Element>;
each: any[];
children: (item: any, index: number) => any;
}):
| react.FunctionComponentElement<{
each: any[];
children: (item: any, index: number) => any;
}>
| react.DOMElement<react.DOMAttributes<Element>, Element>;

export { For, block };
28 changes: 21 additions & 7 deletions website/components/million-library/react.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,34 @@ import { B as Block } from './block-878fb9ae.js';
import { P as Props, V as VNode } from './types-35702ad2.js';

interface Options {
shouldUpdate?: (oldProps: Props, newProps: Props) => boolean;
shouldUpdate?: (oldProps: Props, newProps: Props) => boolean;
}
declare const REGISTRY: Map<(props: Props) => ReactNode, (props?: Props | null | undefined, key?: string | undefined, shouldUpdateCurrentBlock?: ((oldProps: Props, newProps: Props) => boolean) | undefined) => Block>;
declare const block: (fn: (props: Props) => ReactNode, options?: Options) => (props: Props) => react.FunctionComponentElement<{
children?: ReactNode;
declare const REGISTRY: Map<
(props: Props) => ReactNode,
(
props?: Props | null | undefined,
key?: string | undefined,
shouldUpdateCurrentBlock?:
| ((oldProps: Props, newProps: Props) => boolean)
| undefined,
) => Block
>;
declare const block: (
fn: (props: Props) => ReactNode,
options?: Options,
) => (props: Props) => react.FunctionComponentElement<{
children?: ReactNode;
}>;

interface MillionArrayProps {
each: any[];
children: (value: any, i: number) => ReactNode;
each: any[];
children: (value: any, i: number) => ReactNode;
}
declare const For: react.NamedExoticComponent<MillionArrayProps>;

declare const renderReactScope: (jsx: ReactNode) => (el: HTMLElement | null) => HTMLElement;
declare const renderReactScope: (
jsx: ReactNode,
) => (el: HTMLElement | null) => HTMLElement;
declare const unwrap: (vnode?: ReactNode) => VNode;

export { For, REGISTRY, block, renderReactScope, unwrap };
Loading