@iota/apps-ui-kit 0.9.3 → 0.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/index.d.ts +30 -21
- package/dist/index.es.js +2173 -2066
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +12 -12
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/lib/components/atoms/badge/Badge.tsx +13 -6
- package/src/lib/components/atoms/badge/badge.classes.ts +0 -2
- package/src/lib/components/atoms/badge/badge.enums.ts +5 -0
- package/src/lib/components/atoms/button/Button.tsx +4 -2
- package/src/lib/components/atoms/button-segment/ButtonSegment.tsx +3 -1
- package/src/lib/components/atoms/checkbox/Checkbox.tsx +3 -1
- package/src/lib/components/atoms/header/Header.tsx +2 -0
- package/src/lib/components/atoms/key-value-info/KeyValueInfo.tsx +1 -1
- package/src/lib/components/atoms/list-item/ListItem.tsx +3 -1
- package/src/lib/components/atoms/radio-button/RadioButton.tsx +3 -1
- package/src/lib/components/atoms/snackbar/Snackbar.tsx +4 -4
- package/src/lib/components/atoms/toggle/Toggle.tsx +4 -1
- package/src/lib/components/molecules/account/Account.tsx +2 -2
- package/src/lib/components/molecules/address/Address.tsx +4 -2
- package/src/lib/components/molecules/card/Card.tsx +6 -2
- package/src/lib/components/molecules/chip/Chip.tsx +11 -5
- package/src/lib/components/molecules/display-stats/DisplayStats.tsx +1 -1
- package/src/lib/components/molecules/input/Input.tsx +2 -0
- package/src/lib/components/molecules/navbar-item/NavbarItem.tsx +1 -1
- package/src/lib/components/molecules/navbar-item/NavbarItemHorizontal.tsx +3 -0
- package/src/lib/components/molecules/navbar-item/NavbarItemVertical.tsx +3 -0
- package/src/lib/components/molecules/search/Search.tsx +11 -1
- package/src/lib/components/molecules/select/Select.tsx +32 -24
- package/src/lib/components/molecules/table-header-cell/TableHeaderCell.tsx +12 -1
- package/src/lib/components/molecules/visual-asset-card/VisualAssetCard.tsx +2 -1
- package/src/lib/components/organisms/accordion/Accordion.tsx +2 -0
- package/src/lib/components/organisms/dialog/Dialog.tsx +9 -2
- package/src/lib/components/organisms/navbar/Navbar.tsx +2 -0
- package/src/lib/components/organisms/navbar/NavbarSlideout.tsx +1 -0
- package/src/lib/components/organisms/table/Table.tsx +4 -0
- package/src/lib/tailwind/base.presets.ts +42 -0
|
@@ -6,7 +6,7 @@ import cx from 'classnames';
|
|
|
6
6
|
import { Checkbox } from '@/components/atoms/checkbox';
|
|
7
7
|
import { TableHeaderCellSortOrder } from './tableHeaderCell.enums';
|
|
8
8
|
|
|
9
|
-
export interface TableHeaderCellProps {
|
|
9
|
+
export interface TableHeaderCellProps extends React.AriaAttributes {
|
|
10
10
|
/**
|
|
11
11
|
* The column key.
|
|
12
12
|
*/
|
|
@@ -68,6 +68,7 @@ export function TableHeaderCell({
|
|
|
68
68
|
onSortClick,
|
|
69
69
|
onCheckboxChange,
|
|
70
70
|
sortOrder,
|
|
71
|
+
...ariaProps
|
|
71
72
|
}: TableHeaderCellProps): JSX.Element {
|
|
72
73
|
const handleSort = () => {
|
|
73
74
|
const newSortOrder =
|
|
@@ -107,6 +108,16 @@ export function TableHeaderCell({
|
|
|
107
108
|
'cursor-pointer': hasSort,
|
|
108
109
|
},
|
|
109
110
|
)}
|
|
111
|
+
aria-sort={
|
|
112
|
+
hasSort
|
|
113
|
+
? sortOrder === TableHeaderCellSortOrder.Asc
|
|
114
|
+
? 'ascending'
|
|
115
|
+
: sortOrder === TableHeaderCellSortOrder.Desc
|
|
116
|
+
? 'descending'
|
|
117
|
+
: 'none'
|
|
118
|
+
: undefined
|
|
119
|
+
}
|
|
120
|
+
{...ariaProps}
|
|
110
121
|
>
|
|
111
122
|
<div
|
|
112
123
|
className={cx(
|
|
@@ -7,7 +7,7 @@ import cx from 'classnames';
|
|
|
7
7
|
import { AssetMediaRenderer } from '../../molecules/asset-media-renderer';
|
|
8
8
|
import type { AssetMediaRendererProps } from '../../molecules/asset-media-renderer';
|
|
9
9
|
|
|
10
|
-
interface VisualAssetBaseProps {
|
|
10
|
+
interface VisualAssetBaseProps extends React.AriaAttributes {
|
|
11
11
|
/**
|
|
12
12
|
* The onClick event for the icon.
|
|
13
13
|
*/
|
|
@@ -73,6 +73,7 @@ export function VisualAssetCard({
|
|
|
73
73
|
<ButtonUnstyled
|
|
74
74
|
className="visual-asset-icon-color absolute right-2 top-2 z-10 h-9 w-9 cursor-pointer rounded-full p-xs opacity-0 transition-opacity duration-300 group-hover:bg-shader-neutral-light-72 group-hover:opacity-100 [&_svg]:h-5 [&_svg]:w-5"
|
|
75
75
|
onClick={handleIconClick}
|
|
76
|
+
aria-label="More options"
|
|
76
77
|
>
|
|
77
78
|
{icon}
|
|
78
79
|
</ButtonUnstyled>
|
|
@@ -48,6 +48,8 @@ export function AccordionHeader({
|
|
|
48
48
|
return (
|
|
49
49
|
<div
|
|
50
50
|
onClick={onToggle}
|
|
51
|
+
role="button"
|
|
52
|
+
aria-expanded={isExpanded}
|
|
51
53
|
className={cx(
|
|
52
54
|
'state-layer relative flex cursor-pointer items-center justify-between gap-md overflow-hidden rounded-xl py-sm--rs',
|
|
53
55
|
{
|
|
@@ -42,11 +42,15 @@ const DialogOverlay = React.forwardRef<
|
|
|
42
42
|
<RadixDialog.Overlay
|
|
43
43
|
ref={ref}
|
|
44
44
|
className={cx(
|
|
45
|
-
'
|
|
45
|
+
'dialog-overlay-bg absolute h-full w-full backdrop-blur-md names:backdrop-blur-lg',
|
|
46
|
+
'data-[state=open]:animate-dialog-overlay-show',
|
|
46
47
|
)}
|
|
47
48
|
{...props}
|
|
48
49
|
>
|
|
49
|
-
<DialogClose
|
|
50
|
+
<DialogClose
|
|
51
|
+
className={cx('fixed right-3 top-3', { hidden: !showCloseIcon })}
|
|
52
|
+
aria-label="Close"
|
|
53
|
+
>
|
|
50
54
|
<Close className="button-text-color-neutral" />
|
|
51
55
|
</DialogClose>
|
|
52
56
|
</RadixDialog.Overlay>
|
|
@@ -115,6 +119,9 @@ const DialogContent = React.forwardRef<
|
|
|
115
119
|
'dialog-content-bg dialog-outline absolute flex flex-col justify-center',
|
|
116
120
|
dialogPositioning,
|
|
117
121
|
widthClass,
|
|
122
|
+
position === DialogPosition.Right
|
|
123
|
+
? 'data-[state=open]:animate-dialog-panel-show'
|
|
124
|
+
: 'data-[state=open]:animate-dialog-content-show',
|
|
118
125
|
)}
|
|
119
126
|
{...props}
|
|
120
127
|
>
|
|
@@ -61,6 +61,8 @@ export function Navbar({
|
|
|
61
61
|
<div
|
|
62
62
|
className="state-layer navbar-icon-color relative rounded-full p-xs hover:cursor-pointer sm:hidden [&_svg]:h-6 [&_svg]:w-6"
|
|
63
63
|
onClick={onToggleNavbar}
|
|
64
|
+
role="button"
|
|
65
|
+
aria-label="Toggle menu"
|
|
64
66
|
>
|
|
65
67
|
<MenuIcon />
|
|
66
68
|
</div>
|
|
@@ -119,6 +119,7 @@ export function Table({
|
|
|
119
119
|
icon={<DoubleArrowLeft />}
|
|
120
120
|
disabled={!paginationOptions.hasFirst}
|
|
121
121
|
onClick={paginationOptions.onFirst}
|
|
122
|
+
aria-label="First page"
|
|
122
123
|
/>
|
|
123
124
|
<Button
|
|
124
125
|
type={ButtonType.Secondary}
|
|
@@ -126,6 +127,7 @@ export function Table({
|
|
|
126
127
|
icon={<ArrowLeft />}
|
|
127
128
|
disabled={!paginationOptions.hasPrev}
|
|
128
129
|
onClick={paginationOptions.onPrev}
|
|
130
|
+
aria-label="Previous page"
|
|
129
131
|
/>
|
|
130
132
|
<Button
|
|
131
133
|
type={ButtonType.Secondary}
|
|
@@ -133,6 +135,7 @@ export function Table({
|
|
|
133
135
|
icon={<ArrowRight />}
|
|
134
136
|
disabled={!paginationOptions.hasNext}
|
|
135
137
|
onClick={paginationOptions.onNext}
|
|
138
|
+
aria-label="Next page"
|
|
136
139
|
/>
|
|
137
140
|
<Button
|
|
138
141
|
type={ButtonType.Secondary}
|
|
@@ -140,6 +143,7 @@ export function Table({
|
|
|
140
143
|
icon={<DoubleArrowRight />}
|
|
141
144
|
disabled={!paginationOptions.hasLast}
|
|
142
145
|
onClick={paginationOptions.onLast}
|
|
146
|
+
aria-label="Last page"
|
|
143
147
|
/>
|
|
144
148
|
</>
|
|
145
149
|
)}
|
|
@@ -53,6 +53,48 @@ export const BASE_CONFIG: Config = {
|
|
|
53
53
|
backgroundImage: {
|
|
54
54
|
...NAMES_GRADIENTS,
|
|
55
55
|
},
|
|
56
|
+
keyframes: {
|
|
57
|
+
'dialog-overlay-show': {
|
|
58
|
+
from: { opacity: '0' },
|
|
59
|
+
to: { opacity: '1' },
|
|
60
|
+
},
|
|
61
|
+
'dialog-content-show': {
|
|
62
|
+
from: {
|
|
63
|
+
opacity: '0',
|
|
64
|
+
transform: 'translate(-50%, -50%) scale(0.92)',
|
|
65
|
+
},
|
|
66
|
+
to: {
|
|
67
|
+
opacity: '1',
|
|
68
|
+
transform: 'translate(-50%, -50%) scale(1)',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
'dialog-panel-show': {
|
|
72
|
+
from: {
|
|
73
|
+
opacity: '0',
|
|
74
|
+
transform: 'translateX(12px)',
|
|
75
|
+
},
|
|
76
|
+
to: {
|
|
77
|
+
opacity: '1',
|
|
78
|
+
transform: 'translateX(0)',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
'dropdown-show': {
|
|
82
|
+
from: {
|
|
83
|
+
opacity: '0',
|
|
84
|
+
transform: 'scale(0.94)',
|
|
85
|
+
},
|
|
86
|
+
to: {
|
|
87
|
+
opacity: '1',
|
|
88
|
+
transform: 'scale(1)',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
animation: {
|
|
93
|
+
'dialog-overlay-show': 'dialog-overlay-show 170ms ease-out',
|
|
94
|
+
'dialog-content-show': 'dialog-content-show 170ms ease-out',
|
|
95
|
+
'dialog-panel-show': 'dialog-panel-show 210ms ease-out',
|
|
96
|
+
'dropdown-show': 'dropdown-show 125ms ease-out',
|
|
97
|
+
},
|
|
56
98
|
},
|
|
57
99
|
},
|
|
58
100
|
};
|