carbon-react 153.5.1 → 153.6.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/esm/components/icon/fonts/carbon-icons-webfont.woff +0 -0
- package/esm/components/icon/fonts/carbon-icons-webfont.woff2 +0 -0
- package/esm/components/icon/icon-config.js +1 -1
- package/esm/components/icon/icon-type.d.ts +1 -1
- package/esm/components/icon/icon-unicodes.d.ts +15 -0
- package/esm/components/icon/icon-unicodes.js +16 -1
- package/esm/components/loader/loader-square.style.d.ts +1 -0
- package/esm/components/loader/loader-square.style.js +4 -5
- package/esm/components/loader/loader.component.js +7 -4
- package/esm/components/loader-bar/loader-bar.component.d.ts +1 -1
- package/esm/components/loader-bar/loader-bar.component.js +6 -3
- package/esm/components/loader-spinner/loader-spinner.component.d.ts +1 -1
- package/esm/components/loader-spinner/loader-spinner.component.js +6 -3
- package/esm/components/loader-star/loader-star.component.d.ts +1 -1
- package/esm/components/loader-star/loader-star.component.js +6 -3
- package/esm/hooks/useMediaQuery/useMediaQuery.d.ts +1 -1
- package/esm/hooks/useMediaQuery/useMediaQuery.js +12 -7
- package/esm/style/assets/carbon-icons-webfont.woff +0 -0
- package/esm/style/assets/carbon-icons-webfont.woff2 +0 -0
- package/lib/components/icon/fonts/carbon-icons-webfont.woff +0 -0
- package/lib/components/icon/fonts/carbon-icons-webfont.woff2 +0 -0
- package/lib/components/icon/icon-config.js +1 -1
- package/lib/components/icon/icon-type.d.ts +1 -1
- package/lib/components/icon/icon-unicodes.d.ts +15 -0
- package/lib/components/icon/icon-unicodes.js +16 -1
- package/lib/components/loader/loader-square.style.d.ts +1 -0
- package/lib/components/loader/loader-square.style.js +5 -6
- package/lib/components/loader/loader.component.js +9 -4
- package/lib/components/loader-bar/loader-bar.component.d.ts +1 -1
- package/lib/components/loader-bar/loader-bar.component.js +6 -3
- package/lib/components/loader-spinner/loader-spinner.component.d.ts +1 -1
- package/lib/components/loader-spinner/loader-spinner.component.js +6 -3
- package/lib/components/loader-star/loader-star.component.d.ts +1 -1
- package/lib/components/loader-star/loader-star.component.js +6 -3
- package/lib/hooks/useMediaQuery/useMediaQuery.d.ts +1 -1
- package/lib/hooks/useMediaQuery/useMediaQuery.js +12 -8
- package/lib/style/assets/carbon-icons-webfont.woff +0 -0
- package/lib/style/assets/carbon-icons-webfont.woff2 +0 -0
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
@@ -22,5 +22,5 @@ export const ICON_TOOLTIP_POSITIONS = ["bottom", "left", "right", "top"];
|
|
|
22
22
|
export const ICON_SHAPES = ["circle", "rounded-rect", "square"];
|
|
23
23
|
export const ICON_SIZES = ["small", "medium", "large", "extra-large"];
|
|
24
24
|
export const ICON_FONT_SIZES = ["small", "medium", "large", "extra-large"];
|
|
25
|
-
export const ICONS = ["accessibility_web", "add", "admin", "alert", "alert_on", "analysis", "app_facebook", "app_instagram", "app_tiktok", "app_twitter", "app_youtube", "apps", "arrow", "arrow_bottom_right_circle", "arrow_down", "arrow_left", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_right", "arrow_right_small", "arrow_top_left_circle", "arrow_up", "arrows_left_right", "attach", "bank", "bank_with_card", "basket", "basket_with_squares", "bed", "bill_paid", "bill_unpaid", "bin", "biometric", "blocked", "blocked_square", "block_arrow_right", "bold", "box_arrow_left", "box_arrow_right", "boxed_shapes", "bulk_destroy", "bullet_list", "bullet_list_dotted", "bullet_list_numbers", "business", "calendar", "calendar_today", "call", "calendar_pay_date", "camera", "car_lock", "car_money", "car_repair", "card_view", "card_wallet", "caret_down", "caret_left", "caret_right", "caret_up", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "cart", "cash", "chat", "chart_bar", "chart_line", "chart_pie", "chat_notes", "check_all", "check_none", "chevron_down", "chevron_left", "chevron_right", "chevron_up", "chevron_down_thick", "chevron_left_thick", "chevron_right_thick", "chevron_up_thick", "circle_with_dots", "circles_connection", "clock", "close", "cloud_co2", "coins", "collaborate", "computer_clock", "connect", "connect_off", "construction", "contacts", "contact_card", "copy", "create", "credit_card", "credit_card_slash", "cross", "cross_circle", "csv", "dashboard", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "drag", "drag_vertical", "draft", "drill", "dropdown", "duplicate", "edit", "edited", "email", "email_switch", "entry", "ellipsis_horizontal", "ellipsis_vertical", "envelope_dollar", "envelope_euro", "error", "error_square", "euro", "expand", "export", "factory", "favourite", "favourite_lined", "fax", "feedback", "file_excel", "file_generic", "file_image", "file_pdf", "file_word", "files_leaning", "filter", "filter_new", "fit_height", "fit_width", "flag", "folder", "form_refresh", "gift", "go", "graduation_hat", "graph", "grid", "heart_pulse", "help", "hide", "hand_cash_coins", "hand_cash_note", "home", "image", "import", "in_progress", "in_transit", "individual", "info", "intranet", "italic", "job_seeked", "key", "laptop", "leaf", "ledger", "ledger_arrow_left", "ledger_arrow_right", "lightbulb_off", "lightbulb_on", "like", "like_no", "link", "link_cloud", "link_on", "list_view", "locked", "location", "logout", "lookup", "marker", "message", "microphone", "minimise", "minus", "minus_large", "mobile", "money_bag", "none", "old_warning", "palm_tree", "pause", "pause_circle", "petrol_pump", "pdf", "pin", "people", "people_switch", "percentage_boxed", "person", "person_info", "person_tick", "phone", "piggy_bank", "plane", "play", "play_circle", "plus", "plus_large", "pound", "print", "progress", "progressed", "protect", "question", "question_hollow", "question_mark", "recruiting", "refresh", "refresh_clock", "remove", "sage_coin", "save", "scan", "search", "send", "services", "settings", "settings_old", "share", "shield_with_tick", "shield_with_tick_outline", "shop", "sort_down", "sort_up", "spanner", "split", "split_container", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "stop", "stop_circle", "submitted", "support_online", "sync", "tag", "talk", "target", "target_man", "theatre_masks", "three_boxes", "tick", "tick_circle", "tick_thick", "true_tick", "u_turn_left", "u_turn_right", "undo", "unlocked", "upload", "uploaded", "video", "view", "volunteering", "warning", "website", "welfare", "worldwide_location"];
|
|
25
|
+
export const ICONS = ["accessibility_web", "add", "admin", "airplay", "alert", "alert_on", "analysis", "app_facebook", "app_instagram", "app_tiktok", "app_twitter", "app_youtube", "apps", "arrow", "arrow_bottom_right_circle", "arrow_down", "arrow_left", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_right", "arrow_right_small", "arrow_top_left_circle", "arrow_up", "arrows_left_right", "attach", "bank", "bank_with_card", "basket", "basket_with_squares", "batch", "bed", "bill_paid", "bill_unpaid", "bin", "biometric", "blocked", "blocked_square", "block_arrow_right", "bold", "box_arrow_left", "box_arrow_right", "boxed_shapes", "bulk_destroy", "bullet_list", "bullet_list_dotted", "bullet_list_numbers", "business", "calendar", "calendar_today", "call", "calendar_pay_date", "camera", "car_lock", "car_money", "car_repair", "card_view", "card_wallet", "caret_down", "caret_left", "caret_right", "caret_up", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "cart", "cash", "chat", "chart_bar", "chart_line", "chart_pie", "chat_notes", "check_all", "check_none", "chevron_down", "chevron_left", "chevron_right", "chevron_up", "chevron_down_thick", "chevron_left_thick", "chevron_right_thick", "chevron_up_thick", "chromecast", "circle_with_dots", "circles_connection", "clock", "close", "cloud_co2", "coins", "collaborate", "computer_clock", "connect", "connect_off", "construction", "contacts", "contact_card", "copy", "create", "credit_card", "credit_card_slash", "cross", "cross_circle", "csv", "dashboard", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "drag", "drag_vertical", "draft", "drill", "dropdown", "duplicate", "edit", "edited", "email", "email_switch", "entry", "ellipsis_horizontal", "ellipsis_vertical", "envelope_dollar", "envelope_euro", "error", "error_square", "euro", "expand", "export", "factory", "favourite", "favourite_lined", "fax", "feedback", "file_excel", "file_generic", "file_image", "file_pdf", "file_word", "files_leaning", "filter", "filter_new", "fit_height", "fit_width", "flag", "folder", "form_refresh", "framerate", "fullscreen", "gift", "go", "graduation_hat", "graph", "grid", "heart_pulse", "help", "hide", "hand_cash_coins", "hand_cash_note", "home", "image", "import", "in_progress", "in_transit", "individual", "info", "intranet", "italic", "job_seeked", "key", "laptop", "leaf", "ledger", "ledger_arrow_left", "ledger_arrow_right", "lightbulb_off", "lightbulb_on", "like", "like_no", "link", "link_cloud", "link_on", "list_view", "locked", "location", "logout", "lookup", "marker", "message", "microphone", "minimise", "minus", "minus_large", "mobile", "money_bag", "mute", "none", "normalscreen", "old_warning", "page", "palm_tree", "pause", "pause_circle", "petrol_pump", "pdf", "pin", "people", "people_switch", "percentage_boxed", "person", "person_info", "person_tick", "phone", "picture_in_picture", "piggy_bank", "plane", "play", "play_circle", "plus", "plus_large", "pound", "print", "progress", "progressed", "protect", "question", "question_hollow", "question_mark", "recruiting", "refresh", "refresh_clock", "remove", "replay", "sage_coin", "save", "scan", "search", "send", "services", "settings", "settings_old", "share", "shield_with_tick", "shield_with_tick_outline", "shop", "sort_down", "sort_up", "spanner", "speaker", "split", "split_container", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "stop", "stop_circle", "submitted", "subtitles", "support_online", "sync", "tag", "talk", "target", "target_man", "theatre_masks", "three_boxes", "tick", "tick_circle", "tick_thick", "true_tick", "u_turn_left", "u_turn_right", "undo", "unlocked", "upload", "uploaded", "video", "view", "volume_high", "volume_low", "volume_medium", "volunteering", "warning", "website", "welfare", "worldwide_location"];
|
|
26
26
|
export default dlsConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type IconType = "accessibility_web" | "add" | "admin" | "alert" | "alert_on" | "analysis" | "app_facebook" | "app_instagram" | "app_tiktok" | "app_twitter" | "app_youtube" | "apps" | "arrow" | "arrow_bottom_right_circle" | "arrow_down" | "arrow_left" | "arrow_left_boxed" | "arrow_left_right_small" | "arrow_left_small" | "arrow_right" | "arrow_right_small" | "arrow_top_left_circle" | "arrow_up" | "arrows_left_right" | "attach" | "bank" | "bank_with_card" | "basket" | "basket_with_squares" | "bed" | "bill_paid" | "bill_unpaid" | "bin" | "biometric" | "blocked" | "blocked_square" | "block_arrow_right" | "bold" | "box_arrow_left" | "box_arrow_right" | "boxed_shapes" | "bulk_destroy" | "bullet_list" | "bullet_list_dotted" | "bullet_list_numbers" | "business" | "calendar" | "calendar_pay_date" | "calendar_today" | "call" | "camera" | "car_lock" | "car_money" | "car_repair" | "card_wallet" | "card_view" | "caret_down" | "caret_left" | "caret_right" | "caret_up" | "caret_large_down" | "caret_large_left" | "caret_large_right" | "caret_large_up" | "cart" | "cash" | "chat" | "chart_bar" | "chart_line" | "chart_pie" | "chat_notes" | "check_all" | "check_none" | "chevron_down" | "chevron_left" | "chevron_right" | "chevron_up" | "chevron_down_thick" | "chevron_left_thick" | "chevron_right_thick" | "chevron_up_thick" | "circle_with_dots" | "circles_connection" | "clock" | "close" | "cloud_co2" | "coins" | "collaborate" | "computer_clock" | "connect" | "connect_off" | "construction" | "contacts" | "contact_card" | "copy" | "create" | "credit_card" | "credit_card_slash" | "cross" | "cross_circle" | "csv" | "dashboard" | "delete" | "delivery" | "disputed" | "disconnect" | "document_right_align" | "document_tick" | "document_vertical_lines" | "download" | "drag" | "drag_vertical" | "draft" | "drill" | "dropdown" | "duplicate" | "edit" | "edited" | "email" | "email_switch" | "entry" | "envelope_dollar" | "envelope_euro" | "ellipsis_horizontal" | "ellipsis_vertical" | "error" | "error_square" | "euro" | "expand" | "export" | "factory" | "favourite" | "favourite_lined" | "fax" | "feedback" | "file_excel" | "file_generic" | "file_image" | "file_pdf" | "file_word" | "files_leaning" | "filter" | "filter_new" | "fit_height" | "fit_width" | "flag" | "folder" | "form_refresh" | "gift" | "go" | "graduation_hat" | "graph" | "grid" | "hand_cash_coins" | "hand_cash_note" | "heart_pulse" | "help" | "hide" | "home" | "image" | "import" | "in_progress" | "in_transit" | "individual" | "info" | "intranet" | "italic" | "job_seeked" | "key" | "laptop" | "leaf" | "ledger" | "ledger_arrow_left" | "ledger_arrow_right" | "like" | "like_no" | "link" | "lightbulb_off" | "lightbulb_on" | "link_cloud" | "link_on" | "list_view" | "locked" | "location" | "logout" | "lookup" | "marker" | "message" | "microphone" | "minimise" | "minus" | "minus_large" | "mobile" | "money_bag" | "none" | "old_warning" | "palm_tree" | "pause" | "pause_circle" | "pdf" | "pin" | "people" | "people_switch" | "percentage_boxed" | "person" | "person_info" | "person_tick" | "petrol_pump" | "phone" | "piggy_bank" | "plane" | "play" | "play_circle" | "plus" | "plus_large" | "pound" | "print" | "progress" | "progressed" | "protect" | "question" | "question_hollow" | "question_mark" | "recruiting" | "refresh" | "refresh_clock" | "remove" | "sage_coin" | "save" | "scan" | "send" | "search" | "services" | "settings" | "settings_old" | "share" | "shield_with_tick" | "shield_with_tick_outline" | "shop" | "sort_down" | "sort_up" | "spanner" | "split" | "split_container" | "square_dot" | "squares_nine" | "stacked_boxes" | "stacked_squares" | "stop" | "stop_circle" | "support_online" | "submitted" | "sync" | "tag" | "talk" | "target" | "target_man" | "theatre_masks" | "three_boxes" | "tick" | "tick_circle" | "tick_thick" | "true_tick" | "u_turn_left" | "u_turn_right" | "undo" | "unlocked" | "upload" | "uploaded" | "video" | "view" | "volunteering" | "warning" | "website" | "welfare" | "worldwide_location";
|
|
1
|
+
export type IconType = "accessibility_web" | "add" | "admin" | "airplay" | "alert" | "alert_on" | "analysis" | "app_facebook" | "app_instagram" | "app_tiktok" | "app_twitter" | "app_youtube" | "apps" | "arrow" | "arrow_bottom_right_circle" | "arrow_down" | "arrow_left" | "arrow_left_boxed" | "arrow_left_right_small" | "arrow_left_small" | "arrow_right" | "arrow_right_small" | "arrow_top_left_circle" | "arrow_up" | "arrows_left_right" | "attach" | "bank" | "bank_with_card" | "basket" | "basket_with_squares" | "batch" | "bed" | "bill_paid" | "bill_unpaid" | "bin" | "biometric" | "blocked" | "blocked_square" | "block_arrow_right" | "bold" | "box_arrow_left" | "box_arrow_right" | "boxed_shapes" | "bulk_destroy" | "bullet_list" | "bullet_list_dotted" | "bullet_list_numbers" | "business" | "calendar" | "calendar_pay_date" | "calendar_today" | "call" | "camera" | "car_lock" | "car_money" | "car_repair" | "card_wallet" | "card_view" | "caret_down" | "caret_left" | "caret_right" | "caret_up" | "caret_large_down" | "caret_large_left" | "caret_large_right" | "caret_large_up" | "cart" | "cash" | "chat" | "chart_bar" | "chart_line" | "chart_pie" | "chat_notes" | "check_all" | "check_none" | "chevron_down" | "chevron_left" | "chevron_right" | "chevron_up" | "chevron_down_thick" | "chevron_left_thick" | "chevron_right_thick" | "chevron_up_thick" | "chromecast" | "circle_with_dots" | "circles_connection" | "clock" | "close" | "cloud_co2" | "coins" | "collaborate" | "computer_clock" | "connect" | "connect_off" | "construction" | "contacts" | "contact_card" | "copy" | "create" | "credit_card" | "credit_card_slash" | "cross" | "cross_circle" | "csv" | "dashboard" | "delete" | "delivery" | "disputed" | "disconnect" | "document_right_align" | "document_tick" | "document_vertical_lines" | "download" | "drag" | "drag_vertical" | "draft" | "drill" | "dropdown" | "duplicate" | "edit" | "edited" | "email" | "email_switch" | "entry" | "envelope_dollar" | "envelope_euro" | "ellipsis_horizontal" | "ellipsis_vertical" | "error" | "error_square" | "euro" | "expand" | "export" | "factory" | "favourite" | "favourite_lined" | "fax" | "feedback" | "file_excel" | "file_generic" | "file_image" | "file_pdf" | "file_word" | "files_leaning" | "filter" | "filter_new" | "fit_height" | "fit_width" | "flag" | "folder" | "form_refresh" | "framerate" | "fullscreen" | "gift" | "go" | "graduation_hat" | "graph" | "grid" | "hand_cash_coins" | "hand_cash_note" | "heart_pulse" | "help" | "hide" | "home" | "image" | "import" | "in_progress" | "in_transit" | "individual" | "info" | "intranet" | "italic" | "job_seeked" | "key" | "laptop" | "leaf" | "ledger" | "ledger_arrow_left" | "ledger_arrow_right" | "like" | "like_no" | "link" | "lightbulb_off" | "lightbulb_on" | "link_cloud" | "link_on" | "list_view" | "locked" | "location" | "logout" | "lookup" | "marker" | "message" | "microphone" | "minimise" | "minus" | "minus_large" | "mobile" | "money_bag" | "mute" | "none" | "normalscreen" | "old_warning" | "page" | "palm_tree" | "pause" | "pause_circle" | "pdf" | "pin" | "people" | "people_switch" | "percentage_boxed" | "person" | "person_info" | "person_tick" | "petrol_pump" | "phone" | "picture_in_picture" | "piggy_bank" | "plane" | "play" | "play_circle" | "plus" | "plus_large" | "pound" | "print" | "progress" | "progressed" | "protect" | "question" | "question_hollow" | "question_mark" | "recruiting" | "refresh" | "refresh_clock" | "remove" | "replay" | "sage_coin" | "save" | "scan" | "send" | "search" | "services" | "settings" | "settings_old" | "share" | "shield_with_tick" | "shield_with_tick_outline" | "shop" | "sort_down" | "sort_up" | "spanner" | "speaker" | "split" | "split_container" | "square_dot" | "squares_nine" | "stacked_boxes" | "stacked_squares" | "stop" | "stop_circle" | "subtitles" | "support_online" | "submitted" | "sync" | "tag" | "talk" | "target" | "target_man" | "theatre_masks" | "three_boxes" | "tick" | "tick_circle" | "tick_thick" | "true_tick" | "u_turn_left" | "u_turn_right" | "undo" | "unlocked" | "upload" | "uploaded" | "video" | "view" | "volume_high" | "volume_low" | "volume_medium" | "volunteering" | "warning" | "website" | "welfare" | "worldwide_location";
|
|
@@ -159,6 +159,21 @@ declare namespace iconUnicodes {
|
|
|
159
159
|
export let stop: string;
|
|
160
160
|
export let stop_circle: string;
|
|
161
161
|
export let worldwide_location: string;
|
|
162
|
+
export let airplay: string;
|
|
163
|
+
export let batch: string;
|
|
164
|
+
export let chromecast: string;
|
|
165
|
+
export let framerate: string;
|
|
166
|
+
export let fullscreen: string;
|
|
167
|
+
export let mute: string;
|
|
168
|
+
export let normalscreen: string;
|
|
169
|
+
export let page: string;
|
|
170
|
+
export let picture_in_picture: string;
|
|
171
|
+
export let replay: string;
|
|
172
|
+
export let speaker: string;
|
|
173
|
+
export let subtitles: string;
|
|
174
|
+
export let volume_high: string;
|
|
175
|
+
export let volume_low: string;
|
|
176
|
+
export let volume_medium: string;
|
|
162
177
|
export let error: string;
|
|
163
178
|
export let warning: string;
|
|
164
179
|
export let tick: string;
|
|
@@ -257,7 +257,22 @@ const misc = {
|
|
|
257
257
|
shield_with_tick_outline: "\\f071",
|
|
258
258
|
stop: "\\f068",
|
|
259
259
|
stop_circle: "\\f069",
|
|
260
|
-
worldwide_location: "\\f072"
|
|
260
|
+
worldwide_location: "\\f072",
|
|
261
|
+
airplay: "\\f073",
|
|
262
|
+
batch: "\\f074",
|
|
263
|
+
chromecast: "\\f075",
|
|
264
|
+
framerate: "\\f076",
|
|
265
|
+
fullscreen: "\\f077",
|
|
266
|
+
mute: "\\f078",
|
|
267
|
+
normalscreen: "\\f079",
|
|
268
|
+
page: "\\f080",
|
|
269
|
+
picture_in_picture: "\\f081",
|
|
270
|
+
replay: "\\f082",
|
|
271
|
+
speaker: "\\f083",
|
|
272
|
+
subtitles: "\\f084",
|
|
273
|
+
volume_high: "\\f087",
|
|
274
|
+
volume_low: "\\f085",
|
|
275
|
+
volume_medium: "\\f086"
|
|
261
276
|
};
|
|
262
277
|
const legacyNames = {
|
|
263
278
|
add: actions.plus,
|
|
@@ -8,5 +8,6 @@ export interface StyledLoaderSquareProps {
|
|
|
8
8
|
/** The background color of each loader square */
|
|
9
9
|
backgroundColor?: string;
|
|
10
10
|
}
|
|
11
|
+
export declare const StyledLoaderPlaceholder: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
12
|
declare const StyledLoaderSquare: import("styled-components").StyledComponent<"div", any, StyledLoaderSquareProps, never>;
|
|
12
13
|
export default StyledLoaderSquare;
|
|
@@ -32,6 +32,10 @@ const getDimensions = size => {
|
|
|
32
32
|
margin-right: ${marginRight};
|
|
33
33
|
`;
|
|
34
34
|
};
|
|
35
|
+
export const StyledLoaderPlaceholder = styled.div`
|
|
36
|
+
display: inline-block;
|
|
37
|
+
min-width: var(--sizing800);
|
|
38
|
+
`;
|
|
35
39
|
const StyledLoaderSquare = styled.div`
|
|
36
40
|
${({
|
|
37
41
|
size,
|
|
@@ -44,19 +48,15 @@ const StyledLoaderSquare = styled.div`
|
|
|
44
48
|
display: inline-block;
|
|
45
49
|
${getDimensions(size)}
|
|
46
50
|
border-radius: var(--borderRadiusCircle);
|
|
47
|
-
|
|
48
51
|
${isInsideButton && css`
|
|
49
52
|
background-color: ${isActive ? "var(--colorsUtilityYang100)" : "var(--colorsSemanticNeutral500)"};
|
|
50
53
|
`}
|
|
51
|
-
|
|
52
54
|
&:nth-of-type(1) {
|
|
53
55
|
animation-delay: 0s;
|
|
54
56
|
}
|
|
55
|
-
|
|
56
57
|
&:nth-of-type(2) {
|
|
57
58
|
animation-delay: 0.2s;
|
|
58
59
|
}
|
|
59
|
-
|
|
60
60
|
&:nth-of-type(3) {
|
|
61
61
|
animation-delay: 0.4s;
|
|
62
62
|
margin-right: 0px;
|
|
@@ -64,7 +64,6 @@ const StyledLoaderSquare = styled.div`
|
|
|
64
64
|
`}
|
|
65
65
|
`;
|
|
66
66
|
StyledLoaderSquare.defaultProps = {
|
|
67
|
-
size: "small",
|
|
68
67
|
isInsideButton: false,
|
|
69
68
|
isActive: true,
|
|
70
69
|
theme: baseTheme
|
|
@@ -5,7 +5,7 @@ import useMediaQuery from "../../hooks/useMediaQuery";
|
|
|
5
5
|
import useLocale from "../../hooks/__internal__/useLocale";
|
|
6
6
|
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
7
7
|
import StyledLoader from "./loader.style";
|
|
8
|
-
import StyledLoaderSquare from "./loader-square.style";
|
|
8
|
+
import StyledLoaderSquare, { StyledLoaderPlaceholder } from "./loader-square.style";
|
|
9
9
|
import Typography from "../typography";
|
|
10
10
|
import Logger from "../../__internal__/utils/logger";
|
|
11
11
|
let deprecateAriaLabelWarnTriggered = false;
|
|
@@ -23,7 +23,10 @@ export const Loader = ({
|
|
|
23
23
|
Logger.deprecate("The aria-label prop in Loader is deprecated and will soon be removed, please use the `loaderLabel` prop instead to provide an accessible label.");
|
|
24
24
|
}
|
|
25
25
|
const l = useLocale();
|
|
26
|
-
const
|
|
26
|
+
const allowMotion = useMediaQuery("screen and (prefers-reduced-motion: no-preference)");
|
|
27
|
+
if (allowMotion === undefined) {
|
|
28
|
+
return /*#__PURE__*/React.createElement(StyledLoaderPlaceholder, null);
|
|
29
|
+
}
|
|
27
30
|
const loaderSquareProps = {
|
|
28
31
|
isInsideButton,
|
|
29
32
|
isActive,
|
|
@@ -32,7 +35,7 @@ export const Loader = ({
|
|
|
32
35
|
};
|
|
33
36
|
|
|
34
37
|
// FE-6368 has been raised for the below, changed hex values for design tokens (when added)
|
|
35
|
-
return /*#__PURE__*/React.createElement(StyledLoader, _extends({}, tagComponent("loader", rest), filterStyledSystemMarginProps(rest)),
|
|
38
|
+
return /*#__PURE__*/React.createElement(StyledLoader, _extends({}, tagComponent("loader", rest), filterStyledSystemMarginProps(rest)), allowMotion ? /*#__PURE__*/React.createElement(React.Fragment, null, ["#13A038", "#0092DB", "#8F49FE"].map(color => /*#__PURE__*/React.createElement(StyledLoaderSquare, _extends({
|
|
36
39
|
"data-role": "loader-square",
|
|
37
40
|
key: color,
|
|
38
41
|
backgroundColor: variant === "gradient" ? /* istanbul ignore next */color : "var(--colorsActionMajor500)"
|
|
@@ -40,6 +43,6 @@ export const Loader = ({
|
|
|
40
43
|
"data-role": "hidden-label",
|
|
41
44
|
variant: "span",
|
|
42
45
|
screenReaderOnly: true
|
|
43
|
-
}, loaderLabel || ariaLabel || l.loader.loading())));
|
|
46
|
+
}, loaderLabel || ariaLabel || l.loader.loading())) : loaderLabel || ariaLabel || l.loader.loading());
|
|
44
47
|
};
|
|
45
48
|
export default Loader;
|
|
@@ -5,7 +5,7 @@ import { StyledLoaderBarProps } from "./loader-bar.style";
|
|
|
5
5
|
export interface LoaderBarProps extends StyledLoaderBarProps, MarginProps, TagProps {
|
|
6
6
|
}
|
|
7
7
|
export declare const LoaderBar: {
|
|
8
|
-
({ size, ...rest }: LoaderBarProps): React.JSX.Element;
|
|
8
|
+
({ size, ...rest }: LoaderBarProps): React.JSX.Element | null;
|
|
9
9
|
DisplayName: string;
|
|
10
10
|
};
|
|
11
11
|
export default LoaderBar;
|
|
@@ -10,17 +10,20 @@ export const LoaderBar = ({
|
|
|
10
10
|
...rest
|
|
11
11
|
}) => {
|
|
12
12
|
const l = useLocale();
|
|
13
|
-
const
|
|
13
|
+
const allowMotion = useMediaQuery("screen and (prefers-reduced-motion: no-preference)");
|
|
14
|
+
if (allowMotion === undefined) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
14
17
|
return /*#__PURE__*/React.createElement(StyledLoader, _extends({
|
|
15
18
|
"aria-label": l.loader.loading(),
|
|
16
19
|
role: "progressbar"
|
|
17
|
-
}, tagComponent("loader-bar", rest), filterStyledSystemMarginProps(rest)),
|
|
20
|
+
}, tagComponent("loader-bar", rest), filterStyledSystemMarginProps(rest)), allowMotion ? /*#__PURE__*/React.createElement(StyledLoaderBar, {
|
|
18
21
|
"data-role": "outer-bar",
|
|
19
22
|
size: size
|
|
20
23
|
}, /*#__PURE__*/React.createElement(InnerBar, {
|
|
21
24
|
"data-role": "inner-bar",
|
|
22
25
|
size: size
|
|
23
|
-
})));
|
|
26
|
+
})) : l.loader.loading());
|
|
24
27
|
};
|
|
25
28
|
LoaderBar.DisplayName = "Loader Bar";
|
|
26
29
|
export default LoaderBar;
|
|
@@ -37,5 +37,5 @@ export interface LoaderSpinnerProps extends MarginProps, TagProps {
|
|
|
37
37
|
*/
|
|
38
38
|
animationTime?: number;
|
|
39
39
|
}
|
|
40
|
-
export declare const LoaderSpinner: ({ spinnerLabel, size, showSpinnerLabel, variant, isTracked, hasMotion, animationTime, ...rest }: LoaderSpinnerProps) => React.JSX.Element;
|
|
40
|
+
export declare const LoaderSpinner: ({ spinnerLabel, size, showSpinnerLabel, variant, isTracked, hasMotion, animationTime, ...rest }: LoaderSpinnerProps) => React.JSX.Element | null;
|
|
41
41
|
export default LoaderSpinner;
|
|
@@ -17,7 +17,10 @@ export const LoaderSpinner = ({
|
|
|
17
17
|
...rest
|
|
18
18
|
}) => {
|
|
19
19
|
const locale = useLocale();
|
|
20
|
-
const
|
|
20
|
+
const allowMotion = useMediaQuery("screen and (prefers-reduced-motion: no-preference)");
|
|
21
|
+
if (allowMotion === undefined) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
21
24
|
const isLabelDark = variant !== "inverse" && variant !== "gradient-white";
|
|
22
25
|
const renderSpinnerLabel = /*#__PURE__*/React.createElement(StyledLabel, {
|
|
23
26
|
"data-role": "visible-label",
|
|
@@ -38,7 +41,7 @@ export const LoaderSpinner = ({
|
|
|
38
41
|
return /*#__PURE__*/React.createElement(StyledSpinnerWrapper, _extends({
|
|
39
42
|
size: size,
|
|
40
43
|
role: "status"
|
|
41
|
-
}, tagComponent("loader-spinner", rest), filterStyledSystemMarginProps(rest)),
|
|
44
|
+
}, tagComponent("loader-spinner", rest), filterStyledSystemMarginProps(rest)), allowMotion ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledSpinnerCircleSvg, {
|
|
42
45
|
role: "presentation",
|
|
43
46
|
size: size,
|
|
44
47
|
variant: variant,
|
|
@@ -55,6 +58,6 @@ export const LoaderSpinner = ({
|
|
|
55
58
|
"data-role": "hidden-label",
|
|
56
59
|
variant: "span",
|
|
57
60
|
screenReaderOnly: true
|
|
58
|
-
}, spinnerLabel || locale.loaderSpinner.loading())));
|
|
61
|
+
}, spinnerLabel || locale.loaderSpinner.loading())) : renderSpinnerLabel);
|
|
59
62
|
};
|
|
60
63
|
export default LoaderSpinner;
|
|
@@ -8,7 +8,7 @@ export interface LoaderStarProps extends TagProps {
|
|
|
8
8
|
loaderStarLabel?: string;
|
|
9
9
|
}
|
|
10
10
|
declare const LoaderStar: {
|
|
11
|
-
({ loaderStarLabel, ...rest }: LoaderStarProps): JSX.Element;
|
|
11
|
+
({ loaderStarLabel, ...rest }: LoaderStarProps): JSX.Element | null;
|
|
12
12
|
displayName: string;
|
|
13
13
|
};
|
|
14
14
|
export default LoaderStar;
|
|
@@ -11,7 +11,10 @@ const LoaderStar = ({
|
|
|
11
11
|
...rest
|
|
12
12
|
}) => {
|
|
13
13
|
const locale = useLocale();
|
|
14
|
-
const
|
|
14
|
+
const allowMotion = useMediaQuery("screen and (prefers-reduced-motion: no-preference)");
|
|
15
|
+
if (allowMotion === undefined) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
15
18
|
const label = /*#__PURE__*/React.createElement(StyledLabel, {
|
|
16
19
|
"data-role": "visible-label",
|
|
17
20
|
variant: "span",
|
|
@@ -19,7 +22,7 @@ const LoaderStar = ({
|
|
|
19
22
|
}, loaderStarLabel || locale.loaderStar.loading());
|
|
20
23
|
return /*#__PURE__*/React.createElement(StyledLoaderStarWrapper, _extends({
|
|
21
24
|
role: "status"
|
|
22
|
-
}, tagComponent("loader-star", rest)),
|
|
25
|
+
}, tagComponent("loader-star", rest)), allowMotion ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledStars, null, /*#__PURE__*/React.createElement(Star, {
|
|
23
26
|
starContainerClassName: "star-1",
|
|
24
27
|
gradientId: "gradient1"
|
|
25
28
|
}), /*#__PURE__*/React.createElement(Star, {
|
|
@@ -32,7 +35,7 @@ const LoaderStar = ({
|
|
|
32
35
|
"data-role": "hidden-label",
|
|
33
36
|
variant: "span",
|
|
34
37
|
screenReaderOnly: true
|
|
35
|
-
}, loaderStarLabel || locale.loaderStar.loading())));
|
|
38
|
+
}, loaderStarLabel || locale.loaderStar.loading())) : label);
|
|
36
39
|
};
|
|
37
40
|
LoaderStar.displayName = "LoaderStar";
|
|
38
41
|
export default LoaderStar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function useMediaQuery(queryInput: string): boolean;
|
|
1
|
+
export default function useMediaQuery(queryInput: string): boolean | undefined;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useLayoutEffect, useState } from "react";
|
|
2
|
+
import { getWindow } from "../../__internal__/dom/globals";
|
|
2
3
|
export default function useMediaQuery(queryInput) {
|
|
3
4
|
const query = queryInput.replace(/^@media( ?)/m, "");
|
|
4
|
-
const [match, setMatch] =
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const [match, setMatch] = useState(undefined);
|
|
6
|
+
useLayoutEffect(() => {
|
|
7
|
+
const browserWindow = getWindow();
|
|
8
|
+
|
|
9
|
+
/* istanbul ignore if */
|
|
10
|
+
if (!browserWindow) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
const queryList = browserWindow.matchMedia(query);
|
|
14
|
+
const updateMatch = () => setMatch(queryList.matches);
|
|
10
15
|
updateMatch();
|
|
11
16
|
queryList.addEventListener("change", updateMatch);
|
|
12
17
|
return () => {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -28,5 +28,5 @@ const ICON_TOOLTIP_POSITIONS = exports.ICON_TOOLTIP_POSITIONS = ["bottom", "left
|
|
|
28
28
|
const ICON_SHAPES = exports.ICON_SHAPES = ["circle", "rounded-rect", "square"];
|
|
29
29
|
const ICON_SIZES = exports.ICON_SIZES = ["small", "medium", "large", "extra-large"];
|
|
30
30
|
const ICON_FONT_SIZES = exports.ICON_FONT_SIZES = ["small", "medium", "large", "extra-large"];
|
|
31
|
-
const ICONS = exports.ICONS = ["accessibility_web", "add", "admin", "alert", "alert_on", "analysis", "app_facebook", "app_instagram", "app_tiktok", "app_twitter", "app_youtube", "apps", "arrow", "arrow_bottom_right_circle", "arrow_down", "arrow_left", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_right", "arrow_right_small", "arrow_top_left_circle", "arrow_up", "arrows_left_right", "attach", "bank", "bank_with_card", "basket", "basket_with_squares", "bed", "bill_paid", "bill_unpaid", "bin", "biometric", "blocked", "blocked_square", "block_arrow_right", "bold", "box_arrow_left", "box_arrow_right", "boxed_shapes", "bulk_destroy", "bullet_list", "bullet_list_dotted", "bullet_list_numbers", "business", "calendar", "calendar_today", "call", "calendar_pay_date", "camera", "car_lock", "car_money", "car_repair", "card_view", "card_wallet", "caret_down", "caret_left", "caret_right", "caret_up", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "cart", "cash", "chat", "chart_bar", "chart_line", "chart_pie", "chat_notes", "check_all", "check_none", "chevron_down", "chevron_left", "chevron_right", "chevron_up", "chevron_down_thick", "chevron_left_thick", "chevron_right_thick", "chevron_up_thick", "circle_with_dots", "circles_connection", "clock", "close", "cloud_co2", "coins", "collaborate", "computer_clock", "connect", "connect_off", "construction", "contacts", "contact_card", "copy", "create", "credit_card", "credit_card_slash", "cross", "cross_circle", "csv", "dashboard", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "drag", "drag_vertical", "draft", "drill", "dropdown", "duplicate", "edit", "edited", "email", "email_switch", "entry", "ellipsis_horizontal", "ellipsis_vertical", "envelope_dollar", "envelope_euro", "error", "error_square", "euro", "expand", "export", "factory", "favourite", "favourite_lined", "fax", "feedback", "file_excel", "file_generic", "file_image", "file_pdf", "file_word", "files_leaning", "filter", "filter_new", "fit_height", "fit_width", "flag", "folder", "form_refresh", "gift", "go", "graduation_hat", "graph", "grid", "heart_pulse", "help", "hide", "hand_cash_coins", "hand_cash_note", "home", "image", "import", "in_progress", "in_transit", "individual", "info", "intranet", "italic", "job_seeked", "key", "laptop", "leaf", "ledger", "ledger_arrow_left", "ledger_arrow_right", "lightbulb_off", "lightbulb_on", "like", "like_no", "link", "link_cloud", "link_on", "list_view", "locked", "location", "logout", "lookup", "marker", "message", "microphone", "minimise", "minus", "minus_large", "mobile", "money_bag", "none", "old_warning", "palm_tree", "pause", "pause_circle", "petrol_pump", "pdf", "pin", "people", "people_switch", "percentage_boxed", "person", "person_info", "person_tick", "phone", "piggy_bank", "plane", "play", "play_circle", "plus", "plus_large", "pound", "print", "progress", "progressed", "protect", "question", "question_hollow", "question_mark", "recruiting", "refresh", "refresh_clock", "remove", "sage_coin", "save", "scan", "search", "send", "services", "settings", "settings_old", "share", "shield_with_tick", "shield_with_tick_outline", "shop", "sort_down", "sort_up", "spanner", "split", "split_container", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "stop", "stop_circle", "submitted", "support_online", "sync", "tag", "talk", "target", "target_man", "theatre_masks", "three_boxes", "tick", "tick_circle", "tick_thick", "true_tick", "u_turn_left", "u_turn_right", "undo", "unlocked", "upload", "uploaded", "video", "view", "volunteering", "warning", "website", "welfare", "worldwide_location"];
|
|
31
|
+
const ICONS = exports.ICONS = ["accessibility_web", "add", "admin", "airplay", "alert", "alert_on", "analysis", "app_facebook", "app_instagram", "app_tiktok", "app_twitter", "app_youtube", "apps", "arrow", "arrow_bottom_right_circle", "arrow_down", "arrow_left", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_right", "arrow_right_small", "arrow_top_left_circle", "arrow_up", "arrows_left_right", "attach", "bank", "bank_with_card", "basket", "basket_with_squares", "batch", "bed", "bill_paid", "bill_unpaid", "bin", "biometric", "blocked", "blocked_square", "block_arrow_right", "bold", "box_arrow_left", "box_arrow_right", "boxed_shapes", "bulk_destroy", "bullet_list", "bullet_list_dotted", "bullet_list_numbers", "business", "calendar", "calendar_today", "call", "calendar_pay_date", "camera", "car_lock", "car_money", "car_repair", "card_view", "card_wallet", "caret_down", "caret_left", "caret_right", "caret_up", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "cart", "cash", "chat", "chart_bar", "chart_line", "chart_pie", "chat_notes", "check_all", "check_none", "chevron_down", "chevron_left", "chevron_right", "chevron_up", "chevron_down_thick", "chevron_left_thick", "chevron_right_thick", "chevron_up_thick", "chromecast", "circle_with_dots", "circles_connection", "clock", "close", "cloud_co2", "coins", "collaborate", "computer_clock", "connect", "connect_off", "construction", "contacts", "contact_card", "copy", "create", "credit_card", "credit_card_slash", "cross", "cross_circle", "csv", "dashboard", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "drag", "drag_vertical", "draft", "drill", "dropdown", "duplicate", "edit", "edited", "email", "email_switch", "entry", "ellipsis_horizontal", "ellipsis_vertical", "envelope_dollar", "envelope_euro", "error", "error_square", "euro", "expand", "export", "factory", "favourite", "favourite_lined", "fax", "feedback", "file_excel", "file_generic", "file_image", "file_pdf", "file_word", "files_leaning", "filter", "filter_new", "fit_height", "fit_width", "flag", "folder", "form_refresh", "framerate", "fullscreen", "gift", "go", "graduation_hat", "graph", "grid", "heart_pulse", "help", "hide", "hand_cash_coins", "hand_cash_note", "home", "image", "import", "in_progress", "in_transit", "individual", "info", "intranet", "italic", "job_seeked", "key", "laptop", "leaf", "ledger", "ledger_arrow_left", "ledger_arrow_right", "lightbulb_off", "lightbulb_on", "like", "like_no", "link", "link_cloud", "link_on", "list_view", "locked", "location", "logout", "lookup", "marker", "message", "microphone", "minimise", "minus", "minus_large", "mobile", "money_bag", "mute", "none", "normalscreen", "old_warning", "page", "palm_tree", "pause", "pause_circle", "petrol_pump", "pdf", "pin", "people", "people_switch", "percentage_boxed", "person", "person_info", "person_tick", "phone", "picture_in_picture", "piggy_bank", "plane", "play", "play_circle", "plus", "plus_large", "pound", "print", "progress", "progressed", "protect", "question", "question_hollow", "question_mark", "recruiting", "refresh", "refresh_clock", "remove", "replay", "sage_coin", "save", "scan", "search", "send", "services", "settings", "settings_old", "share", "shield_with_tick", "shield_with_tick_outline", "shop", "sort_down", "sort_up", "spanner", "speaker", "split", "split_container", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "stop", "stop_circle", "submitted", "subtitles", "support_online", "sync", "tag", "talk", "target", "target_man", "theatre_masks", "three_boxes", "tick", "tick_circle", "tick_thick", "true_tick", "u_turn_left", "u_turn_right", "undo", "unlocked", "upload", "uploaded", "video", "view", "volume_high", "volume_low", "volume_medium", "volunteering", "warning", "website", "welfare", "worldwide_location"];
|
|
32
32
|
var _default = exports.default = dlsConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type IconType = "accessibility_web" | "add" | "admin" | "alert" | "alert_on" | "analysis" | "app_facebook" | "app_instagram" | "app_tiktok" | "app_twitter" | "app_youtube" | "apps" | "arrow" | "arrow_bottom_right_circle" | "arrow_down" | "arrow_left" | "arrow_left_boxed" | "arrow_left_right_small" | "arrow_left_small" | "arrow_right" | "arrow_right_small" | "arrow_top_left_circle" | "arrow_up" | "arrows_left_right" | "attach" | "bank" | "bank_with_card" | "basket" | "basket_with_squares" | "bed" | "bill_paid" | "bill_unpaid" | "bin" | "biometric" | "blocked" | "blocked_square" | "block_arrow_right" | "bold" | "box_arrow_left" | "box_arrow_right" | "boxed_shapes" | "bulk_destroy" | "bullet_list" | "bullet_list_dotted" | "bullet_list_numbers" | "business" | "calendar" | "calendar_pay_date" | "calendar_today" | "call" | "camera" | "car_lock" | "car_money" | "car_repair" | "card_wallet" | "card_view" | "caret_down" | "caret_left" | "caret_right" | "caret_up" | "caret_large_down" | "caret_large_left" | "caret_large_right" | "caret_large_up" | "cart" | "cash" | "chat" | "chart_bar" | "chart_line" | "chart_pie" | "chat_notes" | "check_all" | "check_none" | "chevron_down" | "chevron_left" | "chevron_right" | "chevron_up" | "chevron_down_thick" | "chevron_left_thick" | "chevron_right_thick" | "chevron_up_thick" | "circle_with_dots" | "circles_connection" | "clock" | "close" | "cloud_co2" | "coins" | "collaborate" | "computer_clock" | "connect" | "connect_off" | "construction" | "contacts" | "contact_card" | "copy" | "create" | "credit_card" | "credit_card_slash" | "cross" | "cross_circle" | "csv" | "dashboard" | "delete" | "delivery" | "disputed" | "disconnect" | "document_right_align" | "document_tick" | "document_vertical_lines" | "download" | "drag" | "drag_vertical" | "draft" | "drill" | "dropdown" | "duplicate" | "edit" | "edited" | "email" | "email_switch" | "entry" | "envelope_dollar" | "envelope_euro" | "ellipsis_horizontal" | "ellipsis_vertical" | "error" | "error_square" | "euro" | "expand" | "export" | "factory" | "favourite" | "favourite_lined" | "fax" | "feedback" | "file_excel" | "file_generic" | "file_image" | "file_pdf" | "file_word" | "files_leaning" | "filter" | "filter_new" | "fit_height" | "fit_width" | "flag" | "folder" | "form_refresh" | "gift" | "go" | "graduation_hat" | "graph" | "grid" | "hand_cash_coins" | "hand_cash_note" | "heart_pulse" | "help" | "hide" | "home" | "image" | "import" | "in_progress" | "in_transit" | "individual" | "info" | "intranet" | "italic" | "job_seeked" | "key" | "laptop" | "leaf" | "ledger" | "ledger_arrow_left" | "ledger_arrow_right" | "like" | "like_no" | "link" | "lightbulb_off" | "lightbulb_on" | "link_cloud" | "link_on" | "list_view" | "locked" | "location" | "logout" | "lookup" | "marker" | "message" | "microphone" | "minimise" | "minus" | "minus_large" | "mobile" | "money_bag" | "none" | "old_warning" | "palm_tree" | "pause" | "pause_circle" | "pdf" | "pin" | "people" | "people_switch" | "percentage_boxed" | "person" | "person_info" | "person_tick" | "petrol_pump" | "phone" | "piggy_bank" | "plane" | "play" | "play_circle" | "plus" | "plus_large" | "pound" | "print" | "progress" | "progressed" | "protect" | "question" | "question_hollow" | "question_mark" | "recruiting" | "refresh" | "refresh_clock" | "remove" | "sage_coin" | "save" | "scan" | "send" | "search" | "services" | "settings" | "settings_old" | "share" | "shield_with_tick" | "shield_with_tick_outline" | "shop" | "sort_down" | "sort_up" | "spanner" | "split" | "split_container" | "square_dot" | "squares_nine" | "stacked_boxes" | "stacked_squares" | "stop" | "stop_circle" | "support_online" | "submitted" | "sync" | "tag" | "talk" | "target" | "target_man" | "theatre_masks" | "three_boxes" | "tick" | "tick_circle" | "tick_thick" | "true_tick" | "u_turn_left" | "u_turn_right" | "undo" | "unlocked" | "upload" | "uploaded" | "video" | "view" | "volunteering" | "warning" | "website" | "welfare" | "worldwide_location";
|
|
1
|
+
export type IconType = "accessibility_web" | "add" | "admin" | "airplay" | "alert" | "alert_on" | "analysis" | "app_facebook" | "app_instagram" | "app_tiktok" | "app_twitter" | "app_youtube" | "apps" | "arrow" | "arrow_bottom_right_circle" | "arrow_down" | "arrow_left" | "arrow_left_boxed" | "arrow_left_right_small" | "arrow_left_small" | "arrow_right" | "arrow_right_small" | "arrow_top_left_circle" | "arrow_up" | "arrows_left_right" | "attach" | "bank" | "bank_with_card" | "basket" | "basket_with_squares" | "batch" | "bed" | "bill_paid" | "bill_unpaid" | "bin" | "biometric" | "blocked" | "blocked_square" | "block_arrow_right" | "bold" | "box_arrow_left" | "box_arrow_right" | "boxed_shapes" | "bulk_destroy" | "bullet_list" | "bullet_list_dotted" | "bullet_list_numbers" | "business" | "calendar" | "calendar_pay_date" | "calendar_today" | "call" | "camera" | "car_lock" | "car_money" | "car_repair" | "card_wallet" | "card_view" | "caret_down" | "caret_left" | "caret_right" | "caret_up" | "caret_large_down" | "caret_large_left" | "caret_large_right" | "caret_large_up" | "cart" | "cash" | "chat" | "chart_bar" | "chart_line" | "chart_pie" | "chat_notes" | "check_all" | "check_none" | "chevron_down" | "chevron_left" | "chevron_right" | "chevron_up" | "chevron_down_thick" | "chevron_left_thick" | "chevron_right_thick" | "chevron_up_thick" | "chromecast" | "circle_with_dots" | "circles_connection" | "clock" | "close" | "cloud_co2" | "coins" | "collaborate" | "computer_clock" | "connect" | "connect_off" | "construction" | "contacts" | "contact_card" | "copy" | "create" | "credit_card" | "credit_card_slash" | "cross" | "cross_circle" | "csv" | "dashboard" | "delete" | "delivery" | "disputed" | "disconnect" | "document_right_align" | "document_tick" | "document_vertical_lines" | "download" | "drag" | "drag_vertical" | "draft" | "drill" | "dropdown" | "duplicate" | "edit" | "edited" | "email" | "email_switch" | "entry" | "envelope_dollar" | "envelope_euro" | "ellipsis_horizontal" | "ellipsis_vertical" | "error" | "error_square" | "euro" | "expand" | "export" | "factory" | "favourite" | "favourite_lined" | "fax" | "feedback" | "file_excel" | "file_generic" | "file_image" | "file_pdf" | "file_word" | "files_leaning" | "filter" | "filter_new" | "fit_height" | "fit_width" | "flag" | "folder" | "form_refresh" | "framerate" | "fullscreen" | "gift" | "go" | "graduation_hat" | "graph" | "grid" | "hand_cash_coins" | "hand_cash_note" | "heart_pulse" | "help" | "hide" | "home" | "image" | "import" | "in_progress" | "in_transit" | "individual" | "info" | "intranet" | "italic" | "job_seeked" | "key" | "laptop" | "leaf" | "ledger" | "ledger_arrow_left" | "ledger_arrow_right" | "like" | "like_no" | "link" | "lightbulb_off" | "lightbulb_on" | "link_cloud" | "link_on" | "list_view" | "locked" | "location" | "logout" | "lookup" | "marker" | "message" | "microphone" | "minimise" | "minus" | "minus_large" | "mobile" | "money_bag" | "mute" | "none" | "normalscreen" | "old_warning" | "page" | "palm_tree" | "pause" | "pause_circle" | "pdf" | "pin" | "people" | "people_switch" | "percentage_boxed" | "person" | "person_info" | "person_tick" | "petrol_pump" | "phone" | "picture_in_picture" | "piggy_bank" | "plane" | "play" | "play_circle" | "plus" | "plus_large" | "pound" | "print" | "progress" | "progressed" | "protect" | "question" | "question_hollow" | "question_mark" | "recruiting" | "refresh" | "refresh_clock" | "remove" | "replay" | "sage_coin" | "save" | "scan" | "send" | "search" | "services" | "settings" | "settings_old" | "share" | "shield_with_tick" | "shield_with_tick_outline" | "shop" | "sort_down" | "sort_up" | "spanner" | "speaker" | "split" | "split_container" | "square_dot" | "squares_nine" | "stacked_boxes" | "stacked_squares" | "stop" | "stop_circle" | "subtitles" | "support_online" | "submitted" | "sync" | "tag" | "talk" | "target" | "target_man" | "theatre_masks" | "three_boxes" | "tick" | "tick_circle" | "tick_thick" | "true_tick" | "u_turn_left" | "u_turn_right" | "undo" | "unlocked" | "upload" | "uploaded" | "video" | "view" | "volume_high" | "volume_low" | "volume_medium" | "volunteering" | "warning" | "website" | "welfare" | "worldwide_location";
|
|
@@ -159,6 +159,21 @@ declare namespace iconUnicodes {
|
|
|
159
159
|
export let stop: string;
|
|
160
160
|
export let stop_circle: string;
|
|
161
161
|
export let worldwide_location: string;
|
|
162
|
+
export let airplay: string;
|
|
163
|
+
export let batch: string;
|
|
164
|
+
export let chromecast: string;
|
|
165
|
+
export let framerate: string;
|
|
166
|
+
export let fullscreen: string;
|
|
167
|
+
export let mute: string;
|
|
168
|
+
export let normalscreen: string;
|
|
169
|
+
export let page: string;
|
|
170
|
+
export let picture_in_picture: string;
|
|
171
|
+
export let replay: string;
|
|
172
|
+
export let speaker: string;
|
|
173
|
+
export let subtitles: string;
|
|
174
|
+
export let volume_high: string;
|
|
175
|
+
export let volume_low: string;
|
|
176
|
+
export let volume_medium: string;
|
|
162
177
|
export let error: string;
|
|
163
178
|
export let warning: string;
|
|
164
179
|
export let tick: string;
|
|
@@ -263,7 +263,22 @@ const misc = {
|
|
|
263
263
|
shield_with_tick_outline: "\\f071",
|
|
264
264
|
stop: "\\f068",
|
|
265
265
|
stop_circle: "\\f069",
|
|
266
|
-
worldwide_location: "\\f072"
|
|
266
|
+
worldwide_location: "\\f072",
|
|
267
|
+
airplay: "\\f073",
|
|
268
|
+
batch: "\\f074",
|
|
269
|
+
chromecast: "\\f075",
|
|
270
|
+
framerate: "\\f076",
|
|
271
|
+
fullscreen: "\\f077",
|
|
272
|
+
mute: "\\f078",
|
|
273
|
+
normalscreen: "\\f079",
|
|
274
|
+
page: "\\f080",
|
|
275
|
+
picture_in_picture: "\\f081",
|
|
276
|
+
replay: "\\f082",
|
|
277
|
+
speaker: "\\f083",
|
|
278
|
+
subtitles: "\\f084",
|
|
279
|
+
volume_high: "\\f087",
|
|
280
|
+
volume_low: "\\f085",
|
|
281
|
+
volume_medium: "\\f086"
|
|
267
282
|
};
|
|
268
283
|
const legacyNames = {
|
|
269
284
|
add: actions.plus,
|
|
@@ -8,5 +8,6 @@ export interface StyledLoaderSquareProps {
|
|
|
8
8
|
/** The background color of each loader square */
|
|
9
9
|
backgroundColor?: string;
|
|
10
10
|
}
|
|
11
|
+
export declare const StyledLoaderPlaceholder: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
12
|
declare const StyledLoaderSquare: import("styled-components").StyledComponent<"div", any, StyledLoaderSquareProps, never>;
|
|
12
13
|
export default StyledLoaderSquare;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.StyledLoaderPlaceholder = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
8
|
var _base = _interopRequireDefault(require("../../style/themes/base"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -41,6 +41,10 @@ const getDimensions = size => {
|
|
|
41
41
|
margin-right: ${marginRight};
|
|
42
42
|
`;
|
|
43
43
|
};
|
|
44
|
+
const StyledLoaderPlaceholder = exports.StyledLoaderPlaceholder = _styledComponents.default.div`
|
|
45
|
+
display: inline-block;
|
|
46
|
+
min-width: var(--sizing800);
|
|
47
|
+
`;
|
|
44
48
|
const StyledLoaderSquare = _styledComponents.default.div`
|
|
45
49
|
${({
|
|
46
50
|
size,
|
|
@@ -53,19 +57,15 @@ const StyledLoaderSquare = _styledComponents.default.div`
|
|
|
53
57
|
display: inline-block;
|
|
54
58
|
${getDimensions(size)}
|
|
55
59
|
border-radius: var(--borderRadiusCircle);
|
|
56
|
-
|
|
57
60
|
${isInsideButton && (0, _styledComponents.css)`
|
|
58
61
|
background-color: ${isActive ? "var(--colorsUtilityYang100)" : "var(--colorsSemanticNeutral500)"};
|
|
59
62
|
`}
|
|
60
|
-
|
|
61
63
|
&:nth-of-type(1) {
|
|
62
64
|
animation-delay: 0s;
|
|
63
65
|
}
|
|
64
|
-
|
|
65
66
|
&:nth-of-type(2) {
|
|
66
67
|
animation-delay: 0.2s;
|
|
67
68
|
}
|
|
68
|
-
|
|
69
69
|
&:nth-of-type(3) {
|
|
70
70
|
animation-delay: 0.4s;
|
|
71
71
|
margin-right: 0px;
|
|
@@ -73,7 +73,6 @@ const StyledLoaderSquare = _styledComponents.default.div`
|
|
|
73
73
|
`}
|
|
74
74
|
`;
|
|
75
75
|
StyledLoaderSquare.defaultProps = {
|
|
76
|
-
size: "small",
|
|
77
76
|
isInsideButton: false,
|
|
78
77
|
isActive: true,
|
|
79
78
|
theme: _base.default
|
|
@@ -10,9 +10,11 @@ var _useMediaQuery = _interopRequireDefault(require("../../hooks/useMediaQuery")
|
|
|
10
10
|
var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLocale"));
|
|
11
11
|
var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tags/tags"));
|
|
12
12
|
var _loader = _interopRequireDefault(require("./loader.style"));
|
|
13
|
-
var _loaderSquare =
|
|
13
|
+
var _loaderSquare = _interopRequireWildcard(require("./loader-square.style"));
|
|
14
14
|
var _typography = _interopRequireDefault(require("../typography"));
|
|
15
15
|
var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
|
|
16
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
19
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
18
20
|
let deprecateAriaLabelWarnTriggered = false;
|
|
@@ -30,7 +32,10 @@ const Loader = ({
|
|
|
30
32
|
_logger.default.deprecate("The aria-label prop in Loader is deprecated and will soon be removed, please use the `loaderLabel` prop instead to provide an accessible label.");
|
|
31
33
|
}
|
|
32
34
|
const l = (0, _useLocale.default)();
|
|
33
|
-
const
|
|
35
|
+
const allowMotion = (0, _useMediaQuery.default)("screen and (prefers-reduced-motion: no-preference)");
|
|
36
|
+
if (allowMotion === undefined) {
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_loaderSquare.StyledLoaderPlaceholder, null);
|
|
38
|
+
}
|
|
34
39
|
const loaderSquareProps = {
|
|
35
40
|
isInsideButton,
|
|
36
41
|
isActive,
|
|
@@ -39,7 +44,7 @@ const Loader = ({
|
|
|
39
44
|
};
|
|
40
45
|
|
|
41
46
|
// FE-6368 has been raised for the below, changed hex values for design tokens (when added)
|
|
42
|
-
return /*#__PURE__*/_react.default.createElement(_loader.default, _extends({}, (0, _tags.default)("loader", rest), (0, _utils.filterStyledSystemMarginProps)(rest)),
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement(_loader.default, _extends({}, (0, _tags.default)("loader", rest), (0, _utils.filterStyledSystemMarginProps)(rest)), allowMotion ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, ["#13A038", "#0092DB", "#8F49FE"].map(color => /*#__PURE__*/_react.default.createElement(_loaderSquare.default, _extends({
|
|
43
48
|
"data-role": "loader-square",
|
|
44
49
|
key: color,
|
|
45
50
|
backgroundColor: variant === "gradient" ? /* istanbul ignore next */color : "var(--colorsActionMajor500)"
|
|
@@ -47,7 +52,7 @@ const Loader = ({
|
|
|
47
52
|
"data-role": "hidden-label",
|
|
48
53
|
variant: "span",
|
|
49
54
|
screenReaderOnly: true
|
|
50
|
-
}, loaderLabel || ariaLabel || l.loader.loading())));
|
|
55
|
+
}, loaderLabel || ariaLabel || l.loader.loading())) : loaderLabel || ariaLabel || l.loader.loading());
|
|
51
56
|
};
|
|
52
57
|
exports.Loader = Loader;
|
|
53
58
|
var _default = exports.default = Loader;
|
|
@@ -5,7 +5,7 @@ import { StyledLoaderBarProps } from "./loader-bar.style";
|
|
|
5
5
|
export interface LoaderBarProps extends StyledLoaderBarProps, MarginProps, TagProps {
|
|
6
6
|
}
|
|
7
7
|
export declare const LoaderBar: {
|
|
8
|
-
({ size, ...rest }: LoaderBarProps): React.JSX.Element;
|
|
8
|
+
({ size, ...rest }: LoaderBarProps): React.JSX.Element | null;
|
|
9
9
|
DisplayName: string;
|
|
10
10
|
};
|
|
11
11
|
export default LoaderBar;
|
|
@@ -19,17 +19,20 @@ const LoaderBar = ({
|
|
|
19
19
|
...rest
|
|
20
20
|
}) => {
|
|
21
21
|
const l = (0, _useLocale.default)();
|
|
22
|
-
const
|
|
22
|
+
const allowMotion = (0, _useMediaQuery.default)("screen and (prefers-reduced-motion: no-preference)");
|
|
23
|
+
if (allowMotion === undefined) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
23
26
|
return /*#__PURE__*/_react.default.createElement(_loaderBar.StyledLoader, _extends({
|
|
24
27
|
"aria-label": l.loader.loading(),
|
|
25
28
|
role: "progressbar"
|
|
26
|
-
}, (0, _tags.default)("loader-bar", rest), (0, _utils.filterStyledSystemMarginProps)(rest)),
|
|
29
|
+
}, (0, _tags.default)("loader-bar", rest), (0, _utils.filterStyledSystemMarginProps)(rest)), allowMotion ? /*#__PURE__*/_react.default.createElement(_loaderBar.default, {
|
|
27
30
|
"data-role": "outer-bar",
|
|
28
31
|
size: size
|
|
29
32
|
}, /*#__PURE__*/_react.default.createElement(_loaderBar.InnerBar, {
|
|
30
33
|
"data-role": "inner-bar",
|
|
31
34
|
size: size
|
|
32
|
-
})));
|
|
35
|
+
})) : l.loader.loading());
|
|
33
36
|
};
|
|
34
37
|
exports.LoaderBar = LoaderBar;
|
|
35
38
|
LoaderBar.DisplayName = "Loader Bar";
|
|
@@ -37,5 +37,5 @@ export interface LoaderSpinnerProps extends MarginProps, TagProps {
|
|
|
37
37
|
*/
|
|
38
38
|
animationTime?: number;
|
|
39
39
|
}
|
|
40
|
-
export declare const LoaderSpinner: ({ spinnerLabel, size, showSpinnerLabel, variant, isTracked, hasMotion, animationTime, ...rest }: LoaderSpinnerProps) => React.JSX.Element;
|
|
40
|
+
export declare const LoaderSpinner: ({ spinnerLabel, size, showSpinnerLabel, variant, isTracked, hasMotion, animationTime, ...rest }: LoaderSpinnerProps) => React.JSX.Element | null;
|
|
41
41
|
export default LoaderSpinner;
|
|
@@ -24,7 +24,10 @@ const LoaderSpinner = ({
|
|
|
24
24
|
...rest
|
|
25
25
|
}) => {
|
|
26
26
|
const locale = (0, _useLocale.default)();
|
|
27
|
-
const
|
|
27
|
+
const allowMotion = (0, _useMediaQuery.default)("screen and (prefers-reduced-motion: no-preference)");
|
|
28
|
+
if (allowMotion === undefined) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
28
31
|
const isLabelDark = variant !== "inverse" && variant !== "gradient-white";
|
|
29
32
|
const renderSpinnerLabel = /*#__PURE__*/_react.default.createElement(_loaderSpinner.StyledLabel, {
|
|
30
33
|
"data-role": "visible-label",
|
|
@@ -45,7 +48,7 @@ const LoaderSpinner = ({
|
|
|
45
48
|
return /*#__PURE__*/_react.default.createElement(_loaderSpinner.StyledSpinnerWrapper, _extends({
|
|
46
49
|
size: size,
|
|
47
50
|
role: "status"
|
|
48
|
-
}, (0, _tags.default)("loader-spinner", rest), (0, _utils.filterStyledSystemMarginProps)(rest)),
|
|
51
|
+
}, (0, _tags.default)("loader-spinner", rest), (0, _utils.filterStyledSystemMarginProps)(rest)), allowMotion ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_loaderSpinner.StyledSpinnerCircleSvg, {
|
|
49
52
|
role: "presentation",
|
|
50
53
|
size: size,
|
|
51
54
|
variant: variant,
|
|
@@ -62,7 +65,7 @@ const LoaderSpinner = ({
|
|
|
62
65
|
"data-role": "hidden-label",
|
|
63
66
|
variant: "span",
|
|
64
67
|
screenReaderOnly: true
|
|
65
|
-
}, spinnerLabel || locale.loaderSpinner.loading())));
|
|
68
|
+
}, spinnerLabel || locale.loaderSpinner.loading())) : renderSpinnerLabel);
|
|
66
69
|
};
|
|
67
70
|
exports.LoaderSpinner = LoaderSpinner;
|
|
68
71
|
var _default = exports.default = LoaderSpinner;
|
|
@@ -8,7 +8,7 @@ export interface LoaderStarProps extends TagProps {
|
|
|
8
8
|
loaderStarLabel?: string;
|
|
9
9
|
}
|
|
10
10
|
declare const LoaderStar: {
|
|
11
|
-
({ loaderStarLabel, ...rest }: LoaderStarProps): JSX.Element;
|
|
11
|
+
({ loaderStarLabel, ...rest }: LoaderStarProps): JSX.Element | null;
|
|
12
12
|
displayName: string;
|
|
13
13
|
};
|
|
14
14
|
export default LoaderStar;
|
|
@@ -18,7 +18,10 @@ const LoaderStar = ({
|
|
|
18
18
|
...rest
|
|
19
19
|
}) => {
|
|
20
20
|
const locale = (0, _useLocale.default)();
|
|
21
|
-
const
|
|
21
|
+
const allowMotion = (0, _useMediaQuery.default)("screen and (prefers-reduced-motion: no-preference)");
|
|
22
|
+
if (allowMotion === undefined) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
22
25
|
const label = /*#__PURE__*/_react.default.createElement(_loaderStar.StyledLabel, {
|
|
23
26
|
"data-role": "visible-label",
|
|
24
27
|
variant: "span",
|
|
@@ -26,7 +29,7 @@ const LoaderStar = ({
|
|
|
26
29
|
}, loaderStarLabel || locale.loaderStar.loading());
|
|
27
30
|
return /*#__PURE__*/_react.default.createElement(_loaderStar.StyledLoaderStarWrapper, _extends({
|
|
28
31
|
role: "status"
|
|
29
|
-
}, (0, _tags.default)("loader-star", rest)),
|
|
32
|
+
}, (0, _tags.default)("loader-star", rest)), allowMotion ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_loaderStar.StyledStars, null, /*#__PURE__*/_react.default.createElement(_star.default, {
|
|
30
33
|
starContainerClassName: "star-1",
|
|
31
34
|
gradientId: "gradient1"
|
|
32
35
|
}), /*#__PURE__*/_react.default.createElement(_star.default, {
|
|
@@ -39,7 +42,7 @@ const LoaderStar = ({
|
|
|
39
42
|
"data-role": "hidden-label",
|
|
40
43
|
variant: "span",
|
|
41
44
|
screenReaderOnly: true
|
|
42
|
-
}, loaderStarLabel || locale.loaderStar.loading())));
|
|
45
|
+
}, loaderStarLabel || locale.loaderStar.loading())) : label);
|
|
43
46
|
};
|
|
44
47
|
LoaderStar.displayName = "LoaderStar";
|
|
45
48
|
var _default = exports.default = LoaderStar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function useMediaQuery(queryInput: string): boolean;
|
|
1
|
+
export default function useMediaQuery(queryInput: string): boolean | undefined;
|
|
@@ -4,16 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useMediaQuery;
|
|
7
|
-
var _react =
|
|
8
|
-
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _globals = require("../../__internal__/dom/globals");
|
|
9
9
|
function useMediaQuery(queryInput) {
|
|
10
10
|
const query = queryInput.replace(/^@media( ?)/m, "");
|
|
11
|
-
const [match, setMatch] = _react.
|
|
12
|
-
_react.
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const [match, setMatch] = (0, _react.useState)(undefined);
|
|
12
|
+
(0, _react.useLayoutEffect)(() => {
|
|
13
|
+
const browserWindow = (0, _globals.getWindow)();
|
|
14
|
+
|
|
15
|
+
/* istanbul ignore if */
|
|
16
|
+
if (!browserWindow) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
const queryList = browserWindow.matchMedia(query);
|
|
20
|
+
const updateMatch = () => setMatch(queryList.matches);
|
|
17
21
|
updateMatch();
|
|
18
22
|
queryList.addEventListener("change", updateMatch);
|
|
19
23
|
return () => {
|
|
Binary file
|
|
Binary file
|