@maxio-com/react-ui-components 9.30.2 → 9.31.0
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/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/skills/maxio-react/references/patterns-side-nav.md +27 -0
- package/dist/temporary-typings/src/components/SideNav/SideNavItems/SideNavItem/SideNavItem.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/SideNav/SideNavItems/SideNavItem/SingleItem/SingleItem.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/SideNav/SideNavTopItem/SideNavTopItem.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/SideNav/contexts/types.d.ts +2 -0
- package/dist/temporary-typings/src/components/SideNav/contexts/types.d.ts.map +1 -1
- package/dist/temporary-typings/src/docs/html/normalizeHtmlForDocs.d.ts.map +1 -1
- package/package.json +2 -2
- package/typings/index.d.ts +2 -1
|
@@ -82,6 +82,10 @@ const [isOpen, setIsOpen] = React.useState(true);
|
|
|
82
82
|
/>
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
#### Collapsed logo
|
|
86
|
+
|
|
87
|
+
With `shouldToggleSidebar`, the collapsed nav shows the toggle over the logo when it's hovered, and clicking it expands the nav. On touch devices, tapping the logo follows the brand link, and keyboard users reach the brand link and the toggle separately. Opening the site switcher or a section while collapsed expands the nav first.
|
|
88
|
+
|
|
85
89
|
### Navigation Data
|
|
86
90
|
|
|
87
91
|
Use `topDropdownItems` for the site switcher and `sections` for grouped navigation lists. Each item with `isCurrent: true` renders the active page state.
|
|
@@ -137,9 +141,32 @@ interface SingleSection {
|
|
|
137
141
|
key: string;
|
|
138
142
|
isCurrent?: boolean;
|
|
139
143
|
type?: 'regular';
|
|
144
|
+
render?: LinkProps['render']; // from react-aria-components
|
|
140
145
|
}
|
|
141
146
|
```
|
|
142
147
|
|
|
148
|
+
### Client-side routing
|
|
149
|
+
|
|
150
|
+
Section links render a React Aria [`Link`](https://react-spectrum.adobe.com/react-aria/Link.html). Pass `render` on a section or sub-item to render your router's link instead of a plain `<a>`. Spread the received props (they include `ref`, `className`, `href` and `aria-current`) onto the rendered anchor.
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
import { Link as RouterLink } from 'react-router';
|
|
154
|
+
|
|
155
|
+
const sections = [
|
|
156
|
+
[
|
|
157
|
+
{
|
|
158
|
+
key: 'dashboard',
|
|
159
|
+
name: 'Dashboard',
|
|
160
|
+
icon: 'home',
|
|
161
|
+
href: '/dashboard',
|
|
162
|
+
render: ({ href, ...props }) => <RouterLink {...props} to={href} />,
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
];
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Alternatively, wrap your app in React Aria's [`RouterProvider`](https://react-spectrum.adobe.com/react-aria/routing.html) to route every section link through your router's `navigate` function.
|
|
169
|
+
|
|
143
170
|
## Imports
|
|
144
171
|
|
|
145
172
|
```tsx
|
package/dist/temporary-typings/src/components/SideNav/SideNavItems/SideNavItem/SideNavItem.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNavItem.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/SideNav/SideNavItems/SideNavItem/SideNavItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SideNavItem.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/SideNav/SideNavItems/SideNavItem/SideNavItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAKtC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAK/D,QAAA,MAAM,WAAW,GAAI,aAAa;IAAE,OAAO,EAAE,OAAO,GAAG,cAAc,CAAA;CAAE,sBAoEtE,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleItem.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/SideNav/SideNavItems/SideNavItem/SingleItem/SingleItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SingleItem.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/SideNav/SideNavItems/SideNavItem/SingleItem/SingleItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAKlD,QAAA,MAAM,UAAU,GAAI,aAAa;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,sBA4BpD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
package/dist/temporary-typings/src/components/SideNav/SideNavTopItem/SideNavTopItem.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNavTopItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components/SideNav/SideNavTopItem/SideNavTopItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,QAAA,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"SideNavTopItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components/SideNav/SideNavTopItem/SideNavTopItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,QAAA,MAAM,cAAc,yBAiBnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AnchorHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { LinkProps } from 'react-aria-components';
|
|
2
3
|
import { IconVariant } from '../../Icon';
|
|
3
4
|
export interface SideNavContext {
|
|
4
5
|
isOpen: boolean;
|
|
@@ -17,6 +18,7 @@ export interface SingleSection {
|
|
|
17
18
|
key: string;
|
|
18
19
|
isCurrent?: boolean;
|
|
19
20
|
type?: 'regular';
|
|
21
|
+
render?: LinkProps['render'];
|
|
20
22
|
}
|
|
21
23
|
export interface SingleSectionWithItems extends SingleSection {
|
|
22
24
|
isOpen?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/SideNav/contexts/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,aAAa,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,gBAAgB,EAAE,kBAAkB,CAAC;IACrC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/SideNav/contexts/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,WAAW,cAAc;IAC7B,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EAAE,YAAY,EAAE,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,kBAAkB,CAAC;IACrC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACtC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,sBAAsB,CAAC;IACjC,UAAU,EAAE,sBAAsB,EAAE,CAAC;IACrC,OAAO,EAAE,sBAAsB,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IACrF,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeHtmlForDocs.d.ts","sourceRoot":"","sources":["../../../../../src/docs/html/normalizeHtmlForDocs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,KAAK,2BAA2B,GAAG;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"normalizeHtmlForDocs.d.ts","sourceRoot":"","sources":["../../../../../src/docs/html/normalizeHtmlForDocs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,KAAK,2BAA2B,GAAG;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAqEF,eAAO,MAAM,oBAAoB,GAC/B,MAAM,MAAM,EACZ,UAAS,2BAAgC,WAmC1C,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,MAAM,MAAM,EACZ,YAAW,OAAO,MAAe,oBAWlC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxio-com/react-ui-components",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.31.0",
|
|
4
4
|
"description": "React UI components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "44d23364c0f3e3bf3a63c94ecc5c382c98ab0cd7"
|
|
69
69
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React$1, { ReactNode, HTMLAttributes, LiHTMLAttributes, ButtonHTMLAttributes, AnchorHTMLAttributes, RefObject, FC, ElementType, InputHTMLAttributes } from 'react';
|
|
2
2
|
import { RowData, Row, Table, ExpandedState, RowSelectionState, SortingState, TableOptions } from '@tanstack/react-table';
|
|
3
3
|
export { createColumnHelper } from '@tanstack/react-table';
|
|
4
|
-
import { PopoverProps as PopoverProps$1, ToggleButtonGroupProps, ToggleButtonProps, ListBoxProps as ListBoxProps$1, ListBoxLoadMoreItemProps, ListBoxItemProps as ListBoxItemProps$1, ListBoxSectionProps as ListBoxSectionProps$1, HeaderProps, ComboBoxProps as ComboBoxProps$1, ValidationResult, SearchFieldProps as SearchFieldProps$1, TextFieldProps as TextFieldProps$1, NumberFieldProps as NumberFieldProps$1, DateValue, DateFieldProps as DateFieldProps$1, CalendarProps as CalendarProps$1, DatePickerProps as DatePickerProps$1, DateRangePickerProps as DateRangePickerProps$1, RangeCalendarProps as RangeCalendarProps$1 } from 'react-aria-components';
|
|
4
|
+
import { PopoverProps as PopoverProps$1, ToggleButtonGroupProps, ToggleButtonProps, LinkProps as LinkProps$1, ListBoxProps as ListBoxProps$1, ListBoxLoadMoreItemProps, ListBoxItemProps as ListBoxItemProps$1, ListBoxSectionProps as ListBoxSectionProps$1, HeaderProps, ComboBoxProps as ComboBoxProps$1, ValidationResult, SearchFieldProps as SearchFieldProps$1, TextFieldProps as TextFieldProps$1, NumberFieldProps as NumberFieldProps$1, DateValue, DateFieldProps as DateFieldProps$1, CalendarProps as CalendarProps$1, DatePickerProps as DatePickerProps$1, DateRangePickerProps as DateRangePickerProps$1, RangeCalendarProps as RangeCalendarProps$1 } from 'react-aria-components';
|
|
5
5
|
export { DialogTrigger, Pressable } from 'react-aria-components';
|
|
6
6
|
import * as _floating_ui_react_dom_interactions from '@floating-ui/react-dom-interactions';
|
|
7
7
|
import { MotionProps } from 'framer-motion';
|
|
@@ -399,6 +399,7 @@ interface SingleSection {
|
|
|
399
399
|
key: string;
|
|
400
400
|
isCurrent?: boolean;
|
|
401
401
|
type?: 'regular';
|
|
402
|
+
render?: LinkProps$1['render'];
|
|
402
403
|
}
|
|
403
404
|
interface SingleSectionWithItems extends SingleSection {
|
|
404
405
|
isOpen?: boolean;
|