@cimpress-ui/react 1.30.0 → 1.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/commonjs/components/app-header/nav-button.d.ts.map +1 -1
- package/dist/commonjs/components/app-header/nav-button.js +3 -1
- package/dist/commonjs/components/app-header/nav-button.js.map +1 -1
- package/dist/commonjs/components/app-shell/app-shell-context.js.map +1 -1
- package/dist/commonjs/components/app-shell/app-shell.d.ts +26 -4
- package/dist/commonjs/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/commonjs/components/app-shell/app-shell.js +24 -6
- package/dist/commonjs/components/app-shell/app-shell.js.map +1 -1
- package/dist/commonjs/components/side-nav/side-nav.d.ts +36 -8
- package/dist/commonjs/components/side-nav/side-nav.d.ts.map +1 -1
- package/dist/commonjs/components/side-nav/side-nav.js +32 -12
- package/dist/commonjs/components/side-nav/side-nav.js.map +1 -1
- package/dist/commonjs/components/top-nav/top-nav.d.ts +19 -4
- package/dist/commonjs/components/top-nav/top-nav.d.ts.map +1 -1
- package/dist/commonjs/components/top-nav/top-nav.js +16 -5
- package/dist/commonjs/components/top-nav/top-nav.js.map +1 -1
- package/dist/commonjs/i18n/messages/en-US.d.ts.map +1 -1
- package/dist/commonjs/i18n/messages/en-US.js +3 -0
- package/dist/commonjs/i18n/messages/en-US.js.map +1 -1
- package/dist/commonjs/i18n/messages/types.d.ts +12 -0
- package/dist/commonjs/i18n/messages/types.d.ts.map +1 -1
- package/dist/commonjs/i18n/messages/types.js.map +1 -1
- package/dist/commonjs/index.d.ts +3 -3
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +3 -3
- package/dist/commonjs/index.js.map +1 -1
- package/dist/esm/components/app-header/nav-button.d.ts.map +1 -1
- package/dist/esm/components/app-header/nav-button.js +3 -1
- package/dist/esm/components/app-header/nav-button.js.map +1 -1
- package/dist/esm/components/app-shell/app-shell-context.js.map +1 -1
- package/dist/esm/components/app-shell/app-shell.d.ts +26 -4
- package/dist/esm/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/esm/components/app-shell/app-shell.js +24 -6
- package/dist/esm/components/app-shell/app-shell.js.map +1 -1
- package/dist/esm/components/side-nav/side-nav.d.ts +36 -8
- package/dist/esm/components/side-nav/side-nav.d.ts.map +1 -1
- package/dist/esm/components/side-nav/side-nav.js +28 -8
- package/dist/esm/components/side-nav/side-nav.js.map +1 -1
- package/dist/esm/components/top-nav/top-nav.d.ts +19 -4
- package/dist/esm/components/top-nav/top-nav.d.ts.map +1 -1
- package/dist/esm/components/top-nav/top-nav.js +14 -3
- package/dist/esm/components/top-nav/top-nav.js.map +1 -1
- package/dist/esm/i18n/messages/en-US.d.ts.map +1 -1
- package/dist/esm/i18n/messages/en-US.js +3 -0
- package/dist/esm/i18n/messages/en-US.js.map +1 -1
- package/dist/esm/i18n/messages/types.d.ts +12 -0
- package/dist/esm/i18n/messages/types.d.ts.map +1 -1
- package/dist/esm/i18n/messages/types.js.map +1 -1
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist-styles/core.css +1 -1
- package/dist-styles/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/i18n/messages/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { LocalizedStringFormatter } from 'react-aria';\n\n/**\n * Represents a localized piece of text used within a component.\n * It can either be a plain string, or a function that returns a plain string based on provided context.\n */\nexport type LocalizedString =\n | string\n | ((\n args?: Record<string, string | number | boolean>,\n formatter?: LocalizedStringFormatter<string, LocalizedString>,\n ) => string);\n\n/** A collection of localized strings used by Cimpress UI components. */\nexport type LocalizedMessages = {\n common: {\n /** An ARIA label for a button that clears the value of a field. */\n clearValue: LocalizedString;\n /** An ARIA label for a button that closes or dismisses an alert, a callout, a dialog, or other overlay component. Used for accessibility purposes to clearly indicate the button's function to screen reader users. */\n dismiss: LocalizedString;\n /** A visually hidden label that indicates a text field can be cleared by pressing the Escape key. This text is only announced by screen readers. */\n clearValueDescription: LocalizedString;\n };\n copyToClipboard: {\n /** The message displayed in a tooltip when a value is successfully copied to clipboard. */\n success: LocalizedString;\n /** The message displayed in a tooltip when a value fails to be copied to clipboard. */\n failure: LocalizedString;\n };\n label: {\n /** A visually hidden label that indicates a form field is required. This text is appended to the field's visible label and is only announced by screen readers. */\n required: LocalizedString;\n };\n datePicker: {\n /** An ARIA label for a button that clears the value of a date picker field. */\n clearValue: LocalizedString;\n /** An ARIA label for a button that opens a calendar popup. Part of a date picker. */\n openCalendar: LocalizedString;\n /** An ARIA label for a button that displays the previous month in a calendar popup. Part of a date picker. */\n previousMonth: LocalizedString;\n /** An ARIA label for a button that displays the next month in a calendar popup. Part of a date picker. */\n nextMonth: LocalizedString;\n /** An ARIA label for a button that changes the calendar popup to a single-year view. Part of a date picker. */\n switchToYearView: LocalizedString;\n /** An ARIA label for a button that displays the previous year in a calendar popup. Part of a date picker. */\n previousYear: LocalizedString;\n /** An ARIA label for a button that displays the next year in a calendar popup. Part of a date picker. */\n nextYear: LocalizedString;\n /** An ARIA label for a button that changes the calendar popup to a multi-year view. Part of a date picker. */\n switchToMultiYearView: LocalizedString;\n /** An ARIA label for a button that displays the previous section of a multi-year view in a calendar popup. Year count will always be larger than 1. Part of a date picker. */\n previousMultiYearSection: LocalizedString;\n /** An ARIA label for a button that displays the next section of a multi-year view in a calendar popup. Year count will always be larger than 1. Part of a date picker. */\n nextMultiYearSection: LocalizedString;\n };\n numberField: {\n /** An ARIA label for a button that decrements the value of a number field. */\n decrement: LocalizedString;\n /** An ARIA label for a button that increments the value of a number field. */\n increment: LocalizedString;\n };\n pagination: {\n /** An ARIA label for a button that navigates to a specific page. Part of a pagination navigation structure. */\n goToPage: LocalizedString;\n /** An ARIA label for a button that navigates to the previous page. Part of a pagination navigation structure. */\n previousPage: LocalizedString;\n /** An ARIA label for a button that navigates to the next page. Part of a pagination navigation structure. */\n nextPage: LocalizedString;\n /** A screen reader announcement for when the selected page changes. Part of a pagination navigation structure. */\n selectedPageAnnouncement: LocalizedString;\n };\n slider: {\n /** An ARIA label for a slider thumb that is used to select the start (minimum) value of a range. */\n rangeStart: LocalizedString;\n /** An ARIA label for a slider thumb that is used to select the end (maximum) value of a range. */\n rangeEnd: LocalizedString;\n };\n tagField: {\n /** A label displayed within a tag field to inform the user about the number of selected items. */\n itemsSelected: LocalizedString;\n };\n filePicker: {\n /** A label for the button that opens the native file picker dialog. */\n chooseFile: LocalizedString;\n /** A label for when no files are selected. */\n noFilesSelected: LocalizedString;\n /** A label for when multiple files are selected. */\n multipleFilesSelected: LocalizedString;\n };\n table: {\n /** An ARIA label for a spinner displayed when data is being loaded into a table. */\n loadingData: LocalizedString;\n /** An ARIA label for a button that toggles the sort order of a specific column in a data table. This label will be followed by the name of the column. */\n toggleColumnSortOrder: LocalizedString;\n };\n simpleAuthTool: {\n /** A label used for a button that redirects to a login flow. */\n logIn: LocalizedString;\n /** A label used for a button that logs the current user out. */\n logOut: LocalizedString;\n /** An ARIA label for a popover that contains information about the logged in user. */\n profileDetails: LocalizedString;\n /** A name that's displayed when the current user's name is unknown. */\n unknownUser: LocalizedString;\n };\n select: {\n /** An ARIA label for the search field displayed inside a filterable select dropdown. */\n searchLabel: LocalizedString;\n /** Placeholder text for the search field displayed inside a filterable select dropdown. */\n searchPlaceholder: LocalizedString;\n /** Message displayed when filtering a select list yields no matching options. */\n noResultsFound: LocalizedString;\n /** An ARIA label for a button that clears the current selection in a select. */\n clearSelection: LocalizedString;\n /** An ARIA label for the group of tags representing selected items in a multi-select. */\n selectedItems: LocalizedString;\n };\n UNSTABLE_collection: {\n /** An ARIA label for a spinner displayed when the list of items is first being loaded in a collection. */\n loading: LocalizedString;\n /** An ARIA label for a spinner displayed when more items are being loaded into a collection. */\n loadingMore: LocalizedString;\n /** A label displayed within a select to inform the user about the number of selected items. */\n itemsSelected: LocalizedString;\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/i18n/messages/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { LocalizedStringFormatter } from 'react-aria';\n\n/**\n * Represents a localized piece of text used within a component.\n * It can either be a plain string, or a function that returns a plain string based on provided context.\n */\nexport type LocalizedString =\n | string\n | ((\n args?: Record<string, string | number | boolean>,\n formatter?: LocalizedStringFormatter<string, LocalizedString>,\n ) => string);\n\n/** A collection of localized strings used by Cimpress UI components. */\nexport type LocalizedMessages = {\n common: {\n /** An ARIA label for a button that clears the value of a field. */\n clearValue: LocalizedString;\n /** An ARIA label for a button that closes or dismisses an alert, a callout, a dialog, or other overlay component. Used for accessibility purposes to clearly indicate the button's function to screen reader users. */\n dismiss: LocalizedString;\n /** A visually hidden label that indicates a text field can be cleared by pressing the Escape key. This text is only announced by screen readers. */\n clearValueDescription: LocalizedString;\n };\n appShell: {\n /** Label for a skip link rendered by the app shell that moves keyboard focus to the main content area. */\n skipToContent: LocalizedString;\n };\n topNav: {\n /** An ARIA label for the top navigation landmark. */\n srLabel: LocalizedString;\n };\n sideNav: {\n /** An ARIA label for the side navigation landmark. */\n srLabel: LocalizedString;\n };\n copyToClipboard: {\n /** The message displayed in a tooltip when a value is successfully copied to clipboard. */\n success: LocalizedString;\n /** The message displayed in a tooltip when a value fails to be copied to clipboard. */\n failure: LocalizedString;\n };\n label: {\n /** A visually hidden label that indicates a form field is required. This text is appended to the field's visible label and is only announced by screen readers. */\n required: LocalizedString;\n };\n datePicker: {\n /** An ARIA label for a button that clears the value of a date picker field. */\n clearValue: LocalizedString;\n /** An ARIA label for a button that opens a calendar popup. Part of a date picker. */\n openCalendar: LocalizedString;\n /** An ARIA label for a button that displays the previous month in a calendar popup. Part of a date picker. */\n previousMonth: LocalizedString;\n /** An ARIA label for a button that displays the next month in a calendar popup. Part of a date picker. */\n nextMonth: LocalizedString;\n /** An ARIA label for a button that changes the calendar popup to a single-year view. Part of a date picker. */\n switchToYearView: LocalizedString;\n /** An ARIA label for a button that displays the previous year in a calendar popup. Part of a date picker. */\n previousYear: LocalizedString;\n /** An ARIA label for a button that displays the next year in a calendar popup. Part of a date picker. */\n nextYear: LocalizedString;\n /** An ARIA label for a button that changes the calendar popup to a multi-year view. Part of a date picker. */\n switchToMultiYearView: LocalizedString;\n /** An ARIA label for a button that displays the previous section of a multi-year view in a calendar popup. Year count will always be larger than 1. Part of a date picker. */\n previousMultiYearSection: LocalizedString;\n /** An ARIA label for a button that displays the next section of a multi-year view in a calendar popup. Year count will always be larger than 1. Part of a date picker. */\n nextMultiYearSection: LocalizedString;\n };\n numberField: {\n /** An ARIA label for a button that decrements the value of a number field. */\n decrement: LocalizedString;\n /** An ARIA label for a button that increments the value of a number field. */\n increment: LocalizedString;\n };\n pagination: {\n /** An ARIA label for a button that navigates to a specific page. Part of a pagination navigation structure. */\n goToPage: LocalizedString;\n /** An ARIA label for a button that navigates to the previous page. Part of a pagination navigation structure. */\n previousPage: LocalizedString;\n /** An ARIA label for a button that navigates to the next page. Part of a pagination navigation structure. */\n nextPage: LocalizedString;\n /** A screen reader announcement for when the selected page changes. Part of a pagination navigation structure. */\n selectedPageAnnouncement: LocalizedString;\n };\n slider: {\n /** An ARIA label for a slider thumb that is used to select the start (minimum) value of a range. */\n rangeStart: LocalizedString;\n /** An ARIA label for a slider thumb that is used to select the end (maximum) value of a range. */\n rangeEnd: LocalizedString;\n };\n tagField: {\n /** A label displayed within a tag field to inform the user about the number of selected items. */\n itemsSelected: LocalizedString;\n };\n filePicker: {\n /** A label for the button that opens the native file picker dialog. */\n chooseFile: LocalizedString;\n /** A label for when no files are selected. */\n noFilesSelected: LocalizedString;\n /** A label for when multiple files are selected. */\n multipleFilesSelected: LocalizedString;\n };\n table: {\n /** An ARIA label for a spinner displayed when data is being loaded into a table. */\n loadingData: LocalizedString;\n /** An ARIA label for a button that toggles the sort order of a specific column in a data table. This label will be followed by the name of the column. */\n toggleColumnSortOrder: LocalizedString;\n };\n simpleAuthTool: {\n /** A label used for a button that redirects to a login flow. */\n logIn: LocalizedString;\n /** A label used for a button that logs the current user out. */\n logOut: LocalizedString;\n /** An ARIA label for a popover that contains information about the logged in user. */\n profileDetails: LocalizedString;\n /** A name that's displayed when the current user's name is unknown. */\n unknownUser: LocalizedString;\n };\n select: {\n /** An ARIA label for the search field displayed inside a filterable select dropdown. */\n searchLabel: LocalizedString;\n /** Placeholder text for the search field displayed inside a filterable select dropdown. */\n searchPlaceholder: LocalizedString;\n /** Message displayed when filtering a select list yields no matching options. */\n noResultsFound: LocalizedString;\n /** An ARIA label for a button that clears the current selection in a select. */\n clearSelection: LocalizedString;\n /** An ARIA label for the group of tags representing selected items in a multi-select. */\n selectedItems: LocalizedString;\n };\n UNSTABLE_collection: {\n /** An ARIA label for a spinner displayed when the list of items is first being loaded in a collection. */\n loading: LocalizedString;\n /** An ARIA label for a spinner displayed when more items are being loaded into a collection. */\n loadingMore: LocalizedString;\n /** A label displayed within a select to inform the user about the number of selected items. */\n itemsSelected: LocalizedString;\n };\n};\n"]}
|
package/dist/commonjs/index.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ export * from './components/alert/alert.js';
|
|
|
2
2
|
export * from './components/alert-dialog/alert-dialog.js';
|
|
3
3
|
export * from './components/app-header/app-header.js';
|
|
4
4
|
export * from './components/app-header/simple-auth-tool.js';
|
|
5
|
+
export * from './components/app-shell/app-shell.js';
|
|
6
|
+
export * from './components/side-nav/side-nav.js';
|
|
7
|
+
export * from './components/top-nav/top-nav.js';
|
|
5
8
|
export * from './components/badge/badge.js';
|
|
6
9
|
export * from './components/button/button.js';
|
|
7
10
|
export * from './components/button/link-button.js';
|
|
@@ -85,10 +88,7 @@ export * from './components/container/container.js';
|
|
|
85
88
|
export * from './components/stepper/stepper.js';
|
|
86
89
|
export * from './components/stepper/stepper-item.js';
|
|
87
90
|
export type { StepperStatus } from './components/stepper/types.js';
|
|
88
|
-
export * from './components/app-shell/app-shell.js';
|
|
89
|
-
export * from './components/side-nav/side-nav.js';
|
|
90
91
|
export * from './components/hidden/hidden.js';
|
|
91
|
-
export * from './components/top-nav/top-nav.js';
|
|
92
92
|
export * from './components/page-layout/page-layout.js';
|
|
93
93
|
export * from './components/nav-list/nav-list.js';
|
|
94
94
|
export * from './components/app-header/nav-button.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC;AACtD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uCAAuC,CAAC;AACtD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,6CAA6C,CAAC;AAC5D,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAC5F,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,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AC"}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -19,6 +19,9 @@ __exportStar(require("./components/alert/alert.js"), exports);
|
|
|
19
19
|
__exportStar(require("./components/alert-dialog/alert-dialog.js"), exports);
|
|
20
20
|
__exportStar(require("./components/app-header/app-header.js"), exports);
|
|
21
21
|
__exportStar(require("./components/app-header/simple-auth-tool.js"), exports);
|
|
22
|
+
__exportStar(require("./components/app-shell/app-shell.js"), exports);
|
|
23
|
+
__exportStar(require("./components/side-nav/side-nav.js"), exports);
|
|
24
|
+
__exportStar(require("./components/top-nav/top-nav.js"), exports);
|
|
22
25
|
__exportStar(require("./components/badge/badge.js"), exports);
|
|
23
26
|
__exportStar(require("./components/button/button.js"), exports);
|
|
24
27
|
__exportStar(require("./components/button/link-button.js"), exports);
|
|
@@ -95,10 +98,7 @@ __exportStar(require("./components/file-picker/file-picker.js"), exports);
|
|
|
95
98
|
__exportStar(require("./components/container/container.js"), exports);
|
|
96
99
|
__exportStar(require("./components/stepper/stepper.js"), exports);
|
|
97
100
|
__exportStar(require("./components/stepper/stepper-item.js"), exports);
|
|
98
|
-
__exportStar(require("./components/app-shell/app-shell.js"), exports);
|
|
99
|
-
__exportStar(require("./components/side-nav/side-nav.js"), exports);
|
|
100
101
|
__exportStar(require("./components/hidden/hidden.js"), exports);
|
|
101
|
-
__exportStar(require("./components/top-nav/top-nav.js"), exports);
|
|
102
102
|
__exportStar(require("./components/page-layout/page-layout.js"), exports);
|
|
103
103
|
__exportStar(require("./components/nav-list/nav-list.js"), exports);
|
|
104
104
|
__exportStar(require("./components/app-header/nav-button.js"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,4EAA0D;AAC1D,wEAAsD;AACtD,8EAA4D;AAC5D,8DAA4C;AAC5C,gEAA8C;AAC9C,qEAAmD;AACnD,qEAAmD;AACnD,0EA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D;AAClD,wEAAsD;AACtD,wEAAsD","sourcesContent":["export * from './components/alert/alert.js';\nexport * from './components/alert-dialog/alert-dialog.js';\nexport * from './components/app-header/app-header.js';\nexport * from './components/app-header/simple-auth-tool.js';\nexport * from './components/app-shell/app-shell.js';\nexport * from './components/side-nav/side-nav.js';\nexport * from './components/top-nav/top-nav.js';\nexport * from './components/badge/badge.js';\nexport * from './components/button/button.js';\nexport * from './components/button/link-button.js';\nexport * from './components/button/icon-button.js';\nexport * from './components/button/icon-link-button.js';\nexport * from './components/callout/callout.js';\nexport * from './components/card/card.js';\nexport * from './components/checkbox/checkbox.js';\nexport * from './components/checkbox/checkbox-group.js';\nexport * from './components/combo-box/combo-box.js';\nexport * from './components/code/code.js';\nexport * from './components/code-block/code-block.js';\nexport * from './components/copy/copy-button.js';\nexport * from './components/copy/copy-inline.js';\nexport * from './components/date-picker/date-picker.js';\nexport * from './components/dialog-root/dialog-root.js';\nexport * from './components/disclosure/disclosure.js';\nexport * from './components/disclosure/disclosure-group.js';\nexport type { DisclosureSize, DisclosureVariant } from './components/disclosure/context.js';\nexport * from './components/divider/divider.js';\nexport * from './components/drawer/drawer.js';\nexport * from './components/form/form.js';\nexport * from './components/link-tabs/link-tabs.js';\nexport * from './components/menu/menu.js';\nexport * from './components/modal-dialog/modal-dialog.js';\nexport * from './components/number-field/number-field.js';\nexport * from './components/pagination/pagination.js';\nexport * from './components/progress-bar/progress-bar.js';\nexport * from './components/radio/radio.js';\nexport * from './components/radio/radio-group.js';\nexport * from './components/select/select.js';\nexport * from './components/slider/slider.js';\nexport * from './components/spinner/spinner.js';\nexport * from './components/text-inputs/search-field.js';\nexport * from './components/text-inputs/text-field.js';\nexport * from './components/text-inputs/text-area.js';\nexport * from './components/breadcrumbs/breadcrumbs.js';\nexport * from './components/tooltip/tooltip.js';\nexport * from './components/popover/popover.js';\nexport * from './components/switch/switch.js';\nexport * from './components/table/table-container.js';\nexport * from './components/table/table.js';\nexport * from './components/table/table-header.js';\nexport * from './components/table/table-header-row.js';\nexport * from './components/table/table-header-cell.js';\nexport * from './components/table/table-body.js';\nexport * from './components/table/table-body-row.js';\nexport * from './components/table/table-body-cell.js';\nexport * from './components/table/table-row-selector.js';\nexport * from './components/table/table-all-rows-selector.js';\nexport * from './components/table/table-empty-state.js';\nexport type { RowSelectionMode as TableRowSelectionMode } from './components/table/contexts/table-state.js';\nexport type { ColumnContentAlignment as TableColumnContentAlignment } from './components/table/contexts/column-collection.js';\nexport * from './components/tabs/tabs.js';\nexport * from './components/tag/tag.js';\nexport * from './components/tag/tag-group.js';\nexport * from './components/tag-field/tag-field.js';\nexport * from './components/toast/toast-region.js';\nexport { toastQueue, type ToastQueue } from './components/toast/toast-queue.js';\nexport type { ToastOptions } from './components/toast/types.js';\nexport * from './components/toggle-button/toggle-button.js';\nexport * from './components/toggle-button/toggle-icon-button.js';\nexport * from './components/toggle-button/toggle-button-group.js';\nexport * from './components/file-trigger.js';\n\nexport * from './components/spacing/box/box.js';\nexport * from './components/spacing/stack/stack.js';\n\nexport * from './components/typography/text.js';\nexport * from './components/typography/link.js';\nexport * from './components/typography/list.js';\n\nexport type { ForegroundTone } from './utils/style/types.js';\n\nexport type {\n CollectionItem,\n Direction,\n FieldError,\n HoverEvent,\n Key,\n Selection,\n PressEvent,\n RouterConfig,\n Href,\n RouterOptions,\n ValidationResult,\n} from './components/types.js';\nexport type { Spacing, Responsive } from './components/spacing/types.js';\nexport type { StyleProps } from './with-style-props.js';\n\nexport * from './providers/ssr/ssr-provider.js';\nexport * from './providers/router/router-provider.js';\n\nexport * from './components/internal/x-button/x-button.js';\n\nexport * from './utils/use-is-mobile.js';\n\n// Unfinished exports below\nexport * from './components/visually-hidden/visually-hidden.js';\nexport * from './components/file-picker/file-picker.js';\nexport * from './components/container/container.js';\nexport * from './components/stepper/stepper.js';\nexport * from './components/stepper/stepper-item.js';\nexport type { StepperStatus } from './components/stepper/types.js';\nexport * from './components/hidden/hidden.js';\nexport * from './components/page-layout/page-layout.js';\nexport * from './components/nav-list/nav-list.js';\nexport * from './components/app-header/nav-button.js';\nexport * from './components/mobile-nav/mobile-nav.js';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav-button.d.ts","sourceRoot":"","sources":["../../../../src/components/app-header/nav-button.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,gCAAiC,SAAQ,WAAW;IACnE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"nav-button.d.ts","sourceRoot":"","sources":["../../../../src/components/app-header/nav-button.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,gCAAiC,SAAQ,WAAW;IACnE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAiCD,QAAA,MAAM,4BAA4B,qLAAgF,CAAC;AAEnH,OAAO,EAAE,4BAA4B,IAAI,2BAA2B,EAAE,CAAC"}
|
|
@@ -12,7 +12,9 @@ function UNSTABLE_AppHeaderNavButton({ isOpen, onPress, UNSAFE_className, UNSAFE
|
|
|
12
12
|
onPress?.();
|
|
13
13
|
appShellContext?.toggleSideNav();
|
|
14
14
|
};
|
|
15
|
-
return (_jsx(IconButton, { ...props, "aria-expanded": isOpen ??
|
|
15
|
+
return (_jsx(IconButton, { ...props, "aria-expanded": isOpen ??
|
|
16
|
+
(appShellContext?.sideNavIsCollapsible && !appShellContext?.sideNavIsCollapsed) ??
|
|
17
|
+
appShellContext?.mobileNavIsOpen, icon: _jsx(IconMenu, {}), "aria-label": "Open navigation menu", variant: "tertiary", onPress: handlePress, ref: ref, UNSAFE_className: clsx('cim-app-header-nav-toggle', UNSAFE_className), UNSAFE_style: UNSAFE_style }));
|
|
16
18
|
}
|
|
17
19
|
const _UNSTABLE_AppHeaderNavButton = withStyleProps(forwardRef(UNSTABLE_AppHeaderNavButton, 'AppHeaderNavButton'));
|
|
18
20
|
export { _UNSTABLE_AppHeaderNavButton as UNSTABLE_AppHeaderNavButton };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav-button.js","sourceRoot":"","sources":["../../../../src/components/app-header/nav-button.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAQtD,SAAS,2BAA2B,CAClC,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAoC,EAC/F,GAAoC;IAEpC,MAAM,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAEpD,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,OAAO,EAAE,EAAE,CAAC;QACZ,eAAe,EAAE,aAAa,EAAE,CAAC;IACnC,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,UAAU,OACL,KAAK,
|
|
1
|
+
{"version":3,"file":"nav-button.js","sourceRoot":"","sources":["../../../../src/components/app-header/nav-button.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAQtD,SAAS,2BAA2B,CAClC,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAoC,EAC/F,GAAoC;IAEpC,MAAM,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAEpD,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,OAAO,EAAE,EAAE,CAAC;QACZ,eAAe,EAAE,aAAa,EAAE,CAAC;IACnC,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,UAAU,OACL,KAAK,mBAEP,MAAM;YACN,CAAC,eAAe,EAAE,oBAAoB,IAAI,CAAC,eAAe,EAAE,kBAAkB,CAAC;YAC/E,eAAe,EAAE,eAAe,EAElC,IAAI,EAAE,KAAC,QAAQ,KAAG,gBAEP,sBAAsB,EACjC,OAAO,EAAC,UAAU,EAClB,OAAO,EAAE,WAAW,EACpB,GAAG,EAAE,GAAG,EACR,gBAAgB,EAAE,IAAI,CAAC,2BAA2B,EAAE,gBAAgB,CAAC,EACrE,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;AACJ,CAAC;AAED,MAAM,4BAA4B,GAAG,cAAc,CAAC,UAAU,CAAC,2BAA2B,EAAE,oBAAoB,CAAC,CAAC,CAAC;AAEnH,OAAO,EAAE,4BAA4B,IAAI,2BAA2B,EAAE,CAAC","sourcesContent":["import clsx from 'clsx';\nimport { useContext, type ForwardedRef } from 'react';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconMenu } from '../../icons/index.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { AppShellContext } from '../app-shell/app-shell-context.js';\nimport { IconButton } from '../button/icon-button.js';\nimport type { CommonProps } from '../types.js';\n\nexport interface UNSTABLE_AppHeaderNavButtonProps extends CommonProps {\n isOpen?: boolean;\n onPress?: () => void;\n}\n\nfunction UNSTABLE_AppHeaderNavButton(\n { isOpen, onPress, UNSAFE_className, UNSAFE_style, ...props }: UNSTABLE_AppHeaderNavButtonProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) {\n const appShellContext = useContext(AppShellContext);\n\n const handlePress = () => {\n onPress?.();\n appShellContext?.toggleSideNav();\n };\n\n return (\n <IconButton\n {...props}\n aria-expanded={\n isOpen ??\n (appShellContext?.sideNavIsCollapsible && !appShellContext?.sideNavIsCollapsed) ??\n appShellContext?.mobileNavIsOpen\n }\n icon={<IconMenu />}\n // TODO\n aria-label=\"Open navigation menu\"\n variant=\"tertiary\"\n onPress={handlePress}\n ref={ref}\n UNSAFE_className={clsx('cim-app-header-nav-toggle', UNSAFE_className)}\n UNSAFE_style={UNSAFE_style}\n />\n );\n}\n\nconst _UNSTABLE_AppHeaderNavButton = withStyleProps(forwardRef(UNSTABLE_AppHeaderNavButton, 'AppHeaderNavButton'));\n\nexport { _UNSTABLE_AppHeaderNavButton as UNSTABLE_AppHeaderNavButton };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-shell-context.js","sourceRoot":"","sources":["../../../../src/components/app-shell/app-shell-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,gBAAgB;AAChB,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"app-shell-context.js","sourceRoot":"","sources":["../../../../src/components/app-shell/app-shell-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,gBAAgB;AAChB,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAUlC,IAAI,CAAC,CAAC","sourcesContent":["import { createContext } from 'react';\n\n/** @internal */\nexport const AppShellContext = createContext<{\n mobileNavIsOpen: boolean;\n toggleMobileNav: (isOpen?: boolean) => void;\n sideNavIsCollapsed: boolean | undefined;\n toggleSideNavCollapse: (isCollapsed?: boolean) => void;\n sideNavIsCollapsible: boolean;\n setSideNavIsCollapsible: (isCollapsible: boolean) => void;\n toggleSideNav: () => void;\n /** ID of the main content area targeted by the skip link. */\n mainContentId: string;\n} | null>(null);\n"]}
|
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import type { CommonProps } from '../types.js';
|
|
3
|
-
export interface
|
|
3
|
+
export interface AppShellProps extends CommonProps {
|
|
4
|
+
/**
|
|
5
|
+
* The children of the app shell should be composed using specific components to fill the available layout slots:
|
|
6
|
+
* - `<AppHeader />` for the global header
|
|
7
|
+
* - `<SideNav />` for the side navigation
|
|
8
|
+
* - `<TopNav />` for the top navigation bar
|
|
9
|
+
* - `<AppShellBody />` for the main content area
|
|
10
|
+
*
|
|
11
|
+
* These components should be passed as direct children to correctly populate the app shell layout.
|
|
12
|
+
*/
|
|
4
13
|
children: ReactNode;
|
|
5
14
|
}
|
|
6
|
-
|
|
7
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Provides the foundational layout structure for applications, including header, navigation, and main content slots.
|
|
17
|
+
*
|
|
18
|
+
* See [app shell usage guidelines](https://ui.cimpress.io/components/app-shell/).
|
|
19
|
+
*/
|
|
20
|
+
export declare function AppShell({ children, UNSAFE_className, UNSAFE_style, ...props }: AppShellProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare namespace AppShell {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
24
|
+
export interface AppShellBodyProps extends Omit<CommonProps, 'id'> {
|
|
25
|
+
/** Main content area of the app shell. */
|
|
8
26
|
children: ReactNode;
|
|
9
27
|
}
|
|
10
|
-
|
|
28
|
+
/** Renders the main content area within `AppShell`. */
|
|
29
|
+
export declare function AppShellBody({ children, UNSAFE_className, UNSAFE_style, ...props }: AppShellBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare namespace AppShellBody {
|
|
31
|
+
var displayName: string;
|
|
32
|
+
}
|
|
11
33
|
//# sourceMappingURL=app-shell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-shell.d.ts","sourceRoot":"","sources":["../../../../src/components/app-shell/app-shell.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-shell.d.ts","sourceRoot":"","sources":["../../../../src/components/app-shell/app-shell.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD;;;;;;;;OAQG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,2CA2C7F;yBA3Ce,QAAQ;;;AA8CxB,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC;IAChE,0CAA0C;IAC1C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,uDAAuD;AACvD,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,2CASrG;yBATe,YAAY"}
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import clsx from 'clsx';
|
|
3
|
-
import { useCallback, useState } from 'react';
|
|
4
|
+
import { useCallback, useContext, useState } from 'react';
|
|
5
|
+
import { useId } from 'react-aria';
|
|
6
|
+
import { useLocalizedMessages } from '../../i18n/index.js';
|
|
4
7
|
import { matchesBreakpoint } from '../../utils/breakpoints.js';
|
|
8
|
+
import { LinkButton } from '../button/link-button.js';
|
|
9
|
+
import { UNSTABLE_VisuallyHidden as VisuallyHidden } from '../visually-hidden/visually-hidden.js';
|
|
5
10
|
import { AppShellContext } from './app-shell-context.js';
|
|
6
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Provides the foundational layout structure for applications, including header, navigation, and main content slots.
|
|
13
|
+
*
|
|
14
|
+
* See [app shell usage guidelines](https://ui.cimpress.io/components/app-shell/).
|
|
15
|
+
*/
|
|
16
|
+
export function AppShell({ children, UNSAFE_className, UNSAFE_style, ...props }) {
|
|
17
|
+
const messages = useLocalizedMessages('appShell');
|
|
18
|
+
const mainContentId = 'app-shell-body-' + useId();
|
|
7
19
|
const [sideNavIsCollapsible, setSideNavIsCollapsible] = useState(false);
|
|
8
20
|
const [mobileNavIsOpen, setMobileNavIsOpen] = useState(false);
|
|
9
21
|
const toggleMobileNav = useCallback((isOpen) => {
|
|
@@ -29,9 +41,15 @@ export function UNSTABLE_AppShell({ children, UNSAFE_className, UNSAFE_style, ..
|
|
|
29
41
|
sideNavIsCollapsed,
|
|
30
42
|
toggleSideNavCollapse,
|
|
31
43
|
toggleSideNav,
|
|
32
|
-
|
|
44
|
+
mainContentId,
|
|
45
|
+
}, children: _jsxs("div", { ...props, className: clsx('cim-app-shell', UNSAFE_className), style: UNSAFE_style, children: [_jsx(VisuallyHidden, { showWhenFocused: true, UNSAFE_className: "cim-app-shell-skip-link", children: _jsx(LinkButton, { href: `#${encodeURIComponent(mainContentId)}`, target: "_self", variant: "secondary", size: "small", children: messages.format('skipToContent') }) }), children] }) }));
|
|
33
46
|
}
|
|
34
|
-
|
|
35
|
-
|
|
47
|
+
AppShell.displayName = 'AppShell';
|
|
48
|
+
/** Renders the main content area within `AppShell`. */
|
|
49
|
+
export function AppShellBody({ children, UNSAFE_className, UNSAFE_style, ...props }) {
|
|
50
|
+
const appShellContext = useContext(AppShellContext);
|
|
51
|
+
const mainContentId = appShellContext?.mainContentId;
|
|
52
|
+
return (_jsx("div", { ...props, id: mainContentId, className: clsx('cim-app-shell-body', UNSAFE_className), style: UNSAFE_style, children: children }));
|
|
36
53
|
}
|
|
54
|
+
AppShellBody.displayName = 'AppShellBody';
|
|
37
55
|
//# sourceMappingURL=app-shell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-shell.js","sourceRoot":"","sources":["../../../../src/components/app-shell/app-shell.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-shell.js","sourceRoot":"","sources":["../../../../src/components/app-shell/app-shell.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,uBAAuB,IAAI,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAezD;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAiB;IAC5F,MAAM,QAAQ,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAClD,MAAM,aAAa,GAAG,iBAAiB,GAAG,KAAK,EAAE,CAAC;IAClD,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxE,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,eAAe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MAAM,CAAC,eAAe,CAAC,GACtB,GACE,EAChB,QAAQ,IACL,GACmB,CAC5B,CAAC;AACJ,CAAC;AACD,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAOlC,uDAAuD;AACvD,MAAM,UAAU,YAAY,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAqB;IACpG,MAAM,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IACpD,MAAM,aAAa,GAAG,eAAe,EAAE,aAAa,CAAC;IAErD,OAAO,CACL,iBAAS,KAAK,EAAE,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,YAC5G,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AACD,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useCallback, useContext, useState, type ReactNode } from 'react';\nimport { useId } from 'react-aria';\nimport { useLocalizedMessages } from '../../i18n/index.js';\nimport { matchesBreakpoint } from '../../utils/breakpoints.js';\nimport { LinkButton } from '../button/link-button.js';\nimport type { CommonProps } from '../types.js';\nimport { UNSTABLE_VisuallyHidden as VisuallyHidden } from '../visually-hidden/visually-hidden.js';\nimport { AppShellContext } from './app-shell-context.js';\n\nexport interface AppShellProps extends CommonProps {\n /**\n * The children of the app shell should be composed using specific components to fill the available layout slots:\n * - `<AppHeader />` for the global header\n * - `<SideNav />` for the side navigation\n * - `<TopNav />` for the top navigation bar\n * - `<AppShellBody />` for the main content area\n *\n * These components should be passed as direct children to correctly populate the app shell layout.\n */\n children: ReactNode;\n}\n\n/**\n * Provides the foundational layout structure for applications, including header, navigation, and main content slots.\n *\n * See [app shell usage guidelines](https://ui.cimpress.io/components/app-shell/).\n */\nexport function AppShell({ children, UNSAFE_className, UNSAFE_style, ...props }: AppShellProps) {\n const messages = useLocalizedMessages('appShell');\n const mainContentId = 'app-shell-body-' + useId();\n const [sideNavIsCollapsible, setSideNavIsCollapsible] = useState(false);\n const [mobileNavIsOpen, setMobileNavIsOpen] = useState(false);\n const toggleMobileNav = useCallback((isOpen?: boolean) => {\n setMobileNavIsOpen((prevIsOpen) => isOpen ?? !prevIsOpen);\n }, []);\n const [sideNavIsCollapsed, setSideNavIsCollapsed] = useState<boolean | undefined>(undefined);\n const toggleSideNavCollapse = useCallback((isCollapsed?: boolean) => {\n setSideNavIsCollapsed((prevIsCollapsed) => isCollapsed ?? !prevIsCollapsed);\n }, []);\n const toggleSideNav = useCallback(() => {\n if (sideNavIsCollapsible && matchesBreakpoint({ min: 'md' })) {\n toggleSideNavCollapse();\n } else {\n toggleMobileNav();\n }\n }, [sideNavIsCollapsible, toggleMobileNav, toggleSideNavCollapse]);\n\n return (\n <AppShellContext.Provider\n value={{\n sideNavIsCollapsible,\n setSideNavIsCollapsible,\n mobileNavIsOpen,\n toggleMobileNav,\n sideNavIsCollapsed,\n toggleSideNavCollapse,\n toggleSideNav,\n mainContentId,\n }}\n >\n <div {...props} className={clsx('cim-app-shell', UNSAFE_className)} style={UNSAFE_style}>\n <VisuallyHidden showWhenFocused UNSAFE_className=\"cim-app-shell-skip-link\">\n <LinkButton href={`#${encodeURIComponent(mainContentId)}`} target=\"_self\" variant=\"secondary\" size=\"small\">\n {messages.format('skipToContent')}\n </LinkButton>\n </VisuallyHidden>\n {children}\n </div>\n </AppShellContext.Provider>\n );\n}\nAppShell.displayName = 'AppShell';\n\nexport interface AppShellBodyProps extends Omit<CommonProps, 'id'> {\n /** Main content area of the app shell. */\n children: ReactNode;\n}\n\n/** Renders the main content area within `AppShell`. */\nexport function AppShellBody({ children, UNSAFE_className, UNSAFE_style, ...props }: AppShellBodyProps) {\n const appShellContext = useContext(AppShellContext);\n const mainContentId = appShellContext?.mainContentId;\n\n return (\n <div {...props} id={mainContentId} className={clsx('cim-app-shell-body', UNSAFE_className)} style={UNSAFE_style}>\n {children}\n </div>\n );\n}\nAppShellBody.displayName = 'AppShellBody';\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import type { Href, StringLikeChildren } from '../types.js';
|
|
3
|
-
export interface
|
|
3
|
+
export interface SideNavProps {
|
|
4
|
+
/** The contents of the side navigation. Typically a `<SideNavList>`. */
|
|
4
5
|
children: ReactNode;
|
|
5
6
|
/**
|
|
6
7
|
* Determines if the side navigation can be collapsed down to an icon-only rail, allowing for more screen space when needed.
|
|
@@ -16,21 +17,48 @@ export interface UNSTABLE_SideNavProps {
|
|
|
16
17
|
onCollapseChange?: (isCollapsed: boolean) => void;
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Displays persistent side navigation for applications with multiple sections or pages.
|
|
22
|
+
*
|
|
23
|
+
* See [side nav usage guidelines](https://ui.cimpress.io/components/side-nav/).
|
|
24
|
+
*/
|
|
25
|
+
export declare function SideNav({ children, UNSTABLE_isCollapsible: isCollapsible }: SideNavProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare namespace SideNav {
|
|
27
|
+
var displayName: string;
|
|
28
|
+
}
|
|
29
|
+
export interface SideNavListProps {
|
|
30
|
+
/** Navigation items and sections belonging to the list. */
|
|
21
31
|
children: ReactNode;
|
|
22
32
|
}
|
|
23
|
-
|
|
24
|
-
export
|
|
33
|
+
/** Renders a list of navigation items within `SideNav`. */
|
|
34
|
+
export declare function SideNavList({ children }: SideNavListProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare namespace SideNavList {
|
|
36
|
+
var displayName: string;
|
|
37
|
+
}
|
|
38
|
+
export interface SideNavListItemProps {
|
|
39
|
+
/** The text to display as the navigation item label. */
|
|
25
40
|
children: StringLikeChildren;
|
|
41
|
+
/** A URL to link to. */
|
|
26
42
|
href: Href;
|
|
43
|
+
/** Whether the navigation item represents the current page. */
|
|
27
44
|
isActive?: boolean;
|
|
45
|
+
/** An icon displayed before the navigation item label. Required when the side nav is collapsible. */
|
|
28
46
|
icon?: ReactNode;
|
|
29
47
|
}
|
|
30
|
-
|
|
31
|
-
export
|
|
48
|
+
/** Renders a single navigation item within `SideNavList`. */
|
|
49
|
+
export declare function SideNavListItem({ children, href, isActive, icon }: SideNavListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export declare namespace SideNavListItem {
|
|
51
|
+
var displayName: string;
|
|
52
|
+
}
|
|
53
|
+
export interface SideNavListSectionProps {
|
|
54
|
+
/** Navigation items belonging to the section. */
|
|
32
55
|
children: ReactNode;
|
|
56
|
+
/** The content to display as the section title. */
|
|
33
57
|
label?: string;
|
|
34
58
|
}
|
|
35
|
-
|
|
59
|
+
/** Renders a section of navigation items within `SideNavList`. */
|
|
60
|
+
export declare function SideNavListSection({ children, label }: SideNavListSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
export declare namespace SideNavListSection {
|
|
62
|
+
var displayName: string;
|
|
63
|
+
}
|
|
36
64
|
//# sourceMappingURL=side-nav.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side-nav.d.ts","sourceRoot":"","sources":["../../../../src/components/side-nav/side-nav.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"side-nav.d.ts","sourceRoot":"","sources":["../../../../src/components/side-nav/side-nav.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAS1E,OAAO,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAQ5D,MAAM,WAAW,YAAY;IAC3B,wEAAwE;IACxE,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,sBAAsB,CAAC,EACnB,OAAO,GACP;QACE,yFAAyF;QACzF,gBAAgB,CAAC,EAAE,IAAI,CAAC;QACxB,qHAAqH;QACrH,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,mFAAmF;QACnF,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;KACnD,CAAC;CACP;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE,sBAAsB,EAAE,aAAa,EAAE,EAAE,YAAY,2CAwBxF;yBAxBe,OAAO;;;AA4FvB,MAAM,WAAW,gBAAgB;IAC/B,2DAA2D;IAC3D,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,2DAA2D;AAC3D,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE,gBAAgB,2CAEzD;yBAFe,WAAW;;;AAK3B,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,wBAAwB;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qGAAqG;IACrG,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,6DAA6D;AAC7D,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,oBAAoB,2CAavF;yBAbe,eAAe;;;AAgB/B,MAAM,WAAW,uBAAuB;IACtC,iDAAiD;IACjD,QAAQ,EAAE,SAAS,CAAC;IACpB,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,kEAAkE;AAClE,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,uBAAuB,2CAa9E;yBAbe,kBAAkB"}
|
|
@@ -4,6 +4,7 @@ import { useEffectEvent, useLayoutEffect } from '@react-aria/utils';
|
|
|
4
4
|
import { createContext, useContext, useRef } from 'react';
|
|
5
5
|
import { useOverlay } from 'react-aria';
|
|
6
6
|
import { Link as RACLink } from 'react-aria-components';
|
|
7
|
+
import { useLocalizedMessages } from '../../i18n/index.js';
|
|
7
8
|
import { matchesBreakpoint, useBreakpoint } from '../../utils/breakpoints.js';
|
|
8
9
|
import { stringLikeChildrenToString } from '../../utils/string-like-children-to-string.js';
|
|
9
10
|
import { AppShellContext } from '../app-shell/app-shell-context.js';
|
|
@@ -11,14 +12,24 @@ import { UNSTABLE_MobileNav as MobileNav } from '../mobile-nav/mobile-nav.js';
|
|
|
11
12
|
import { Tooltip } from '../tooltip/tooltip.js';
|
|
12
13
|
import { Text } from '../typography/text.js';
|
|
13
14
|
const SideNavContext = createContext({ isCollapsed: false });
|
|
14
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Displays persistent side navigation for applications with multiple sections or pages.
|
|
17
|
+
*
|
|
18
|
+
* See [side nav usage guidelines](https://ui.cimpress.io/components/side-nav/).
|
|
19
|
+
*/
|
|
20
|
+
export function SideNav({ children, UNSTABLE_isCollapsible: isCollapsible }) {
|
|
15
21
|
const appShellContext = useContext(AppShellContext);
|
|
16
22
|
useLayoutEffect(() => {
|
|
17
23
|
appShellContext?.setSideNavIsCollapsible(typeof isCollapsible === 'object' || isCollapsible || false);
|
|
18
24
|
}, [isCollapsible, appShellContext]);
|
|
19
|
-
return (_jsxs(_Fragment, { children: [_jsx(SideNavInner, { UNSTABLE_isCollapsible: isCollapsible, children: children }), appShellContext && (_jsx(MobileNav, { isOpen: appShellContext.mobileNavIsOpen, onOpenChange: () => appShellContext.toggleMobileNav(false), children:
|
|
25
|
+
return (_jsxs(_Fragment, { children: [_jsx(SideNavInner, { UNSTABLE_isCollapsible: isCollapsible, children: children }), appShellContext && (_jsx(MobileNav, { isOpen: appShellContext.mobileNavIsOpen, onOpenChange: () => appShellContext.toggleMobileNav(false), children: _jsx(SideNavContext.Provider, { value: {
|
|
26
|
+
isCollapsed: false,
|
|
27
|
+
onItemSelect: () => appShellContext.toggleMobileNav(false),
|
|
28
|
+
}, children: children }) }))] }));
|
|
20
29
|
}
|
|
30
|
+
SideNav.displayName = 'SideNav';
|
|
21
31
|
function SideNavInner({ children, UNSTABLE_isCollapsible: isCollapsible }) {
|
|
32
|
+
const messages = useLocalizedMessages('sideNav');
|
|
22
33
|
const appShellContext = useContext(AppShellContext);
|
|
23
34
|
const sideNavRef = useRef(null);
|
|
24
35
|
const isOverlaySideNav = useBreakpoint({ max: 'md' }) && isCollapsible !== false;
|
|
@@ -51,16 +62,25 @@ function SideNavInner({ children, UNSTABLE_isCollapsible: isCollapsible }) {
|
|
|
51
62
|
useLayoutEffect(() => {
|
|
52
63
|
resetState();
|
|
53
64
|
}, [isOverlaySideNav]);
|
|
54
|
-
return (_jsx(SideNavContext.Provider, { value: {
|
|
65
|
+
return (_jsx(SideNavContext.Provider, { value: {
|
|
66
|
+
isCollapsed: isCollapsed ?? false,
|
|
67
|
+
onItemSelect: isOverlaySideNav ? handleClose : undefined,
|
|
68
|
+
}, children: _jsx("div", { ...(isOverlaySideNav ? overlayProps : {}), className: "cim-side-nav", "data-collapsible": typeof isCollapsible === 'object' ? true : isCollapsible || false, "data-collapsed": isCollapsed, "aria-label": messages.format('srLabel'), ref: sideNavRef, children: _jsx("div", { className: "cim-side-nav-panel", children: children }) }) }));
|
|
55
69
|
}
|
|
56
|
-
|
|
70
|
+
/** Renders a list of navigation items within `SideNav`. */
|
|
71
|
+
export function SideNavList({ children }) {
|
|
57
72
|
return _jsx("nav", { className: "cim-side-nav-list", children: children });
|
|
58
73
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
74
|
+
SideNavList.displayName = 'SideNavList';
|
|
75
|
+
/** Renders a single navigation item within `SideNavList`. */
|
|
76
|
+
export function SideNavListItem({ children, href, isActive, icon }) {
|
|
77
|
+
const { isCollapsed, onItemSelect } = useContext(SideNavContext);
|
|
78
|
+
return (_jsx(Tooltip, { label: stringLikeChildrenToString(children), placement: "right", isDisabled: !isCollapsed, children: _jsxs(RACLink, { href: href, className: "cim-side-nav-list-item", "data-active": isActive, onPress: onItemSelect, children: [icon, _jsx(Text, { as: "span", variant: "medium", UNSAFE_className: "cim-side-nav-list-item-label", children: children })] }) }));
|
|
62
79
|
}
|
|
63
|
-
|
|
80
|
+
SideNavListItem.displayName = 'SideNavListItem';
|
|
81
|
+
/** Renders a section of navigation items within `SideNavList`. */
|
|
82
|
+
export function SideNavListSection({ children, label }) {
|
|
64
83
|
return (_jsxs("div", { className: "cim-side-nav-list-section", children: [label && (_jsx("div", { className: "cim-side-nav-list-section-header", children: _jsx(Text, { as: "p", variant: "small-semibold", tone: "subtle", UNSAFE_className: "cim-side-nav-list-section-header-label", children: label }) })), children] }));
|
|
65
84
|
}
|
|
85
|
+
SideNavListSection.displayName = 'SideNavListSection';
|
|
66
86
|
//# sourceMappingURL=side-nav.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side-nav.js","sourceRoot":"","sources":["../../../../src/components/side-nav/side-nav.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,MAAM,cAAc,GAAG,aA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YAC1G,KAAK,GACD,GACH,CACP,EACA,QAAQ,IACL,CACP,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport { useEffectEvent, useLayoutEffect } from '@react-aria/utils';\nimport { createContext, useContext, useRef, type ReactNode } from 'react';\nimport { useOverlay } from 'react-aria';\nimport { Link as RACLink } from 'react-aria-components';\nimport { matchesBreakpoint, useBreakpoint } from '../../utils/breakpoints.js';\nimport { stringLikeChildrenToString } from '../../utils/string-like-children-to-string.js';\nimport { AppShellContext } from '../app-shell/app-shell-context.js';\nimport { UNSTABLE_MobileNav as MobileNav } from '../mobile-nav/mobile-nav.js';\nimport { Tooltip } from '../tooltip/tooltip.js';\nimport type { Href, StringLikeChildren } from '../types.js';\nimport { Text } from '../typography/text.js';\n\nconst SideNavContext = createContext<{ isCollapsed: boolean }>({ isCollapsed: false });\n\nexport interface UNSTABLE_SideNavProps {\n children: ReactNode;\n /**\n * Determines if the side navigation can be collapsed down to an icon-only rail, allowing for more screen space when needed.\n *\n * Setting to `true` will enable collapsibility. Passing an object allows for more advanced configuration, including fully controlled usage outside app shell context.\n */\n UNSTABLE_isCollapsible?:\n | boolean\n | {\n /** Whether the side nav should be collapsed by default. Only affects large viewports. */\n defaultCollapsed?: true;\n /** Whether the side nav is currently collapsed. Only needed when the side nav is not controlled by the app shell. */\n isCollapsed?: boolean;\n /** Callback function that is called when the side nav is collapsed or expanded. */\n onCollapseChange?: (isCollapsed: boolean) => void;\n };\n}\n\nexport function UNSTABLE_SideNav({ children, UNSTABLE_isCollapsible: isCollapsible }: UNSTABLE_SideNavProps) {\n const appShellContext = useContext(AppShellContext);\n\n useLayoutEffect(() => {\n appShellContext?.setSideNavIsCollapsible(typeof isCollapsible === 'object' || isCollapsible || false);\n }, [isCollapsible, appShellContext]);\n\n return (\n <>\n <SideNavInner UNSTABLE_isCollapsible={isCollapsible}>{children}</SideNavInner>\n {appShellContext && (\n <MobileNav isOpen={appShellContext.mobileNavIsOpen} onOpenChange={() => appShellContext.toggleMobileNav(false)}>\n {children}\n </MobileNav>\n )}\n </>\n );\n}\n\nfunction SideNavInner({ children, UNSTABLE_isCollapsible: isCollapsible }: UNSTABLE_SideNavProps) {\n const appShellContext = useContext(AppShellContext);\n const sideNavRef = useRef<HTMLDivElement>(null);\n const isOverlaySideNav = useBreakpoint({ max: 'md' }) && isCollapsible !== false;\n const isCollapsed =\n typeof isCollapsible === 'object'\n ? (isCollapsible.isCollapsed ?? appShellContext?.sideNavIsCollapsed ?? isCollapsible.defaultCollapsed)\n : isCollapsible\n ? appShellContext?.sideNavIsCollapsed\n : undefined;\n\n function handleClose() {\n appShellContext?.toggleSideNavCollapse(true);\n\n if (typeof isCollapsible === 'object') {\n isCollapsible.onCollapseChange?.(true);\n }\n }\n\n const { overlayProps } = useOverlay(\n {\n isDismissable: isOverlaySideNav,\n isOpen: isOverlaySideNav && isCollapsed !== undefined ? !isCollapsed : undefined,\n onClose: () => handleClose(),\n },\n sideNavRef,\n );\n\n const resetState = useEffectEvent(() => {\n if (typeof isCollapsible === 'object' || isCollapsible) {\n const defaultIsCollapsed = typeof isCollapsible === 'object' ? isCollapsible.defaultCollapsed : false;\n appShellContext?.toggleSideNavCollapse(defaultIsCollapsed || matchesBreakpoint({ max: 'md' }));\n if (typeof isCollapsible === 'object') {\n isCollapsible.onCollapseChange?.(defaultIsCollapsed || matchesBreakpoint({ max: 'md' }));\n }\n }\n });\n\n // Hydrate state and reset when screen size changes to or from overlay mode\n useLayoutEffect(() => {\n resetState();\n }, [isOverlaySideNav]);\n\n return (\n <SideNavContext.Provider value={{ isCollapsed: isCollapsed ?? false }}>\n <div\n {...(isOverlaySideNav ? overlayProps : {})}\n className=\"cim-side-nav\"\n data-collapsible={typeof isCollapsible === 'object' ? true : isCollapsible || false}\n data-collapsed={isCollapsed}\n aria-label=\"Side navigation\"\n ref={sideNavRef}\n >\n <div className=\"cim-side-nav-panel\">{children}</div>\n </div>\n </SideNavContext.Provider>\n );\n}\n\nexport interface UNSTABLE_SideNavListProps {\n children: ReactNode;\n}\n\nexport function UNSTABLE_SideNavList({ children }: UNSTABLE_SideNavListProps) {\n return <nav className=\"cim-side-nav-list\">{children}</nav>;\n}\n\nexport interface UNSTABLE_SideNavListItemProps {\n children: StringLikeChildren;\n href: Href;\n isActive?: boolean;\n icon?: ReactNode;\n}\n\nexport function UNSTABLE_SideNavListItem({ children, href, isActive, icon }: UNSTABLE_SideNavListItemProps) {\n const { isCollapsed } = useContext(SideNavContext);\n\n return (\n <Tooltip label={stringLikeChildrenToString(children)} placement=\"right\" isDisabled={!isCollapsed}>\n <RACLink href={href} className=\"cim-side-nav-list-item\" data-active={isActive}>\n {icon}\n <Text as=\"span\" variant=\"medium\" UNSAFE_className=\"cim-side-nav-list-item-label\">\n {children}\n </Text>\n </RACLink>\n </Tooltip>\n );\n}\n\nexport interface UNSTABLE_SideNavListSectionProps {\n children: ReactNode;\n label?: string;\n}\n\nexport function UNSTABLE_SideNavListSection({ children, label }: UNSTABLE_SideNavListSectionProps) {\n return (\n <div className=\"cim-side-nav-list-section\">\n {label && (\n <div className=\"cim-side-nav-list-section-header\">\n <Text as=\"p\" variant=\"small-semibold\" tone=\"subtle\" UNSAFE_className=\"cim-side-nav-list-section-header-label\">\n {label}\n </Text>\n </div>\n )}\n {children}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"side-nav.js","sourceRoot":"","sources":["../../../../src/components/side-nav/side-nav.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,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,eAAe,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAwB;IACtF,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAEjE,OAAO,CACL,KAAC,OAAO,IAAC,KAAK,EAAE,0BAA0B,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAC,OAAO,EAAC,UAAU,EAAE,CAAC,WAAW,YAC9F,MAAC,OAAO,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAC,wBAAwB,iBAAc,QAAQ,EAAE,OAAO,EAAE,YAAY,aACjG,IAAI,EACL,KAAC,IAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,QAAQ,EAAC,gBAAgB,EAAC,8BAA8B,YAC7E,QAAQ,GACJ,IACC,GACF,CACX,CAAC;AACJ,CAAC;AACD,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC;AAShD,kEAAkE;AAClE,MAAM,UAAU,kBAAkB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAA2B;IAC7E,OAAO,CACL,eAAK,SAAS,EAAC,2BAA2B,aACvC,KAAK,IAAI,CACR,cAAK,SAAS,EAAC,kCAAkC,YAC/C,KAAC,IAAI,IAAC,EAAE,EAAC,GAAG,EAAC,OAAO,EAAC,gBAAgB,EAAC,IAAI,EAAC,QAAQ,EAAC,gBAAgB,EAAC,wCAAwC,YAC1G,KAAK,GACD,GACH,CACP,EACA,QAAQ,IACL,CACP,CAAC;AACJ,CAAC;AACD,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC","sourcesContent":["'use client';\n\nimport { useEffectEvent, useLayoutEffect } from '@react-aria/utils';\nimport { createContext, useContext, useRef, type ReactNode } from 'react';\nimport { useOverlay } from 'react-aria';\nimport { Link as RACLink } from 'react-aria-components';\nimport { useLocalizedMessages } from '../../i18n/index.js';\nimport { matchesBreakpoint, useBreakpoint } from '../../utils/breakpoints.js';\nimport { stringLikeChildrenToString } from '../../utils/string-like-children-to-string.js';\nimport { AppShellContext } from '../app-shell/app-shell-context.js';\nimport { UNSTABLE_MobileNav as MobileNav } from '../mobile-nav/mobile-nav.js';\nimport { Tooltip } from '../tooltip/tooltip.js';\nimport type { Href, StringLikeChildren } from '../types.js';\nimport { Text } from '../typography/text.js';\n\nconst SideNavContext = createContext<{\n isCollapsed: boolean;\n onItemSelect?: () => void;\n}>({ isCollapsed: false });\n\nexport interface SideNavProps {\n /** The contents of the side navigation. Typically a `<SideNavList>`. */\n children: ReactNode;\n /**\n * Determines if the side navigation can be collapsed down to an icon-only rail, allowing for more screen space when needed.\n *\n * Setting to `true` will enable collapsibility. Passing an object allows for more advanced configuration, including fully controlled usage outside app shell context.\n */\n UNSTABLE_isCollapsible?:\n | boolean\n | {\n /** Whether the side nav should be collapsed by default. Only affects large viewports. */\n defaultCollapsed?: true;\n /** Whether the side nav is currently collapsed. Only needed when the side nav is not controlled by the app shell. */\n isCollapsed?: boolean;\n /** Callback function that is called when the side nav is collapsed or expanded. */\n onCollapseChange?: (isCollapsed: boolean) => void;\n };\n}\n\n/**\n * Displays persistent side navigation for applications with multiple sections or pages.\n *\n * See [side nav usage guidelines](https://ui.cimpress.io/components/side-nav/).\n */\nexport function SideNav({ children, UNSTABLE_isCollapsible: isCollapsible }: SideNavProps) {\n const appShellContext = useContext(AppShellContext);\n\n useLayoutEffect(() => {\n appShellContext?.setSideNavIsCollapsible(typeof isCollapsible === 'object' || isCollapsible || false);\n }, [isCollapsible, appShellContext]);\n\n return (\n <>\n <SideNavInner UNSTABLE_isCollapsible={isCollapsible}>{children}</SideNavInner>\n {appShellContext && (\n <MobileNav isOpen={appShellContext.mobileNavIsOpen} onOpenChange={() => appShellContext.toggleMobileNav(false)}>\n <SideNavContext.Provider\n value={{\n isCollapsed: false,\n onItemSelect: () => appShellContext.toggleMobileNav(false),\n }}\n >\n {children}\n </SideNavContext.Provider>\n </MobileNav>\n )}\n </>\n );\n}\nSideNav.displayName = 'SideNav';\n\nfunction SideNavInner({ children, UNSTABLE_isCollapsible: isCollapsible }: SideNavProps) {\n const messages = useLocalizedMessages('sideNav');\n const appShellContext = useContext(AppShellContext);\n const sideNavRef = useRef<HTMLDivElement>(null);\n const isOverlaySideNav = useBreakpoint({ max: 'md' }) && isCollapsible !== false;\n const isCollapsed =\n typeof isCollapsible === 'object'\n ? (isCollapsible.isCollapsed ?? appShellContext?.sideNavIsCollapsed ?? isCollapsible.defaultCollapsed)\n : isCollapsible\n ? appShellContext?.sideNavIsCollapsed\n : undefined;\n\n function handleClose() {\n appShellContext?.toggleSideNavCollapse(true);\n\n if (typeof isCollapsible === 'object') {\n isCollapsible.onCollapseChange?.(true);\n }\n }\n\n const { overlayProps } = useOverlay(\n {\n isDismissable: isOverlaySideNav,\n isOpen: isOverlaySideNav && isCollapsed !== undefined ? !isCollapsed : undefined,\n onClose: () => handleClose(),\n },\n sideNavRef,\n );\n\n const resetState = useEffectEvent(() => {\n if (typeof isCollapsible === 'object' || isCollapsible) {\n const defaultIsCollapsed = typeof isCollapsible === 'object' ? isCollapsible.defaultCollapsed : false;\n appShellContext?.toggleSideNavCollapse(defaultIsCollapsed || matchesBreakpoint({ max: 'md' }));\n if (typeof isCollapsible === 'object') {\n isCollapsible.onCollapseChange?.(defaultIsCollapsed || matchesBreakpoint({ max: 'md' }));\n }\n }\n });\n\n // Hydrate state and reset when screen size changes to or from overlay mode\n useLayoutEffect(() => {\n resetState();\n }, [isOverlaySideNav]);\n\n return (\n <SideNavContext.Provider\n value={{\n isCollapsed: isCollapsed ?? false,\n onItemSelect: isOverlaySideNav ? handleClose : undefined,\n }}\n >\n <div\n {...(isOverlaySideNav ? overlayProps : {})}\n className=\"cim-side-nav\"\n data-collapsible={typeof isCollapsible === 'object' ? true : isCollapsible || false}\n data-collapsed={isCollapsed}\n aria-label={messages.format('srLabel')}\n ref={sideNavRef}\n >\n <div className=\"cim-side-nav-panel\">{children}</div>\n </div>\n </SideNavContext.Provider>\n );\n}\n\nexport interface SideNavListProps {\n /** Navigation items and sections belonging to the list. */\n children: ReactNode;\n}\n\n/** Renders a list of navigation items within `SideNav`. */\nexport function SideNavList({ children }: SideNavListProps) {\n return <nav className=\"cim-side-nav-list\">{children}</nav>;\n}\nSideNavList.displayName = 'SideNavList';\n\nexport interface SideNavListItemProps {\n /** The text to display as the navigation item label. */\n children: StringLikeChildren;\n /** A URL to link to. */\n href: Href;\n /** Whether the navigation item represents the current page. */\n isActive?: boolean;\n /** An icon displayed before the navigation item label. Required when the side nav is collapsible. */\n icon?: ReactNode;\n}\n\n/** Renders a single navigation item within `SideNavList`. */\nexport function SideNavListItem({ children, href, isActive, icon }: SideNavListItemProps) {\n const { isCollapsed, onItemSelect } = useContext(SideNavContext);\n\n return (\n <Tooltip label={stringLikeChildrenToString(children)} placement=\"right\" isDisabled={!isCollapsed}>\n <RACLink href={href} className=\"cim-side-nav-list-item\" data-active={isActive} onPress={onItemSelect}>\n {icon}\n <Text as=\"span\" variant=\"medium\" UNSAFE_className=\"cim-side-nav-list-item-label\">\n {children}\n </Text>\n </RACLink>\n </Tooltip>\n );\n}\nSideNavListItem.displayName = 'SideNavListItem';\n\nexport interface SideNavListSectionProps {\n /** Navigation items belonging to the section. */\n children: ReactNode;\n /** The content to display as the section title. */\n label?: string;\n}\n\n/** Renders a section of navigation items within `SideNavList`. */\nexport function SideNavListSection({ children, label }: SideNavListSectionProps) {\n return (\n <div className=\"cim-side-nav-list-section\">\n {label && (\n <div className=\"cim-side-nav-list-section-header\">\n <Text as=\"p\" variant=\"small-semibold\" tone=\"subtle\" UNSAFE_className=\"cim-side-nav-list-section-header-label\">\n {label}\n </Text>\n </div>\n )}\n {children}\n </div>\n );\n}\nSideNavListSection.displayName = 'SideNavListSection';\n"]}
|
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { NavigationProps, StringLikeChildren, WithRequired } from '../types.js';
|
|
3
|
-
export interface
|
|
3
|
+
export interface TopNavProps {
|
|
4
|
+
/** The contents of the top navigation. Must be one or more of `<TopNavItem>`. */
|
|
4
5
|
children: ReactNode;
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Displays horizontal navigation, typically below the app header.
|
|
9
|
+
*
|
|
10
|
+
* See [top nav usage guidelines](https://ui.cimpress.io/components/top-nav/).
|
|
11
|
+
*/
|
|
12
|
+
export declare function TopNav({ children, ...props }: TopNavProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare namespace TopNav {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
16
|
+
export interface TopNavItemProps extends WithRequired<NavigationProps, 'href'> {
|
|
17
|
+
/** The text to display as the navigation item label. */
|
|
8
18
|
children: StringLikeChildren;
|
|
19
|
+
/** Whether the navigation item represents the current page. */
|
|
9
20
|
isActive?: boolean;
|
|
10
21
|
}
|
|
11
|
-
|
|
22
|
+
/** Renders a single navigation item within `TopNav`. */
|
|
23
|
+
export declare function TopNavItem({ children, href, isActive, ...props }: TopNavItemProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare namespace TopNavItem {
|
|
25
|
+
var displayName: string;
|
|
26
|
+
}
|
|
12
27
|
//# sourceMappingURL=top-nav.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"top-nav.d.ts","sourceRoot":"","sources":["../../../../src/components/top-nav/top-nav.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"top-nav.d.ts","sourceRoot":"","sources":["../../../../src/components/top-nav/top-nav.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGrF,MAAM,WAAW,WAAW;IAC1B,iFAAiF;IACjF,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,2CAQzD;yBARe,MAAM;;;AAWtB,MAAM,WAAW,eAAgB,SAAQ,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC;IAC5E,wDAAwD;IACxD,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wDAAwD;AACxD,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CAgBjF;yBAhBe,UAAU"}
|
|
@@ -1,11 +1,22 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import clsx from 'clsx';
|
|
3
4
|
import { Link as RACLink } from 'react-aria-components';
|
|
5
|
+
import { useLocalizedMessages } from '../../i18n/index.js';
|
|
4
6
|
import { Text } from '../typography/text.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Displays horizontal navigation, typically below the app header.
|
|
9
|
+
*
|
|
10
|
+
* See [top nav usage guidelines](https://ui.cimpress.io/components/top-nav/).
|
|
11
|
+
*/
|
|
12
|
+
export function TopNav({ children, ...props }) {
|
|
13
|
+
const messages = useLocalizedMessages('topNav');
|
|
14
|
+
return (_jsx("nav", { ...props, className: clsx('cim-top-nav', 'cim-link-tabs'), "aria-label": messages.format('srLabel'), children: _jsx("ul", { className: "cim-tab-list", children: children }) }));
|
|
7
15
|
}
|
|
8
|
-
|
|
16
|
+
TopNav.displayName = 'TopNav';
|
|
17
|
+
/** Renders a single navigation item within `TopNav`. */
|
|
18
|
+
export function TopNavItem({ children, href, isActive, ...props }) {
|
|
9
19
|
return (_jsx("li", { children: _jsx(RACLink, { ...props, className: clsx('cim-tab-item', 'cim-link-tab-item'), href: href, "aria-current": isActive ? 'page' : undefined, "data-selected": isActive || undefined, children: _jsx(Text, { as: "span", variant: "medium-semibold", alignment: "center", children: children }) }) }));
|
|
10
20
|
}
|
|
21
|
+
TopNavItem.displayName = 'TopNavItem';
|
|
11
22
|
//# sourceMappingURL=top-nav.js.map
|