Skip to content

Commit 410f53a

Browse files
Update symbols font
1 parent 2fb73bd commit 410f53a

File tree

6 files changed

+919
-247
lines changed

6 files changed

+919
-247
lines changed
40 KB
Binary file not shown.

ts/axo/AxoButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import React, { memo, forwardRef } from 'react';
44
import type { ButtonHTMLAttributes, FC, ForwardedRef, ReactNode } from 'react';
55
import type { TailwindStyles } from './tw.js';
66
import { tw } from './tw.js';
7-
import { AxoSymbol, type AxoSymbolName } from './AxoSymbol.js';
7+
import { AxoSymbol } from './AxoSymbol.js';
88
import { assert } from './_internal/assert.js';
99

1010
const Namespace = 'AxoButton';
@@ -143,7 +143,7 @@ type AxoButtonProps = BaseButtonAttrs &
143143
Readonly<{
144144
variant: AxoButtonVariant;
145145
size: AxoButtonSize;
146-
symbol?: AxoSymbolName;
146+
symbol?: AxoSymbol.InlineGlyphName;
147147
arrow?: boolean;
148148
children: ReactNode;
149149
}>;

ts/axo/AxoSymbol.stories.tsx

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,40 @@ import React, { memo, useMemo, useState } from 'react';
44
import type { Meta } from '@storybook/react';
55
import { Direction } from 'radix-ui';
66
import Fuse from 'fuse.js';
7-
import type { AxoSymbolName } from './AxoSymbol.js';
8-
import {
9-
AxoSymbol,
10-
_getAllAxoSymbolNames,
11-
_getAxoSymbol,
12-
} from './AxoSymbol.js';
7+
import { AxoSymbol } from './AxoSymbol.js';
138
import { tw } from './tw.js';
9+
import {
10+
_getAllAxoSymbolInlineGlyphNames,
11+
getAxoSymbolInlineGlyph,
12+
} from './_internal/AxoSymbolDefs.generated.js';
1413

1514
export default {
1615
title: 'Axo/AxoSymbol',
1716
} satisfies Meta;
1817

18+
const allAxoSymbolNames = _getAllAxoSymbolInlineGlyphNames()
19+
.slice()
20+
.sort((a, b) => a.localeCompare(b));
21+
const fuse = new Fuse(allAxoSymbolNames);
22+
1923
const SymbolInfo = memo(function SymbolInfo(props: {
20-
symbolName: AxoSymbolName;
24+
symbolName: AxoSymbol.InlineGlyphName;
2125
}): JSX.Element {
22-
const ltr = _getAxoSymbol(props.symbolName, 'ltr');
23-
const rtl = _getAxoSymbol(props.symbolName, 'rtl');
26+
const ltr = getAxoSymbolInlineGlyph(props.symbolName, 'ltr');
27+
const rtl = getAxoSymbolInlineGlyph(props.symbolName, 'rtl');
2428

25-
const variants =
29+
type Variant = { title: string; dir: 'ltr' | 'rtl'; text: string };
30+
31+
const variants: ReadonlyArray<Variant> =
2632
ltr === rtl
27-
? ([
33+
? [
2834
// same
2935
{ title: 'LTR/RTL', dir: 'ltr', text: ltr },
30-
] as const)
31-
: ([
36+
]
37+
: [
3238
{ title: 'LTR', dir: 'ltr', text: ltr },
3339
{ title: 'RTL', dir: 'rtl', text: rtl },
34-
] as const);
40+
];
3541

3642
return (
3743
<figure
@@ -75,11 +81,6 @@ const SymbolInfo = memo(function SymbolInfo(props: {
7581
);
7682
});
7783

78-
const allAxoSymbolNames = _getAllAxoSymbolNames()
79-
.slice()
80-
.sort((a, b) => a.localeCompare(b));
81-
const fuse = new Fuse(allAxoSymbolNames);
82-
8384
export function All(): JSX.Element {
8485
const [input, setInput] = useState('');
8586

0 commit comments

Comments
 (0)