@linzjs/lui 17.29.1 → 17.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/CHANGELOG.md +10 -0
- package/README.md +3 -2
- package/dist/assets/icons/settings.svg +1 -0
- package/dist/assets/svg-content.d.ts +1 -1
- package/dist/assets/svg-content.tsx +7 -0
- package/dist/components/LuiHeader/LuiHeader.d.ts +8 -0
- package/dist/components/LuiHeaderMenu/LuiHeaderMenus.d.ts +12 -0
- package/dist/components/LuiHeaderMenuV2/LuiHeaderMenusV2.d.ts +69 -0
- package/dist/components/LuiHeaderV2/LuiHeaderV2.d.ts +20 -0
- package/dist/components/LuiIcon/LuiIcon.d.ts +2 -1
- package/dist/components/common/StorybookSupport.d.ts +1 -1
- package/dist/components/common/UseMediaQuery.d.ts +9 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +205 -2
- package/dist/index.js.map +1 -1
- package/dist/lui.css +338 -0
- package/dist/lui.css.map +1 -1
- package/dist/lui.esm.js +194 -3
- package/dist/lui.esm.js.map +1 -1
- package/dist/scss/Components/HeaderV2/header-v2.scss +242 -0
- package/dist/scss/Components/MenuV2/menu-v2.scss +172 -0
- package/dist/scss/base.scss +2 -0
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
# [17.31.0](https://github.com/linz/lui/compare/v17.30.0...v17.31.0) (2023-02-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* implement a new version LuiHeader ([#838](https://github.com/linz/lui/issues/838)) ([50d2364](https://github.com/linz/lui/commit/50d23648aa92ce36d927239b034ff045a3fd280a))
|
|
7
|
+
* implement new version LuiHeader and associated componenets ([#840](https://github.com/linz/lui/issues/840)) ([c6c9de3](https://github.com/linz/lui/commit/c6c9de36e0d4108d3aaaf445809d78ebefdfce5e))
|
|
8
|
+
|
|
9
|
+
# [17.30.0](https://github.com/linz/lui/compare/v17.29.1...v17.30.0) (2023-02-07)
|
|
10
|
+
|
|
1
11
|
## [17.29.1](https://github.com/linz/lui/compare/v17.29.0...v17.29.1) (2023-02-06)
|
|
2
12
|
|
|
3
13
|
|
package/README.md
CHANGED
|
@@ -42,10 +42,11 @@ We aim to make each component generic, extendable, accessible, and amazing.
|
|
|
42
42
|
All styles are implemented in SCSS and compiled to plain CSS. This means any team can use the CSS. A ReactJS wrapper
|
|
43
43
|
over the CSS is part of this project.
|
|
44
44
|
|
|
45
|
-
There are lots of things to do in this project, often things will be left until there is demand. Please join the Slack channel
|
|
45
|
+
There are lots of things to do in this project, often things will be left until there is demand, e.g add new components or implement new version components. Please join the Slack channel
|
|
46
|
+
|
|
46
47
|
#cop-lui.
|
|
47
48
|
|
|
48
|
-
## Documentation
|
|
49
|
+
## Documentation
|
|
49
50
|
|
|
50
51
|
Storybook is the main source of documentation.
|
|
51
52
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13.924 21.95h-3.848a.973.973 0 0 1-.667-.25.988.988 0 0 1-.333-.626l-.308-2.325a3.913 3.913 0 0 1-.628-.3 8.356 8.356 0 0 1-.578-.375l-2.232.9c-.24.084-.479.092-.718.025a.95.95 0 0 1-.564-.425L2.149 15.35a.92.92 0 0 1-.128-.7c.051-.25.18-.45.385-.6l1.924-1.425a2.33 2.33 0 0 1-.026-.338v-.675c0-.108.009-.22.026-.337L2.406 9.85a.957.957 0 0 1-.385-.6.92.92 0 0 1 .128-.7l1.899-3.225a.804.804 0 0 1 .55-.438 1.29 1.29 0 0 1 .732.038l2.232.9c.188-.133.385-.258.59-.375.205-.116.41-.216.616-.3l.308-2.325a.989.989 0 0 1 .333-.625.973.973 0 0 1 .667-.25h3.848c.257 0 .479.084.667.25.188.167.3.375.333.625l.308 2.325c.223.084.432.184.63.3.196.117.388.242.576.375l2.232-.9c.24-.083.479-.091.718-.025a.95.95 0 0 1 .564.425l1.899 3.225a.92.92 0 0 1 .128.7.957.957 0 0 1-.385.6l-1.924 1.425c.017.117.026.23.026.337v.675a1.2 1.2 0 0 1-.051.338l1.924 1.425c.205.15.333.35.384.6a.92.92 0 0 1-.128.7l-1.898 3.2c-.137.217-.33.363-.577.438-.248.075-.492.07-.732-.013l-2.18-.9a6.982 6.982 0 0 1-.59.375 5.21 5.21 0 0 1-.616.3l-.308 2.325a.988.988 0 0 1-.333.625.973.973 0 0 1-.667.25Zm-1.873-6.5c.992 0 1.839-.342 2.54-1.026.701-.683 1.052-1.508 1.052-2.475 0-.966-.35-1.791-1.052-2.475-.701-.683-1.548-1.025-2.54-1.025-1.009 0-1.86.342-2.553 1.025-.692.684-1.038 1.509-1.038 2.475 0 .967.346 1.792 1.038 2.475.693.684 1.544 1.025 2.553 1.025Z" fill="#000"/></svg>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare type LuiIconName = string | 'ic_account_circle' | 'ic_add' | 'ic_add_adopt' | 'ic_add_area_interest' | 'ic_add_circle' | 'ic_add_circle_outline' | 'ic_add_irregular_image' | 'ic_add_multiple' | 'ic_add_to_list' | 'ic_annotations' | 'ic_apps' | 'ic_arrow_back' | 'ic_arrow_back_ios' | 'ic_arrow_back_left' | 'ic_arrow_drop_down' | 'ic_arrow_drop_right' | 'ic_arrow_drop_up' | 'ic_arrow_forward_ios' | 'ic_arrow_forward_right' | 'ic_attach_file' | 'ic_attachment' | 'ic_auth_and_instruct' | 'ic_balance_parcel' | 'ic_blackwhite_greyscale' | 'ic_blocked' | 'ic_border_color' | 'ic_cancel_clear' | 'ic_certify_and_sign' | 'ic_change_password' | 'ic_check' | 'ic_check_circle' | 'ic_check_circle_outline' | 'ic_checklist' | 'ic_clear' | 'ic_columns' | 'ic_control_point' | 'ic_copy' | 'ic_corporate_fare' | 'ic_create' | 'ic_dealings' | 'ic_delete_outline' | 'ic_delete_solid' | 'ic_dollar_round' | 'ic_double_arrow_left' | 'ic_double_arrow_right' | 'ic_double_tick' | 'ic_drag_handle' | 'ic_drag_indicator' | 'ic_draw_irregular_line' | 'ic_enabled_users' | 'ic_error' | 'ic_error_outline' | 'ic_expand_less' | 'ic_expand_more' | 'ic_feedback_lightbulb' | 'ic_feedback_lightbulb_alt' | 'ic_file_attached' | 'ic_file_attached_outline' | 'ic_filter_list' | 'ic_flag' | 'ic_forward' | 'ic_fullscreen_frame' | 'ic_grid_view' | 'ic_history' | 'ic_hourglass' | 'ic_info' | 'ic_info_outline' | 'ic_insert_invitation' | 'ic_insert_photo' | 'ic_instruments_roles' | 'ic_keyboard_arrow_down' | 'ic_keyboard_arrow_left' | 'ic_keyboard_arrow_right' | 'ic_keyboard_arrow_up' | 'ic_launch_modal' | 'ic_launch_new window_open' | 'ic_layers' | 'ic_left' | 'ic_left_col' | 'ic_line_arc' | 'ic_line_irregular' | 'ic_line_vector' | 'ic_link' | 'ic_list_add' | 'ic_locate' | 'ic_lock' | 'ic_lock_alt' | 'ic_log_out' | 'ic_manage_adjust' | 'ic_maori_land' | 'ic_mark_linking' | 'ic_marks' | 'ic_memorials' | 'ic_menu' | 'ic_message_received' | 'ic_minimise' | 'ic_misclose_error' | 'ic_more_vert' | 'ic_navigate_before' | 'ic_navigate_next' | 'ic_note_add' | 'ic_notice_of_change' | 'ic_numbered_list' | 'ic_office_building_corporate' | 'ic_order_history' | 'ic_package' | 'ic_parcels_existing' | 'ic_parcels_new' | 'ic_pdf' | 'ic_pen_and_paper_sign' | 'ic_people_outline' | 'ic_person' | 'ic_person_add' | 'ic_picker' | 'ic_placeholder' | 'ic_plus_one' | 'ic_polygon_selection' | 'ic_pop_back' | 'ic_pre_validation' | 'ic_print' | 'ic_product_list' | 'ic_publish' | 'ic_regenerate' | 'ic_release' | 'ic_remove_circle' | 'ic_remove_circle_outline' | 'ic_request' | 'ic_requisitions' | 'ic_round_selection' | 'ic_save_download' | 'ic_saved_area_interest' | 'ic_search' | 'ic_send' | 'ic_send_email_dart' | 'ic_separator' | 'ic_sorting_down_arrow_up' | 'ic_sorting_up_arrow_up' | 'ic_square_selection' | 'ic_subdirectory_arrow_right' | 'ic_submit' | 'ic_survey' | 'ic_survey_report' | 'ic_ta_request_sent' | 'ic_table_columns' | 'ic_tax_statement' | 'ic_tick' | 'ic_tick_and_cross' | 'ic_timeline' | 'ic_title_allocation_swap' | 'ic_tune_setting_configure' | 'ic_unlink' | 'ic_upload' | 'ic_vector' | 'ic_vector_sequence' | 'ic_view' | 'ic_view_list' | 'ic_view_quilt' | 'ic_view_sidebar' | 'ic_view_week' | 'ic_visiblity_off' | 'ic_warning' | 'ic_warning_outline' | 'ic_waves' | 'ic_whats_new_updates' | 'ic_xml_file' | 'ic_zoom_centre' | 'ic_zoom_out' | 'ic_zoom_previous';
|
|
2
|
+
export declare type LuiIconName = string | 'ic_account_circle' | 'ic_add' | 'ic_add_adopt' | 'ic_add_area_interest' | 'ic_add_circle' | 'ic_add_circle_outline' | 'ic_add_irregular_image' | 'ic_add_multiple' | 'ic_add_to_list' | 'ic_annotations' | 'ic_apps' | 'ic_arrow_back' | 'ic_arrow_back_ios' | 'ic_arrow_back_left' | 'ic_arrow_drop_down' | 'ic_arrow_drop_right' | 'ic_arrow_drop_up' | 'ic_arrow_forward_ios' | 'ic_arrow_forward_right' | 'ic_attach_file' | 'ic_attachment' | 'ic_auth_and_instruct' | 'ic_balance_parcel' | 'ic_blackwhite_greyscale' | 'ic_blocked' | 'ic_border_color' | 'ic_cancel_clear' | 'ic_certify_and_sign' | 'ic_change_password' | 'ic_check' | 'ic_check_circle' | 'ic_check_circle_outline' | 'ic_checklist' | 'ic_clear' | 'ic_columns' | 'ic_control_point' | 'ic_copy' | 'ic_corporate_fare' | 'ic_create' | 'ic_dealings' | 'ic_delete_outline' | 'ic_delete_solid' | 'ic_dollar_round' | 'ic_double_arrow_left' | 'ic_double_arrow_right' | 'ic_double_tick' | 'ic_drag_handle' | 'ic_drag_indicator' | 'ic_draw_irregular_line' | 'ic_enabled_users' | 'ic_error' | 'ic_error_outline' | 'ic_expand_less' | 'ic_expand_more' | 'ic_feedback_lightbulb' | 'ic_feedback_lightbulb_alt' | 'ic_file_attached' | 'ic_file_attached_outline' | 'ic_filter_list' | 'ic_flag' | 'ic_forward' | 'ic_fullscreen_frame' | 'ic_grid_view' | 'ic_history' | 'ic_hourglass' | 'ic_info' | 'ic_info_outline' | 'ic_insert_invitation' | 'ic_insert_photo' | 'ic_instruments_roles' | 'ic_keyboard_arrow_down' | 'ic_keyboard_arrow_left' | 'ic_keyboard_arrow_right' | 'ic_keyboard_arrow_up' | 'ic_launch_modal' | 'ic_launch_new window_open' | 'ic_layers' | 'ic_left' | 'ic_left_col' | 'ic_line_arc' | 'ic_line_irregular' | 'ic_line_vector' | 'ic_link' | 'ic_list_add' | 'ic_locate' | 'ic_lock' | 'ic_lock_alt' | 'ic_log_out' | 'ic_manage_adjust' | 'ic_maori_land' | 'ic_mark_linking' | 'ic_marks' | 'ic_memorials' | 'ic_menu' | 'ic_message_received' | 'ic_minimise' | 'ic_misclose_error' | 'ic_more_vert' | 'ic_navigate_before' | 'ic_navigate_next' | 'ic_note_add' | 'ic_notice_of_change' | 'ic_numbered_list' | 'ic_office_building_corporate' | 'ic_order_history' | 'ic_package' | 'ic_parcels_existing' | 'ic_parcels_new' | 'ic_pdf' | 'ic_pen_and_paper_sign' | 'ic_people_outline' | 'ic_person' | 'ic_person_add' | 'ic_picker' | 'ic_placeholder' | 'ic_plus_one' | 'ic_polygon_selection' | 'ic_pop_back' | 'ic_pre_validation' | 'ic_print' | 'ic_product_list' | 'ic_publish' | 'ic_regenerate' | 'ic_release' | 'ic_remove_circle' | 'ic_remove_circle_outline' | 'ic_request' | 'ic_requisitions' | 'ic_round_selection' | 'ic_save_download' | 'ic_saved_area_interest' | 'ic_search' | 'ic_send' | 'ic_send_email_dart' | 'ic_separator' | 'ic_settings' | 'ic_sorting_down_arrow_up' | 'ic_sorting_up_arrow_up' | 'ic_square_selection' | 'ic_subdirectory_arrow_right' | 'ic_submit' | 'ic_survey' | 'ic_survey_report' | 'ic_ta_request_sent' | 'ic_table_columns' | 'ic_tax_statement' | 'ic_tick' | 'ic_tick_and_cross' | 'ic_timeline' | 'ic_title_allocation_swap' | 'ic_tune_setting_configure' | 'ic_unlink' | 'ic_upload' | 'ic_vector' | 'ic_vector_sequence' | 'ic_view' | 'ic_view_list' | 'ic_view_quilt' | 'ic_view_sidebar' | 'ic_view_week' | 'ic_visiblity_off' | 'ic_warning' | 'ic_warning_outline' | 'ic_waves' | 'ic_whats_new_updates' | 'ic_xml_file' | 'ic_zoom_centre' | 'ic_zoom_out' | 'ic_zoom_previous';
|
|
3
3
|
declare type IconNameElementMap = {
|
|
4
4
|
[key in LuiIconName]?: JSX.Element;
|
|
5
5
|
};
|
|
@@ -145,6 +145,7 @@ export type LuiIconName =
|
|
|
145
145
|
| 'ic_send'
|
|
146
146
|
| 'ic_send_email_dart'
|
|
147
147
|
| 'ic_separator'
|
|
148
|
+
| 'ic_settings'
|
|
148
149
|
| 'ic_sorting_down_arrow_up'
|
|
149
150
|
| 'ic_sorting_up_arrow_up'
|
|
150
151
|
| 'ic_square_selection'
|
|
@@ -1041,6 +1042,12 @@ iconMap['ic_separator'] = (
|
|
|
1041
1042
|
</svg>
|
|
1042
1043
|
);
|
|
1043
1044
|
|
|
1045
|
+
iconMap['ic_settings'] = (
|
|
1046
|
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
1047
|
+
<path d="M13.924 21.95h-3.848a.973.973 0 0 1-.667-.25.988.988 0 0 1-.333-.626l-.308-2.325a3.913 3.913 0 0 1-.628-.3 8.356 8.356 0 0 1-.578-.375l-2.232.9c-.24.084-.479.092-.718.025a.95.95 0 0 1-.564-.425L2.149 15.35a.92.92 0 0 1-.128-.7c.051-.25.18-.45.385-.6l1.924-1.425a2.33 2.33 0 0 1-.026-.338v-.675c0-.108.009-.22.026-.337L2.406 9.85a.957.957 0 0 1-.385-.6.92.92 0 0 1 .128-.7l1.899-3.225a.804.804 0 0 1 .55-.438 1.29 1.29 0 0 1 .732.038l2.232.9c.188-.133.385-.258.59-.375.205-.116.41-.216.616-.3l.308-2.325a.989.989 0 0 1 .333-.625.973.973 0 0 1 .667-.25h3.848c.257 0 .479.084.667.25.188.167.3.375.333.625l.308 2.325c.223.084.432.184.63.3.196.117.388.242.576.375l2.232-.9c.24-.083.479-.091.718-.025a.95.95 0 0 1 .564.425l1.899 3.225a.92.92 0 0 1 .128.7.957.957 0 0 1-.385.6l-1.924 1.425c.017.117.026.23.026.337v.675a1.2 1.2 0 0 1-.051.338l1.924 1.425c.205.15.333.35.384.6a.92.92 0 0 1-.128.7l-1.898 3.2c-.137.217-.33.363-.577.438-.248.075-.492.07-.732-.013l-2.18-.9a6.982 6.982 0 0 1-.59.375 5.21 5.21 0 0 1-.616.3l-.308 2.325a.988.988 0 0 1-.333.625.973.973 0 0 1-.667.25Zm-1.873-6.5c.992 0 1.839-.342 2.54-1.026.701-.683 1.052-1.508 1.052-2.475 0-.966-.35-1.791-1.052-2.475-.701-.683-1.548-1.025-2.54-1.025-1.009 0-1.86.342-2.553 1.025-.692.684-1.038 1.509-1.038 2.475 0 .967.346 1.792 1.038 2.475.693.684 1.544 1.025 2.553 1.025Z" />
|
|
1048
|
+
</svg>
|
|
1049
|
+
);
|
|
1050
|
+
|
|
1044
1051
|
iconMap['ic_sorting_down_arrow_up'] = (
|
|
1045
1052
|
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
1046
1053
|
<path d="M18.3 14.29a.996.996 0 0 0-1.41 0L13 18.17V3c0-.55-.45-1-1-1s-1 .45-1 1v15.18L7.12 14.3a.996.996 0 1 0-1.41 1.41l5.59 5.59c.39.39 1.02.39 1.41 0l5.59-5.59c.38-.39.38-1.03 0-1.42Z" />
|
|
@@ -9,6 +9,9 @@ interface HeaderProps {
|
|
|
9
9
|
transparent?: boolean;
|
|
10
10
|
sticky?: boolean;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated: this is replaced by LuiHeaderV2
|
|
14
|
+
*/
|
|
12
15
|
declare const LuiHeader: React.FC<React.PropsWithChildren<HeaderProps>>;
|
|
13
16
|
interface ILuiIcon {
|
|
14
17
|
/**
|
|
@@ -39,6 +42,8 @@ interface ILuiHeaderMenuItem extends ILuiIcon {
|
|
|
39
42
|
'data-testid'?: string;
|
|
40
43
|
}
|
|
41
44
|
/**
|
|
45
|
+
* @deprecated: this is replaced by LuiHeaderMenuItemV2
|
|
46
|
+
*
|
|
42
47
|
* The \`LuiHeaderMenuItem\` is the base component for all menu items that are to be shown in the header.
|
|
43
48
|
* Note that it depends on it being rendered inside a LuiHeader for its styles to apply properly.
|
|
44
49
|
* To configure the item for responsiveness, ensure to set any of the hideOn* properties.
|
|
@@ -56,6 +61,9 @@ interface ILuiCloseableHeaderMenuItem extends Omit<ILuiHeaderMenuItem, 'onClick'
|
|
|
56
61
|
open: boolean;
|
|
57
62
|
setOpen: (value: boolean) => void;
|
|
58
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated replaced by LuiCloseableHeaderMenuItemV2
|
|
66
|
+
*/
|
|
59
67
|
declare const LuiCloseableHeaderMenuItem: React.FC<React.PropsWithChildren<ILuiCloseableHeaderMenuItem>>;
|
|
60
68
|
interface ILuiMenuCloseButton extends ILuiIcon {
|
|
61
69
|
'data-testid'?: string;
|
|
@@ -18,13 +18,25 @@ interface ILuiDrawerMenuOption {
|
|
|
18
18
|
*/
|
|
19
19
|
onClick?: () => void;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated replaced by LuiDrawerMenuOptionsV2
|
|
23
|
+
*/
|
|
21
24
|
declare const LuiDrawerMenuOptions: React.FC<React.PropsWithChildren<ILuiIcon>>;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated replaced by LuiDrawerMenuOptionV2
|
|
27
|
+
*/
|
|
22
28
|
declare const LuiDrawerMenuOption: React.FC<React.PropsWithChildren<ILuiDrawerMenuOption>>;
|
|
23
29
|
declare type ILuiDrawerMenu = Omit<ILuiHeaderMenuItem, 'onClick'> & {
|
|
24
30
|
hasStickyHeader?: boolean;
|
|
25
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated replaced by LuiDrawerMenuV2
|
|
34
|
+
*/
|
|
26
35
|
declare const LuiDrawerMenu: React.FC<React.PropsWithChildren<ILuiDrawerMenu>>;
|
|
27
36
|
declare type ILuiDropdownMenu = Omit<ILuiHeaderMenuItem, 'onClick'>;
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated replaced by LuiDropdownMenuV2
|
|
39
|
+
*/
|
|
28
40
|
declare const LuiDropdownMenu: React.FC<React.PropsWithChildren<ILuiDropdownMenu>>;
|
|
29
41
|
interface ILuiDrawerMenuSection {
|
|
30
42
|
/**
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { ILuiHeaderMenuItem, ILuiIcon } from '../LuiHeader/LuiHeader';
|
|
3
|
+
import { ILuiDrawerMenu, ILuiDrawerMenuSection } from '../LuiHeaderMenu/LuiHeaderMenus';
|
|
4
|
+
import { Size } from '../common/ResponsiveUtils';
|
|
5
|
+
import { IconSize } from '../LuiIcon/LuiIcon';
|
|
6
|
+
interface ILuiDrawerMenuOptionV2 {
|
|
7
|
+
/**
|
|
8
|
+
* The material-ui icon name (see https://material.io/resources/icons/?search=account_c&style=round)
|
|
9
|
+
*/
|
|
10
|
+
icon?: string | ReactElement;
|
|
11
|
+
/**
|
|
12
|
+
* icon color, only applied when using LuiIcon
|
|
13
|
+
*/
|
|
14
|
+
iconColor?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The size of icon, only applied when using LuiIcon, default to 'md'
|
|
17
|
+
*/
|
|
18
|
+
iconSize?: IconSize;
|
|
19
|
+
/**
|
|
20
|
+
* The label shown beside the icon which is aligned at the left of the drawer
|
|
21
|
+
*/
|
|
22
|
+
label: string | ReactElement;
|
|
23
|
+
/**
|
|
24
|
+
* The badge which is shown which is aligned at the right of the drawer
|
|
25
|
+
*/
|
|
26
|
+
badge?: ReactElement;
|
|
27
|
+
/**
|
|
28
|
+
* The function to be bound together with closing the drawer on click
|
|
29
|
+
*/
|
|
30
|
+
onClick?: () => void;
|
|
31
|
+
}
|
|
32
|
+
declare const LuiDrawerMenuOptionsV2: ({ children, }: ILuiIcon & {
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
}) => JSX.Element;
|
|
35
|
+
declare const LuiDrawerMenuOptionV2: ({ icon, iconColor, label, badge, iconSize, onClick, }: ILuiDrawerMenuOptionV2) => JSX.Element;
|
|
36
|
+
declare const LuiDrawerMenuV2: ({ children, hasStickyHeader, ...menuPropsCopy }: Omit<ILuiHeaderMenuItem, "onClick"> & {
|
|
37
|
+
hasStickyHeader?: boolean | undefined;
|
|
38
|
+
} & {
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
}) => JSX.Element;
|
|
41
|
+
declare type ILuiDropdownMenuV2 = Omit<ILuiHeaderMenuItem, 'onClick'> & {
|
|
42
|
+
/**
|
|
43
|
+
* The anchor origin of dropdown, default to left
|
|
44
|
+
*/
|
|
45
|
+
anchorOrigin?: {
|
|
46
|
+
horizontal?: 'left' | 'right';
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* the width of dropdown, default to 'md'
|
|
50
|
+
*/
|
|
51
|
+
size?: Size | 'xxl';
|
|
52
|
+
};
|
|
53
|
+
declare const LuiDropdownMenuV2: ({ ...restOfProps }: Omit<ILuiHeaderMenuItem, "onClick"> & {
|
|
54
|
+
/**
|
|
55
|
+
* The anchor origin of dropdown, default to left
|
|
56
|
+
*/
|
|
57
|
+
anchorOrigin?: {
|
|
58
|
+
horizontal?: "left" | "right" | undefined;
|
|
59
|
+
} | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* the width of dropdown, default to 'md'
|
|
62
|
+
*/
|
|
63
|
+
size?: Size | "xxl" | undefined;
|
|
64
|
+
} & {
|
|
65
|
+
children: ReactNode;
|
|
66
|
+
}) => JSX.Element;
|
|
67
|
+
declare const LuiDrawerMenuSectionV2: (props: ILuiDrawerMenuSection) => JSX.Element;
|
|
68
|
+
declare const LuiDrawerMenuDividerV2: () => JSX.Element;
|
|
69
|
+
export { LuiDrawerMenuV2, LuiDrawerMenuOptionsV2, LuiDrawerMenuOptionV2, ILuiDropdownMenuV2, LuiDropdownMenuV2, LuiDrawerMenuSectionV2, LuiDrawerMenuDividerV2, ILuiDrawerMenuOptionV2, };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { HeaderSize, ILuiCloseableHeaderMenuItem, ILuiHeaderMenuItem } from '../LuiHeader/LuiHeader';
|
|
3
|
+
interface HeaderPropsV2 {
|
|
4
|
+
headingText?: string;
|
|
5
|
+
size?: HeaderSize;
|
|
6
|
+
homeLink?: string | (() => void);
|
|
7
|
+
transparent?: boolean;
|
|
8
|
+
sticky?: boolean;
|
|
9
|
+
appMenu?: ReactNode;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare const LuiHeaderV2: ({ headingText, size, homeLink, transparent, children, sticky, appMenu, }: HeaderPropsV2) => JSX.Element;
|
|
13
|
+
declare const LuiHeaderMenuItemV2: React.ForwardRefExoticComponent<ILuiHeaderMenuItem & {
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
iconColor?: string | undefined;
|
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const LuiCloseableHeaderMenuItemV2: ({ open, setOpen, children, ...props }: ILuiCloseableHeaderMenuItem & {
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
}) => JSX.Element;
|
|
20
|
+
export { LuiHeaderV2, LuiHeaderMenuItemV2, LuiCloseableHeaderMenuItemV2 };
|
|
@@ -14,6 +14,7 @@ export interface LuiIconProps {
|
|
|
14
14
|
className?: string;
|
|
15
15
|
title?: string;
|
|
16
16
|
spanProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
17
|
+
color?: string;
|
|
17
18
|
}
|
|
18
19
|
export declare const ICON_SIZES: {
|
|
19
20
|
xs: string;
|
|
@@ -31,4 +32,4 @@ export declare const ICON_STATUS: {
|
|
|
31
32
|
interactive: string;
|
|
32
33
|
disabled: string;
|
|
33
34
|
};
|
|
34
|
-
export declare const LuiIcon: ({ name, className, size, title, alt, status, spanProps, }: LuiIconProps) => JSX.Element | null;
|
|
35
|
+
export declare const LuiIcon: ({ name, className, size, title, alt, status, spanProps, color, }: LuiIconProps) => JSX.Element | null;
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Open menu after render so chromatic can see it.
|
|
3
3
|
* Place in useEffect in story. e.g. useEffect(openHeaderMenu, []);
|
|
4
4
|
*/
|
|
5
|
-
export declare const openHeaderMenu: () => void;
|
|
5
|
+
export declare const openHeaderMenu: (menuIconClass?: string) => void;
|
|
6
6
|
export declare const expandCollapsedContainer: () => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Size } from './ResponsiveUtils';
|
|
2
|
+
export declare type Breakpoint = Exclude<Size | 'xxl', 'xs'>;
|
|
3
|
+
export declare const breakpoints: Record<Breakpoint, number>;
|
|
4
|
+
export declare const breakpointQuery: {
|
|
5
|
+
up: (bp: Breakpoint) => string;
|
|
6
|
+
down: (bp: Breakpoint) => string;
|
|
7
|
+
between: (bp1: Breakpoint, bp2: Breakpoint) => string;
|
|
8
|
+
};
|
|
9
|
+
export declare const useMediaQuery: (query: string) => boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -36,7 +36,9 @@ export { LuiFooter } from './components/LuiFooter/LuiFooter';
|
|
|
36
36
|
export { LuiComboSelect, LuiComboSelectProps, LuiComboSelectOption, } from './components/LuiForms/LuiComboSelect/LuiComboSelect';
|
|
37
37
|
export { LuiFormSectionHeader, IFormSectionHeaderProps, } from './components/LuiForms/LuiFormSection/LuiFormSectionHeader';
|
|
38
38
|
export * from './components/LuiHeader/LuiHeader';
|
|
39
|
+
export * from './components/LuiHeaderV2/LuiHeaderV2';
|
|
39
40
|
export * from './components/LuiHeaderMenu/LuiHeaderMenus';
|
|
41
|
+
export * from './components/LuiHeaderMenuV2/LuiHeaderMenusV2';
|
|
40
42
|
export { LuiUpdatesSplashModal } from './components/LuiUpdateSplashModal/LuiUpdatesSplashModal';
|
|
41
43
|
export { LuiModal, LuiAlertModal, LuiAlertModalButtons, } from './components/LuiModal/LuiModal';
|
|
42
44
|
export { ISearchInputProps, ISearchGroupedResult, ISearchResult, LuiSearchInput, } from './components/LuiSearchInput/LuiSearchInput';
|
|
@@ -67,3 +69,4 @@ export { RadioItemRenderer } from './components/LuiListBox/Renderers/RadioItemRe
|
|
|
67
69
|
export { CheckboxItemRenderer } from './components/LuiListBox/Renderers/CheckboxItemRenderer';
|
|
68
70
|
export { LuiSideMenu, ILuiSideMenuProps, } from './components/LuiSideMenu/LuiSideMenu';
|
|
69
71
|
export { LuiSideMenuItem, ILuiSideMenuItemProps, LuiMenuItemClickHandler, } from './components/LuiSideMenu/LuiSideMenuItem';
|
|
72
|
+
export { Breakpoint, breakpoints, breakpointQuery, useMediaQuery, } from './components/common/UseMediaQuery';
|
package/dist/index.js
CHANGED
|
@@ -459,6 +459,8 @@ iconMap['ic_send_email_dart'] = (React__default["default"].createElement("svg",
|
|
|
459
459
|
React__default["default"].createElement("path", { d: "M1.5 21v-6.984L16.5 12l-15-2.016V3l21 9-21 9Z" })));
|
|
460
460
|
iconMap['ic_separator'] = (React__default["default"].createElement("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" },
|
|
461
461
|
React__default["default"].createElement("path", { d: "M11 3h2v18h-2z" })));
|
|
462
|
+
iconMap['ic_settings'] = (React__default["default"].createElement("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" },
|
|
463
|
+
React__default["default"].createElement("path", { d: "M13.924 21.95h-3.848a.973.973 0 0 1-.667-.25.988.988 0 0 1-.333-.626l-.308-2.325a3.913 3.913 0 0 1-.628-.3 8.356 8.356 0 0 1-.578-.375l-2.232.9c-.24.084-.479.092-.718.025a.95.95 0 0 1-.564-.425L2.149 15.35a.92.92 0 0 1-.128-.7c.051-.25.18-.45.385-.6l1.924-1.425a2.33 2.33 0 0 1-.026-.338v-.675c0-.108.009-.22.026-.337L2.406 9.85a.957.957 0 0 1-.385-.6.92.92 0 0 1 .128-.7l1.899-3.225a.804.804 0 0 1 .55-.438 1.29 1.29 0 0 1 .732.038l2.232.9c.188-.133.385-.258.59-.375.205-.116.41-.216.616-.3l.308-2.325a.989.989 0 0 1 .333-.625.973.973 0 0 1 .667-.25h3.848c.257 0 .479.084.667.25.188.167.3.375.333.625l.308 2.325c.223.084.432.184.63.3.196.117.388.242.576.375l2.232-.9c.24-.083.479-.091.718-.025a.95.95 0 0 1 .564.425l1.899 3.225a.92.92 0 0 1 .128.7.957.957 0 0 1-.385.6l-1.924 1.425c.017.117.026.23.026.337v.675a1.2 1.2 0 0 1-.051.338l1.924 1.425c.205.15.333.35.384.6a.92.92 0 0 1-.128.7l-1.898 3.2c-.137.217-.33.363-.577.438-.248.075-.492.07-.732-.013l-2.18-.9a6.982 6.982 0 0 1-.59.375 5.21 5.21 0 0 1-.616.3l-.308 2.325a.988.988 0 0 1-.333.625.973.973 0 0 1-.667.25Zm-1.873-6.5c.992 0 1.839-.342 2.54-1.026.701-.683 1.052-1.508 1.052-2.475 0-.966-.35-1.791-1.052-2.475-.701-.683-1.548-1.025-2.54-1.025-1.009 0-1.86.342-2.553 1.025-.692.684-1.038 1.509-1.038 2.475 0 .967.346 1.792 1.038 2.475.693.684 1.544 1.025 2.553 1.025Z" })));
|
|
462
464
|
iconMap['ic_sorting_down_arrow_up'] = (React__default["default"].createElement("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" },
|
|
463
465
|
React__default["default"].createElement("path", { d: "M18.3 14.29a.996.996 0 0 0-1.41 0L13 18.17V3c0-.55-.45-1-1-1s-1 .45-1 1v15.18L7.12 14.3a.996.996 0 1 0-1.41 1.41l5.59 5.59c.39.39 1.02.39 1.41 0l5.59-5.59c.38-.39.38-1.03 0-1.42Z" })));
|
|
464
466
|
iconMap['ic_sorting_up_arrow_up'] = (React__default["default"].createElement("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" },
|
|
@@ -547,13 +549,14 @@ var ICON_STATUS = {
|
|
|
547
549
|
disabled: 'LuiIcon--disabled'
|
|
548
550
|
};
|
|
549
551
|
var LuiIcon = function (_a) {
|
|
550
|
-
var name = _a.name, className = _a.className, _b = _a.size, size = _b === void 0 ? 'ns' : _b, title = _a.title, alt = _a.alt, _c = _a.status, status = _c === void 0 ? 'none' : _c, spanProps = _a.spanProps;
|
|
552
|
+
var name = _a.name, className = _a.className, _b = _a.size, size = _b === void 0 ? 'ns' : _b, title = _a.title, alt = _a.alt, _c = _a.status, status = _c === void 0 ? 'none' : _c, spanProps = _a.spanProps, color = _a.color;
|
|
551
553
|
var iconSVG = ICONS[name];
|
|
552
554
|
if (!iconSVG) {
|
|
553
555
|
console.warn("<LuiIcon>: No icon found for: ".concat(iconSVG));
|
|
554
556
|
return null;
|
|
555
557
|
}
|
|
556
|
-
|
|
558
|
+
var customStyle = color ? { fill: color } : {};
|
|
559
|
+
return (React__namespace.createElement("span", __assign$3({ className: clsx$1('LuiIcon', className, size && ICON_SIZES[size], status && ICON_STATUS[status]), "data-icon": name, title: title, "aria-label": alt }, spanProps, { style: customStyle }), iconSVG));
|
|
557
560
|
};
|
|
558
561
|
|
|
559
562
|
function getMaterialIconForLevel(level) {
|
|
@@ -40118,8 +40121,12 @@ var buildHideClassDict = function (_a) {
|
|
|
40118
40121
|
};
|
|
40119
40122
|
};
|
|
40120
40123
|
|
|
40124
|
+
/**
|
|
40125
|
+
* @deprecated: this is replaced by LuiHeaderV2
|
|
40126
|
+
*/
|
|
40121
40127
|
var LuiHeader = function (_a) {
|
|
40122
40128
|
var headingText = _a.headingText, _b = _a.size, size = _b === void 0 ? 'small' : _b, homeLink = _a.homeLink, transparent = _a.transparent, children = _a.children, _c = _a.sticky, sticky = _c === void 0 ? true : _c;
|
|
40129
|
+
useDeprecatedWarning('LuiHeader');
|
|
40123
40130
|
var logoElement = size === 'normal' ? (React__default["default"].createElement("img", { className: "linz-logo", alt: "LINZ Logo", src: logo })) : (React__default["default"].createElement("img", { className: "linz-motif", alt: "LINZ Logo", src: motif }));
|
|
40124
40131
|
var logoContainer = logoElement;
|
|
40125
40132
|
if (typeof homeLink === 'string') {
|
|
@@ -40144,12 +40151,15 @@ var LuiHeader = function (_a) {
|
|
|
40144
40151
|
React__default["default"].createElement("div", { className: "lui-header-col" }, children))));
|
|
40145
40152
|
};
|
|
40146
40153
|
/**
|
|
40154
|
+
* @deprecated: this is replaced by LuiHeaderMenuItemV2
|
|
40155
|
+
*
|
|
40147
40156
|
* The \`LuiHeaderMenuItem\` is the base component for all menu items that are to be shown in the header.
|
|
40148
40157
|
* Note that it depends on it being rendered inside a LuiHeader for its styles to apply properly.
|
|
40149
40158
|
* To configure the item for responsiveness, ensure to set any of the hideOn* properties.
|
|
40150
40159
|
*/
|
|
40151
40160
|
var LuiHeaderMenuItem = React$1.forwardRef(function (_a, ref) {
|
|
40152
40161
|
var icon = _a.icon, label = _a.label, badge = _a.badge, hide = _a.hide, onClick = _a.onClick, _b = _a["data-testid"], dataTestId = _b === void 0 ? 'menu-item' : _b, children = _a.children;
|
|
40162
|
+
useDeprecatedWarning('LuiHeaderMenuItem');
|
|
40153
40163
|
var menuItemClasses = clsx$1('lui-header-menu-item', hide && buildHideClassDict(hide));
|
|
40154
40164
|
var resolvedIcon = !icon && !label ? 'menu' : icon;
|
|
40155
40165
|
return (React__default["default"].createElement("div", { className: menuItemClasses, ref: ref },
|
|
@@ -40164,8 +40174,12 @@ var LuiCloseableHeaderMenuContext = React$1.createContext({
|
|
|
40164
40174
|
open: function () { },
|
|
40165
40175
|
close: function () { }
|
|
40166
40176
|
});
|
|
40177
|
+
/**
|
|
40178
|
+
* @deprecated replaced by LuiCloseableHeaderMenuItemV2
|
|
40179
|
+
*/
|
|
40167
40180
|
var LuiCloseableHeaderMenuItem = function (_a) {
|
|
40168
40181
|
var open = _a.open, setOpen = _a.setOpen, props = __rest$1(_a, ["open", "setOpen"]);
|
|
40182
|
+
useDeprecatedWarning('LuiCloseableHeaderMenuItem');
|
|
40169
40183
|
useEscapeFunction(function () { return setOpen(false); });
|
|
40170
40184
|
var menuDiv = usePageClickFunction(function (event) { return open || event.stopPropagation(); }, function (event) {
|
|
40171
40185
|
if (!open) {
|
|
@@ -40189,12 +40203,77 @@ var LuiMenuCloseButton = function (_a) {
|
|
|
40189
40203
|
return (React__default["default"].createElement("i", { className: classes, onClick: menu.close, "data-testid": dataTestId }, icon));
|
|
40190
40204
|
};
|
|
40191
40205
|
|
|
40206
|
+
var LuiHeaderV2 = function (_a) {
|
|
40207
|
+
var headingText = _a.headingText, _b = _a.size, size = _b === void 0 ? 'small' : _b, homeLink = _a.homeLink, transparent = _a.transparent, children = _a.children, _c = _a.sticky, sticky = _c === void 0 ? true : _c, appMenu = _a.appMenu;
|
|
40208
|
+
var logoElement = size === 'normal' ? (React__default["default"].createElement("img", { className: "LuiHeaderV2-linz-logo", alt: "LINZ Logo", src: logo })) : (React__default["default"].createElement("img", { className: "LuiHeaderV2-linz-motif", alt: "LINZ Logo", src: motif }));
|
|
40209
|
+
var logoContainer = logoElement;
|
|
40210
|
+
if (typeof homeLink === 'string') {
|
|
40211
|
+
logoContainer = React__default["default"].createElement("a", { href: homeLink }, logoElement);
|
|
40212
|
+
}
|
|
40213
|
+
else if (typeof homeLink === 'function') {
|
|
40214
|
+
logoContainer = (React__default["default"].createElement("div", { className: "clickable", onClick: function () {
|
|
40215
|
+
homeLink();
|
|
40216
|
+
} }, logoElement));
|
|
40217
|
+
}
|
|
40218
|
+
return (React__default["default"].createElement("header", { className: clsx$1({
|
|
40219
|
+
LuiHeaderV2: true,
|
|
40220
|
+
'LuiHeaderV2-transparent': transparent,
|
|
40221
|
+
'LuiHeaderV2-small': size === 'small',
|
|
40222
|
+
'LuiHeaderV2-sticky': sticky
|
|
40223
|
+
}) },
|
|
40224
|
+
React__default["default"].createElement("div", { className: "LuiHeaderV2-row" },
|
|
40225
|
+
React__default["default"].createElement("div", { className: "LuiHeaderV2-col" },
|
|
40226
|
+
!!appMenu && appMenu,
|
|
40227
|
+
React__default["default"].createElement("div", { className: "LuiHeaderV2-logo" }, logoContainer),
|
|
40228
|
+
headingText && (React__default["default"].createElement("div", { className: "LuiHeaderV2-title" },
|
|
40229
|
+
React__default["default"].createElement("h1", null, headingText)))),
|
|
40230
|
+
React__default["default"].createElement("div", { className: "LuiHeaderV2-col" }, children))));
|
|
40231
|
+
};
|
|
40232
|
+
var LuiHeaderMenuItemV2 = React$1.forwardRef(function (_a, ref) {
|
|
40233
|
+
var icon = _a.icon, _b = _a.iconColor, iconColor = _b === void 0 ? '#ffffff' : _b, label = _a.label, badge = _a.badge, hide = _a.hide, onClick = _a.onClick, _c = _a["data-testid"], dataTestId = _c === void 0 ? 'menu-item' : _c, children = _a.children;
|
|
40234
|
+
var menuItemClasses = clsx$1('LuiHeaderV2-menu-item', hide && buildHideClassDict(hide));
|
|
40235
|
+
var resolvedIcon = !icon && !label ? 'ic_menu' : icon;
|
|
40236
|
+
return (React__default["default"].createElement("div", { className: menuItemClasses, ref: ref },
|
|
40237
|
+
React__default["default"].createElement("div", { className: "LuiHeaderV2-menu-button" },
|
|
40238
|
+
resolvedIcon && (React__default["default"].createElement("div", { className: clsx$1('LuiHeaderV2-menu-icon', onClick && 'clickable'), "data-testid": dataTestId, onClick: onClick },
|
|
40239
|
+
React__default["default"].createElement(LuiIcon, { size: "lg", name: resolvedIcon, alt: '', color: iconColor }))),
|
|
40240
|
+
label && (React__default["default"].createElement("div", { className: clsx$1(onClick && 'clickable', { 'LuiHeaderV2-menu-label': !!resolvedIcon }, { 'LuiHeaderV2-menu-label-only': !resolvedIcon }), onClick: onClick }, label)),
|
|
40241
|
+
badge && React__default["default"].createElement("div", { className: "LuiHeaderV2-badge" }, badge)),
|
|
40242
|
+
!!children && children));
|
|
40243
|
+
});
|
|
40244
|
+
var LuiCloseableHeaderMenuItemV2 = function (_a) {
|
|
40245
|
+
var open = _a.open, setOpen = _a.setOpen, children = _a.children, props = __rest$1(_a, ["open", "setOpen", "children"]);
|
|
40246
|
+
useEscapeFunction(function () { return setOpen(false); });
|
|
40247
|
+
var menuDiv = usePageClickFunction(function (event) { return open || event.stopPropagation(); }, function (event) {
|
|
40248
|
+
if (!open) {
|
|
40249
|
+
event.stopPropagation();
|
|
40250
|
+
setOpen(false);
|
|
40251
|
+
}
|
|
40252
|
+
});
|
|
40253
|
+
var menuControls = {
|
|
40254
|
+
isOpen: function () { return open; },
|
|
40255
|
+
open: function () { return setOpen(!open); },
|
|
40256
|
+
close: function () { return setOpen(false); }
|
|
40257
|
+
};
|
|
40258
|
+
var menuItemProps = __assign$3({ onClick: function () { return menuControls.open(); } }, props);
|
|
40259
|
+
return (React__default["default"].createElement(LuiCloseableHeaderMenuContext.Provider, { value: menuControls },
|
|
40260
|
+
React__default["default"].createElement(LuiHeaderMenuItemV2, __assign$3({ ref: menuDiv }, menuItemProps), !!children && children)));
|
|
40261
|
+
};
|
|
40262
|
+
|
|
40263
|
+
/**
|
|
40264
|
+
* @deprecated replaced by LuiDrawerMenuOptionsV2
|
|
40265
|
+
*/
|
|
40192
40266
|
var LuiDrawerMenuOptions = function (_a) {
|
|
40193
40267
|
var children = _a.children;
|
|
40268
|
+
useDeprecatedWarning('LuiDrawerMenuOptions');
|
|
40194
40269
|
return React__default["default"].createElement("div", { className: "lui-menu-drawer-options" }, children);
|
|
40195
40270
|
};
|
|
40271
|
+
/**
|
|
40272
|
+
* @deprecated replaced by LuiDrawerMenuOptionV2
|
|
40273
|
+
*/
|
|
40196
40274
|
var LuiDrawerMenuOption = function (_a) {
|
|
40197
40275
|
var icon = _a.icon, label = _a.label, badge = _a.badge, _b = _a.onClick, onClick = _b === void 0 ? function () { } : _b;
|
|
40276
|
+
useDeprecatedWarning('LuiDrawerMenuOption');
|
|
40198
40277
|
var menu = React$1.useContext(LuiCloseableHeaderMenuContext);
|
|
40199
40278
|
return (React__default["default"].createElement("div", { className: "lui-menu-drawer-option", onClick: function () {
|
|
40200
40279
|
menu.close();
|
|
@@ -40205,8 +40284,12 @@ var LuiDrawerMenuOption = function (_a) {
|
|
|
40205
40284
|
label),
|
|
40206
40285
|
badge));
|
|
40207
40286
|
};
|
|
40287
|
+
/**
|
|
40288
|
+
* @deprecated replaced by LuiDrawerMenuV2
|
|
40289
|
+
*/
|
|
40208
40290
|
var LuiDrawerMenu = function (_a) {
|
|
40209
40291
|
var restOfProps = __rest$1(_a, []);
|
|
40292
|
+
useDeprecatedWarning('LuiDrawerMenu');
|
|
40210
40293
|
var children = restOfProps.children, _b = restOfProps.hasStickyHeader, hasStickyHeader = _b === void 0 ? true : _b, menuPropsCopy = __rest$1(restOfProps, ["children", "hasStickyHeader"]);
|
|
40211
40294
|
var _c = React$1.useState(false), open = _c[0], setOpen = _c[1];
|
|
40212
40295
|
var closeableMenuProps = __assign$3(__assign$3({}, menuPropsCopy), { open: open, setOpen: setOpen, icon: open ? 'close' : 'menu', onClick: function () { return setOpen(!open); } });
|
|
@@ -40229,8 +40312,12 @@ var LuiDrawerMenu = function (_a) {
|
|
|
40229
40312
|
'lui-menu-drawer-closed': !open
|
|
40230
40313
|
}), "data-testid": 'drawer', "aria-hidden": !open }, children)));
|
|
40231
40314
|
};
|
|
40315
|
+
/**
|
|
40316
|
+
* @deprecated replaced by LuiDropdownMenuV2
|
|
40317
|
+
*/
|
|
40232
40318
|
var LuiDropdownMenu = function (_a) {
|
|
40233
40319
|
var restOfProps = __rest$1(_a, []);
|
|
40320
|
+
useDeprecatedWarning('LuiDropdownMenu');
|
|
40234
40321
|
var children = restOfProps.children, menuPropsCopy = __rest$1(restOfProps, ["children"]);
|
|
40235
40322
|
var _b = React$1.useState(false), open = _b[0], setOpen = _b[1];
|
|
40236
40323
|
var closeableMenuProps = __assign$3(__assign$3({}, menuPropsCopy), { open: open, setOpen: setOpen });
|
|
@@ -40256,6 +40343,82 @@ var LuiDrawerMenuDivider = function () {
|
|
|
40256
40343
|
return React__default["default"].createElement("hr", { className: "LuiDrawerMenuDivider" });
|
|
40257
40344
|
};
|
|
40258
40345
|
|
|
40346
|
+
var LuiDrawerMenuOptionsV2 = function (_a) {
|
|
40347
|
+
var children = _a.children;
|
|
40348
|
+
return (React__default["default"].createElement("div", { className: "LuiHeaderMenuV2-drawer-options" }, children));
|
|
40349
|
+
};
|
|
40350
|
+
var LuiDrawerMenuOptionV2 = function (_a) {
|
|
40351
|
+
var icon = _a.icon, iconColor = _a.iconColor, label = _a.label, badge = _a.badge, _b = _a.iconSize, iconSize = _b === void 0 ? 'md' : _b, _c = _a.onClick, onClick = _c === void 0 ? function () { } : _c;
|
|
40352
|
+
var menu = React$1.useContext(LuiCloseableHeaderMenuContext);
|
|
40353
|
+
return (React__default["default"].createElement("div", { className: "LuiHeaderMenuV2-drawer-option", onClick: function () {
|
|
40354
|
+
menu.close();
|
|
40355
|
+
onClick();
|
|
40356
|
+
}, "data-testid": 'drawer-option' },
|
|
40357
|
+
React__default["default"].createElement("div", { className: "LuiHeaderMenuV2-drawer-option-label" },
|
|
40358
|
+
typeof icon === 'string' ? (React__default["default"].createElement(LuiIcon, { size: iconSize, name: icon, alt: '', color: iconColor, "data-testid": 'drawer-option-icon' })) : (icon),
|
|
40359
|
+
label),
|
|
40360
|
+
badge));
|
|
40361
|
+
};
|
|
40362
|
+
var LuiDrawerMenuV2 = function (_a) {
|
|
40363
|
+
var children = _a.children, _b = _a.hasStickyHeader, hasStickyHeader = _b === void 0 ? true : _b, menuPropsCopy = __rest$1(_a, ["children", "hasStickyHeader"]);
|
|
40364
|
+
var _c = React$1.useState(false), open = _c[0], setOpen = _c[1];
|
|
40365
|
+
var closeableMenuProps = __assign$3(__assign$3({}, menuPropsCopy), { open: open, setOpen: setOpen, icon: open ? 'ic_clear' : 'ic_menu', onClick: function () { return setOpen(!open); } });
|
|
40366
|
+
React$1.useEffect(function () {
|
|
40367
|
+
// Support for non-sticky headers. Scroll back to top when menu is opened
|
|
40368
|
+
if (open && !hasStickyHeader) {
|
|
40369
|
+
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
40370
|
+
}
|
|
40371
|
+
// Disable page scrolling while menu is open
|
|
40372
|
+
if (open) {
|
|
40373
|
+
document.body.classList.add('LuiHeaderMenuV2-drawer-open');
|
|
40374
|
+
}
|
|
40375
|
+
else {
|
|
40376
|
+
document.body.classList.remove('LuiHeaderMenuV2-drawer-open');
|
|
40377
|
+
}
|
|
40378
|
+
}, [open, hasStickyHeader]);
|
|
40379
|
+
return (React__default["default"].createElement(LuiCloseableHeaderMenuItemV2, __assign$3({}, closeableMenuProps),
|
|
40380
|
+
React__default["default"].createElement("div", { className: clsx$1({
|
|
40381
|
+
'LuiHeaderMenuV2-drawer': true,
|
|
40382
|
+
'LuiHeaderMenuV2-drawer-closed': !open
|
|
40383
|
+
}), "data-testid": 'drawer', "aria-hidden": !open }, children)));
|
|
40384
|
+
};
|
|
40385
|
+
var LuiDropdownMenuV2 = function (_a) {
|
|
40386
|
+
var restOfProps = __rest$1(_a, []);
|
|
40387
|
+
var children = restOfProps.children, _b = restOfProps.anchorOrigin, _c = _b === void 0 ? {
|
|
40388
|
+
horizontal: 'left'
|
|
40389
|
+
} : _b, _d = _c.horizontal, horizontal = _d === void 0 ? 'left' : _d, _e = restOfProps.size, size = _e === void 0 ? 'md' : _e, menuPropsCopy = __rest$1(restOfProps, ["children", "anchorOrigin", "size"]);
|
|
40390
|
+
var _f = React$1.useState(null), open = _f[0], setOpen = _f[1];
|
|
40391
|
+
var closeableMenuProps = __assign$3(__assign$3({}, menuPropsCopy), { open: open || false, setOpen: function (currentOpen) {
|
|
40392
|
+
setOpen(function (preOpen) {
|
|
40393
|
+
if (preOpen !== null) {
|
|
40394
|
+
return currentOpen;
|
|
40395
|
+
}
|
|
40396
|
+
// if the menu was not opened before, then ignore close event,
|
|
40397
|
+
// thus apply -closed animation css only if the menu is closed from the open state
|
|
40398
|
+
return currentOpen || null;
|
|
40399
|
+
});
|
|
40400
|
+
} });
|
|
40401
|
+
return (React__default["default"].createElement(LuiCloseableHeaderMenuItemV2, __assign$3({}, closeableMenuProps),
|
|
40402
|
+
React__default["default"].createElement("div", { className: "LuiHeaderMenuV2-dropdown-container" },
|
|
40403
|
+
React__default["default"].createElement("div", { className: clsx$1('LuiHeaderMenuV2-dropdown', 'lui-box-shadow', { 'anchor-horizontal-icon-left': horizontal === 'left' }, {
|
|
40404
|
+
'anchor-horizontal-icon-right': !menuPropsCopy.label && horizontal === 'right'
|
|
40405
|
+
}, {
|
|
40406
|
+
'anchor-horizontal-label-right': menuPropsCopy.label && horizontal === 'right'
|
|
40407
|
+
}, "dropdown-".concat(size), {
|
|
40408
|
+
'LuiHeaderMenuV2-dropdown-open': open
|
|
40409
|
+
}, {
|
|
40410
|
+
'LuiHeaderMenuV2-dropdown-closed': open !== null && !open
|
|
40411
|
+
}), "data-testid": 'dropdown', "aria-hidden": !open },
|
|
40412
|
+
children,
|
|
40413
|
+
' '))));
|
|
40414
|
+
};
|
|
40415
|
+
var LuiDrawerMenuSectionV2 = function (props) {
|
|
40416
|
+
return React__default["default"].createElement(LuiDrawerMenuSection, __assign$3({}, props));
|
|
40417
|
+
};
|
|
40418
|
+
var LuiDrawerMenuDividerV2 = function () {
|
|
40419
|
+
return React__default["default"].createElement(LuiDrawerMenuDivider, null);
|
|
40420
|
+
};
|
|
40421
|
+
|
|
40259
40422
|
var lib = {exports: {}};
|
|
40260
40423
|
|
|
40261
40424
|
var Modal$2 = {};
|
|
@@ -57988,6 +58151,34 @@ function LuiSideMenuItem(_a) {
|
|
|
57988
58151
|
React__default["default"].createElement("span", { className: "navText" }, label))));
|
|
57989
58152
|
}
|
|
57990
58153
|
|
|
58154
|
+
var breakpoints = {
|
|
58155
|
+
sm: 480,
|
|
58156
|
+
md: 768,
|
|
58157
|
+
lg: 1024,
|
|
58158
|
+
xl: 1280,
|
|
58159
|
+
xxl: 1600
|
|
58160
|
+
};
|
|
58161
|
+
var breakpointQuery = {
|
|
58162
|
+
up: function (bp) { return "(min-width: ".concat(breakpoints[bp], "px)"); },
|
|
58163
|
+
down: function (bp) { return "(max-width: ".concat(breakpoints[bp], "px)"); },
|
|
58164
|
+
between: function (bp1, bp2) {
|
|
58165
|
+
return "(min-width: ".concat(breakpoints[bp1], "px) and (max-width: ").concat(breakpoints[bp2], "px)");
|
|
58166
|
+
}
|
|
58167
|
+
};
|
|
58168
|
+
var useMediaQuery = function (query) {
|
|
58169
|
+
var _a = React$1.useState(false), matches = _a[0], setMatches = _a[1];
|
|
58170
|
+
React$1.useEffect(function () {
|
|
58171
|
+
var media = window.matchMedia(query);
|
|
58172
|
+
if (media.matches !== matches) {
|
|
58173
|
+
setMatches(media.matches);
|
|
58174
|
+
}
|
|
58175
|
+
var listener = function () { return setMatches(media.matches); };
|
|
58176
|
+
window.addEventListener('resize', listener);
|
|
58177
|
+
return function () { return window.removeEventListener('resize', listener); };
|
|
58178
|
+
}, [matches, query]);
|
|
58179
|
+
return matches;
|
|
58180
|
+
};
|
|
58181
|
+
|
|
57991
58182
|
exports.CheckboxItemRenderer = CheckboxItemRenderer;
|
|
57992
58183
|
exports.FIRM_KEY = FIRM_KEY;
|
|
57993
58184
|
exports.FIRM_NAME_KEY = FIRM_NAME_KEY;
|
|
@@ -58020,14 +58211,21 @@ exports.LuiButtonGroup = LuiButtonGroup;
|
|
|
58020
58211
|
exports.LuiCheckboxInput = LuiCheckboxInput;
|
|
58021
58212
|
exports.LuiCloseableHeaderMenuContext = LuiCloseableHeaderMenuContext;
|
|
58022
58213
|
exports.LuiCloseableHeaderMenuItem = LuiCloseableHeaderMenuItem;
|
|
58214
|
+
exports.LuiCloseableHeaderMenuItemV2 = LuiCloseableHeaderMenuItemV2;
|
|
58023
58215
|
exports.LuiComboSelect = LuiComboSelect;
|
|
58024
58216
|
exports.LuiControlledMenu = LuiControlledMenu;
|
|
58025
58217
|
exports.LuiDrawerMenu = LuiDrawerMenu;
|
|
58026
58218
|
exports.LuiDrawerMenuDivider = LuiDrawerMenuDivider;
|
|
58219
|
+
exports.LuiDrawerMenuDividerV2 = LuiDrawerMenuDividerV2;
|
|
58027
58220
|
exports.LuiDrawerMenuOption = LuiDrawerMenuOption;
|
|
58221
|
+
exports.LuiDrawerMenuOptionV2 = LuiDrawerMenuOptionV2;
|
|
58028
58222
|
exports.LuiDrawerMenuOptions = LuiDrawerMenuOptions;
|
|
58223
|
+
exports.LuiDrawerMenuOptionsV2 = LuiDrawerMenuOptionsV2;
|
|
58029
58224
|
exports.LuiDrawerMenuSection = LuiDrawerMenuSection;
|
|
58225
|
+
exports.LuiDrawerMenuSectionV2 = LuiDrawerMenuSectionV2;
|
|
58226
|
+
exports.LuiDrawerMenuV2 = LuiDrawerMenuV2;
|
|
58030
58227
|
exports.LuiDropdownMenu = LuiDropdownMenu;
|
|
58228
|
+
exports.LuiDropdownMenuV2 = LuiDropdownMenuV2;
|
|
58031
58229
|
exports.LuiErrorPage = LuiErrorPage;
|
|
58032
58230
|
exports.LuiExpandableBanner = LuiExpandableBanner;
|
|
58033
58231
|
exports.LuiFileInputBox = LuiFileInputBox;
|
|
@@ -58047,6 +58245,8 @@ exports.LuiFormikSelect = LuiFormikSelect;
|
|
|
58047
58245
|
exports.LuiFormikTextInput = LuiFormikTextInput;
|
|
58048
58246
|
exports.LuiHeader = LuiHeader;
|
|
58049
58247
|
exports.LuiHeaderMenuItem = LuiHeaderMenuItem;
|
|
58248
|
+
exports.LuiHeaderMenuItemV2 = LuiHeaderMenuItemV2;
|
|
58249
|
+
exports.LuiHeaderV2 = LuiHeaderV2;
|
|
58050
58250
|
exports.LuiIcon = LuiIcon;
|
|
58051
58251
|
exports.LuiListBox = LuiListBox;
|
|
58052
58252
|
exports.LuiLoadingSpinner = LuiLoadingSpinner;
|
|
@@ -58086,11 +58286,14 @@ exports.LuiToastMessage = LuiToastMessage;
|
|
|
58086
58286
|
exports.LuiTooltip = LuiTooltip;
|
|
58087
58287
|
exports.LuiUpdatesSplashModal = LuiUpdatesSplashModal;
|
|
58088
58288
|
exports.RadioItemRenderer = RadioItemRenderer;
|
|
58289
|
+
exports.breakpointQuery = breakpointQuery;
|
|
58290
|
+
exports.breakpoints = breakpoints;
|
|
58089
58291
|
exports.getDefaultSearchMenuOptions = getDefaultSearchMenuOptions;
|
|
58090
58292
|
exports.isChromatic = isChromatic;
|
|
58091
58293
|
exports.useClickedOutsideElement = useClickedOutsideElement;
|
|
58092
58294
|
exports.useLOLGlobalClientRefContext = useLOLGlobalClientRefContext;
|
|
58093
58295
|
exports.useLOLUserContext = useLOLUserContext;
|
|
58094
58296
|
exports.useLuiFloatingWindow = useFloatingWindow;
|
|
58297
|
+
exports.useMediaQuery = useMediaQuery;
|
|
58095
58298
|
exports.useShowLUIMessage = useShowLUIMessage;
|
|
58096
58299
|
//# sourceMappingURL=index.js.map
|