@rio-cloud/rio-uikit 1.7.0 → 1.7.1

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.
@@ -38,6 +38,12 @@ type BannerProps = {
38
38
  * @default true
39
39
  */
40
40
  border?: boolean;
41
+ /**
42
+ * Enables or disables initial animation.
43
+ *
44
+ * @default true
45
+ */
46
+ initialAnimation?: boolean;
41
47
  /**
42
48
  * Additional classname added to the wrapper element.
43
49
  */
@@ -1,21 +1,24 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState, useEffect, createContext } from 'react';
3
- import { motion, AnimatePresence } from 'framer-motion';
2
+ import { useState, useEffect, createContext, useRef } from 'react';
3
+ import { motion, AnimatePresence, useReducedMotion } from 'framer-motion';
4
4
  import classNames from 'classnames';
5
5
  import Card from '../card/Card';
6
6
  import Button from '../button/Button';
7
- import FadeExpander from '../fade/FadeExpander';
8
7
  import BannerPageActions from './BannerActions';
9
8
  import BannerPageContent from './BannerContent';
10
9
  import BannerPageIcon from './BannerIcon';
11
10
  import BannerPage from './BannerPage';
12
11
  const BannerContext = createContext(undefined);
13
12
  const Banner = (props) => {
14
- const { show = true, dismissible = true, onClose = () => { }, pageTimeout = 20_000, showPageNavigation = true, border = true, className = '', children, ...remainingProps } = props;
13
+ const { show = true, dismissible = true, onClose = () => { }, pageTimeout = 20_000, showPageNavigation = true, border = true, initialAnimation = true, className = '', children, ...remainingProps } = props;
15
14
  const pages = Array.isArray(children) ? children : [children];
16
15
  const pageAmount = pages.length;
17
16
  const hasMultiplePages = pageAmount > 1;
18
17
  const [currentPage, setCurrentPage] = useState(0);
18
+ const shouldReduceMotion = useReducedMotion();
19
+ const hasAnimation = !shouldReduceMotion && initialAnimation;
20
+ const contentRef = useRef(null);
21
+ const [contentHeight, setContentHeight] = useState(0);
19
22
  // biome-ignore lint/correctness/useExhaustiveDependencies: "currentPage" resets interval on manual page change
20
23
  useEffect(() => {
21
24
  if (!show || pageAmount === 1) {
@@ -26,6 +29,24 @@ const Banner = (props) => {
26
29
  }, pageTimeout);
27
30
  return () => clearInterval(interval);
28
31
  }, [pageAmount, pageTimeout, show, currentPage]);
32
+ // Update height measurement after layout is complete
33
+ // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
34
+ useEffect(() => {
35
+ if (!contentRef.current) {
36
+ return;
37
+ }
38
+ // Use ResizeObserver to get accurate measurements after layout
39
+ const resizeObserver = new ResizeObserver(entries => {
40
+ const entry = entries[0];
41
+ if (entry) {
42
+ // Use getBoundingClientRect for most accurate height
43
+ const height = entry.target.getBoundingClientRect().height;
44
+ setContentHeight(height);
45
+ }
46
+ });
47
+ resizeObserver.observe(contentRef.current);
48
+ return () => resizeObserver.disconnect();
49
+ }, [show, currentPage]);
29
50
  const nextPage = () => {
30
51
  if (hasMultiplePages) {
31
52
  setCurrentPage(prev => (prev + 1) % pageAmount);
@@ -37,10 +58,14 @@ const Banner = (props) => {
37
58
  }
38
59
  };
39
60
  const cardClasses = classNames('Banner display-flex text-color-darker overflow-hidden', 'position-relative', !border && 'border-color-white', className);
40
- return (_jsx(BannerContext.Provider, { value: { nextPage, prevPage }, children: _jsx(FadeExpander, { show: show, children: _jsxs(Card, { className: cardClasses, padding: 20, ...remainingProps, children: [_jsxs("div", { className: 'flex-1-1 overflow-hidden', children: [_jsx(AnimatePresence, { exitBeforeEnter: true, children: _jsx(motion.div, { initial: { opacity: 0, x: 100 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: -100 }, layout: true, transition: {
41
- duration: 1.5,
42
- ease: [0.25, 1, 0.5, 1], // Custom cubic bezier: fast start, slow end
43
- }, children: pages[currentPage] }, currentPage) }), hasMultiplePages && showPageNavigation && (_jsx("div", { className: 'margin-5', children: _jsx("div", { className: 'position-absolute bottom-5', style: { right: '45px' }, children: _jsxs("div", { className: 'display-flex', children: [_jsx(Button, { bsStyle: 'muted', bsSize: 'xs', onClick: prevPage, iconName: 'rioglyph-arrow-left', iconOnly: true }), _jsx(Button, { bsStyle: 'muted', bsSize: 'xs', onClick: nextPage, iconName: 'rioglyph-arrow-right', iconOnly: true })] }) }) }))] }), dismissible && (_jsx("div", { className: 'flex-0 margin-left-10 margin-right--5 margin-top--5 margin-top-0-ls align-self-start align-self-center-ls', children: _jsx(Button, { bsStyle: 'muted', bsSize: 'sm', onClick: onClose, iconName: 'rioglyph-remove', iconOnly: true }) }))] }) }) }));
61
+ return (_jsx(BannerContext.Provider, { value: { nextPage, prevPage }, children: _jsx(AnimatePresence, { children: show && (_jsx(motion.div, { initial: { height: 0, opacity: 0 }, animate: { height: contentHeight, opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: {
62
+ height: { duration: 0.2 },
63
+ opacity: { duration: 0.2 },
64
+ ease: 'easeInOut',
65
+ }, children: _jsx("div", { ref: contentRef, style: { position: 'relative' }, children: _jsxs(Card, { className: cardClasses, padding: 20, ...remainingProps, children: [_jsxs("div", { className: 'flex-1-1 overflow-hidden', children: [_jsx(AnimatePresence, { exitBeforeEnter: true, children: _jsx(motion.div, { initial: hasAnimation ? { opacity: 0, x: 100 } : false, animate: { opacity: 1, x: 0 }, exit: hasAnimation ? { opacity: 0, x: -100 } : undefined, transition: {
66
+ duration: 1.5,
67
+ ease: [0.25, 1, 0.5, 1],
68
+ }, children: pages[currentPage] }, currentPage) }), hasMultiplePages && showPageNavigation && (_jsx("div", { className: 'margin-5', children: _jsx("div", { className: 'position-absolute bottom-5', style: { right: '45px' }, children: _jsxs("div", { className: 'display-flex', children: [_jsx(Button, { bsStyle: 'muted', bsSize: 'xs', onClick: prevPage, iconName: 'rioglyph-arrow-left', iconOnly: true }), _jsx(Button, { bsStyle: 'muted', bsSize: 'xs', onClick: nextPage, iconName: 'rioglyph-arrow-right', iconOnly: true })] }) }) }))] }), dismissible && (_jsx("div", { className: 'flex-0 margin-left-10 margin-right--5 margin-top--5 margin-top-0-ls align-self-start align-self-center-ls', children: _jsx(Button, { bsStyle: 'muted', bsSize: 'sm', onClick: onClose, iconName: 'rioglyph-remove', iconOnly: true }) }))] }) }) })) }) }));
44
69
  };
45
70
  Banner.Page = BannerPage;
46
71
  Banner.Icon = BannerPageIcon;
@@ -1,17 +1,37 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // @ts-ignore-next-line importsNotUsedAsValues
3
+ import { useEffect, useRef, useState } from 'react';
2
4
  import classNames from 'classnames';
3
5
  const FormLabel = (props) => {
4
6
  const { className = '', children, supportingText, ...remainingProps } = props;
7
+ const elementRef = useRef(null);
8
+ const [parentSize, setParentSize] = useState(null);
5
9
  const isLabel = 'htmlFor' in remainingProps;
10
+ useEffect(() => {
11
+ if (!elementRef.current) {
12
+ return;
13
+ }
14
+ const parent = elementRef.current.parentElement;
15
+ if (!parent) {
16
+ return;
17
+ }
18
+ if (parent.classList.contains('form-group-lg')) {
19
+ setParentSize('lg');
20
+ }
21
+ else if (parent.classList.contains('form-group-sm')) {
22
+ setParentSize('sm');
23
+ }
24
+ }, []);
25
+ const supportingTextClasses = classNames('text-color-gray', 'text-italic', parentSize === 'sm' && 'text-size-10', parentSize === 'lg' && 'text-size-14', !parentSize && 'text-size-12');
6
26
  if (isLabel) {
7
- const labelClasses = classNames('display-inline-flex flex-wrap justify-content-between width-100pct', className);
27
+ const labelClasses = classNames(!supportingText && 'display-inline-block', supportingText && 'display-inline-flex flex-wrap justify-content-between width-100pct', className);
8
28
  return (
9
29
  // biome-ignore lint/a11y/noLabelWithoutControl: <explanation>
10
- _jsxs("label", { ...remainingProps, className: labelClasses, children: [_jsx("span", { children: children }), supportingText && _jsx("span", { className: 'text-italic text-size-12 text-color-gray', children: supportingText })] }));
30
+ _jsxs("label", { ref: elementRef, ...remainingProps, className: labelClasses, children: [_jsx("span", { children: children }), supportingText && _jsx("span", { className: supportingTextClasses, children: supportingText })] }));
11
31
  }
12
- const classes = classNames('text-size-12 text-color-dark', 'max-width-100pct', supportingText && 'display-inline-flex flex-wrap justify-content-between width-100pct', !className.includes('margin-bottom') && 'margin-bottom-5', className);
32
+ const classes = classNames('text-color-dark', 'max-width-100pct', parentSize === 'sm' && 'text-size-10', parentSize === 'lg' && 'text-size-14', !parentSize && 'text-size-12', !supportingText && 'display-inline-block', supportingText && 'display-inline-flex flex-wrap justify-content-between width-100pct', !className.includes('margin-bottom') && 'margin-bottom-5', className);
13
33
  return (
14
34
  // @ts-ignore
15
- _jsxs("div", { ...remainingProps, className: classes, children: [children, supportingText && _jsx("span", { className: 'text-italic text-size-12 text-color-gray', children: supportingText })] }));
35
+ _jsxs("div", { ref: elementRef, ...remainingProps, className: classes, children: [children, supportingText && _jsx("span", { className: supportingTextClasses, children: supportingText })] }));
16
36
  };
17
37
  export default FormLabel;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useLayoutEffect, useRef, useState } from 'react';
2
+ import { useEffect, useRef, useState } from 'react';
3
3
  import isEmpty from 'lodash/fp/isEmpty';
4
4
  import debounce from 'lodash/fp/debounce';
5
5
  import classNames from 'classnames';
@@ -38,11 +38,13 @@ const ListMenu = (props) => {
38
38
  }
39
39
  });
40
40
  // Convert the menu to an expandable panel for smaller screens
41
- const handleResize = debounce(RESIZE_THROTTLING)(() => {
41
+ const handleMobileSize = debounce(RESIZE_THROTTLING)(() => {
42
42
  buildMobileHeader();
43
43
  setIsMobileMode(window.innerWidth < MOBILE_MAX_WIDTH);
44
44
  });
45
- useWindowResize(handleResize);
45
+ // Render a dropdown menu on mobile on mount
46
+ useEffect(handleMobileSize, []);
47
+ useWindowResize(handleMobileSize);
46
48
  const focusInput = () => {
47
49
  inputRef.current?.focus();
48
50
  };
@@ -56,7 +58,8 @@ const ListMenu = (props) => {
56
58
  useEffectOnce(() => {
57
59
  focusFilter && focusInput();
58
60
  });
59
- useLayoutEffect(() => buildMobileHeader, [menuItems]);
61
+ // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
62
+ useEffect(() => buildMobileHeader, [menuItems]);
60
63
  const handleClear = () => focusFilter && focusInput();
61
64
  const handleFilterChange = (value) => {
62
65
  setFilterValue(value);
@@ -17,7 +17,7 @@ const SingleMapMarker = (props) => {
17
17
  const largeAnchor = anchorSize === 'lg';
18
18
  const classes = classNames(active && 'active', 'rio-map-marker', 'rio-map-marker-bottom-center', !clickable && 'not-clickable', className);
19
19
  const anchorClasses = classNames('rio-map-anchor', largeAnchor ? 'rio-map-anchor-lg' : '', cursor);
20
- const singleClasses = classNames('rio-map-single', fixed && 'fixed', moving && 'moving', textColor, markerOnHover && 'visible-on-hover', active && 'active', pinging && 'pinging', cursor);
20
+ const singleClasses = classNames('rio-map-single', fixed && 'fixed', moving && 'moving', textColor, markerOnHover && 'visible-on-hover', active && 'active', pinging && 'pinging', typeof name === 'string' && name.length === 1 && 'single-letter', cursor);
21
21
  const markerBackgroundColor = `var(${markerColorMapping[markerColor]})`;
22
22
  return (_jsx("div", { className: classes, style: { ...style, color: markerBackgroundColor }, "data-marker-type": markerColor.replace('bg-', 'single-'), children: _jsxs("div", { className: 'rio-map-marker-translate', children: [!anchorOnly && (_jsxs(_Fragment, { children: [_jsxs("div", { className: singleClasses, children: [_jsx(MapStateIndicator, { moving: moving, bearing: bearing, stateIconName: stateIconName }), getIcons(iconNames), name && _jsx("div", { className: 'rio-map-name', children: name }), exceptionCount > 0 && _jsx("div", { className: 'rio-map-bubble exception', children: exceptionCount }), warningCount > 0 && _jsx("div", { className: 'rio-map-bubble warning', children: warningCount })] }), _jsx("div", { className: 'rio-map-anchor-arrow' })] })), _jsx("div", { className: anchorClasses, children: anchorIconName && largeAnchor && _jsx("span", { className: `rioglyph rioglyph-${anchorIconName}` }) })] }) }));
23
23
  };
@@ -38,6 +38,12 @@ type BannerProps = {
38
38
  * @default true
39
39
  */
40
40
  border?: boolean;
41
+ /**
42
+ * Enables or disables initial animation.
43
+ *
44
+ * @default true
45
+ */
46
+ initialAnimation?: boolean;
41
47
  /**
42
48
  * Additional classname added to the wrapper element.
43
49
  */
@@ -7,18 +7,21 @@ const framer_motion_1 = require("framer-motion");
7
7
  const classnames_1 = tslib_1.__importDefault(require("classnames"));
8
8
  const Card_1 = tslib_1.__importDefault(require("../card/Card"));
9
9
  const Button_1 = tslib_1.__importDefault(require("../button/Button"));
10
- const FadeExpander_1 = tslib_1.__importDefault(require("../fade/FadeExpander"));
11
10
  const BannerActions_1 = tslib_1.__importDefault(require("./BannerActions"));
12
11
  const BannerContent_1 = tslib_1.__importDefault(require("./BannerContent"));
13
12
  const BannerIcon_1 = tslib_1.__importDefault(require("./BannerIcon"));
14
13
  const BannerPage_1 = tslib_1.__importDefault(require("./BannerPage"));
15
14
  const BannerContext = (0, react_1.createContext)(undefined);
16
15
  const Banner = (props) => {
17
- const { show = true, dismissible = true, onClose = () => { }, pageTimeout = 20_000, showPageNavigation = true, border = true, className = '', children, ...remainingProps } = props;
16
+ const { show = true, dismissible = true, onClose = () => { }, pageTimeout = 20_000, showPageNavigation = true, border = true, initialAnimation = true, className = '', children, ...remainingProps } = props;
18
17
  const pages = Array.isArray(children) ? children : [children];
19
18
  const pageAmount = pages.length;
20
19
  const hasMultiplePages = pageAmount > 1;
21
20
  const [currentPage, setCurrentPage] = (0, react_1.useState)(0);
21
+ const shouldReduceMotion = (0, framer_motion_1.useReducedMotion)();
22
+ const hasAnimation = !shouldReduceMotion && initialAnimation;
23
+ const contentRef = (0, react_1.useRef)(null);
24
+ const [contentHeight, setContentHeight] = (0, react_1.useState)(0);
22
25
  // biome-ignore lint/correctness/useExhaustiveDependencies: "currentPage" resets interval on manual page change
23
26
  (0, react_1.useEffect)(() => {
24
27
  if (!show || pageAmount === 1) {
@@ -29,6 +32,24 @@ const Banner = (props) => {
29
32
  }, pageTimeout);
30
33
  return () => clearInterval(interval);
31
34
  }, [pageAmount, pageTimeout, show, currentPage]);
35
+ // Update height measurement after layout is complete
36
+ // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
37
+ (0, react_1.useEffect)(() => {
38
+ if (!contentRef.current) {
39
+ return;
40
+ }
41
+ // Use ResizeObserver to get accurate measurements after layout
42
+ const resizeObserver = new ResizeObserver(entries => {
43
+ const entry = entries[0];
44
+ if (entry) {
45
+ // Use getBoundingClientRect for most accurate height
46
+ const height = entry.target.getBoundingClientRect().height;
47
+ setContentHeight(height);
48
+ }
49
+ });
50
+ resizeObserver.observe(contentRef.current);
51
+ return () => resizeObserver.disconnect();
52
+ }, [show, currentPage]);
32
53
  const nextPage = () => {
33
54
  if (hasMultiplePages) {
34
55
  setCurrentPage(prev => (prev + 1) % pageAmount);
@@ -40,10 +61,14 @@ const Banner = (props) => {
40
61
  }
41
62
  };
42
63
  const cardClasses = (0, classnames_1.default)('Banner display-flex text-color-darker overflow-hidden', 'position-relative', !border && 'border-color-white', className);
43
- return ((0, jsx_runtime_1.jsx)(BannerContext.Provider, { value: { nextPage, prevPage }, children: (0, jsx_runtime_1.jsx)(FadeExpander_1.default, { show: show, children: (0, jsx_runtime_1.jsxs)(Card_1.default, { className: cardClasses, padding: 20, ...remainingProps, children: [(0, jsx_runtime_1.jsxs)("div", { className: 'flex-1-1 overflow-hidden', children: [(0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { exitBeforeEnter: true, children: (0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { initial: { opacity: 0, x: 100 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: -100 }, layout: true, transition: {
44
- duration: 1.5,
45
- ease: [0.25, 1, 0.5, 1], // Custom cubic bezier: fast start, slow end
46
- }, children: pages[currentPage] }, currentPage) }), hasMultiplePages && showPageNavigation && ((0, jsx_runtime_1.jsx)("div", { className: 'margin-5', children: (0, jsx_runtime_1.jsx)("div", { className: 'position-absolute bottom-5', style: { right: '45px' }, children: (0, jsx_runtime_1.jsxs)("div", { className: 'display-flex', children: [(0, jsx_runtime_1.jsx)(Button_1.default, { bsStyle: 'muted', bsSize: 'xs', onClick: prevPage, iconName: 'rioglyph-arrow-left', iconOnly: true }), (0, jsx_runtime_1.jsx)(Button_1.default, { bsStyle: 'muted', bsSize: 'xs', onClick: nextPage, iconName: 'rioglyph-arrow-right', iconOnly: true })] }) }) }))] }), dismissible && ((0, jsx_runtime_1.jsx)("div", { className: 'flex-0 margin-left-10 margin-right--5 margin-top--5 margin-top-0-ls align-self-start align-self-center-ls', children: (0, jsx_runtime_1.jsx)(Button_1.default, { bsStyle: 'muted', bsSize: 'sm', onClick: onClose, iconName: 'rioglyph-remove', iconOnly: true }) }))] }) }) }));
64
+ return ((0, jsx_runtime_1.jsx)(BannerContext.Provider, { value: { nextPage, prevPage }, children: (0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { children: show && ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { initial: { height: 0, opacity: 0 }, animate: { height: contentHeight, opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: {
65
+ height: { duration: 0.2 },
66
+ opacity: { duration: 0.2 },
67
+ ease: 'easeInOut',
68
+ }, children: (0, jsx_runtime_1.jsx)("div", { ref: contentRef, style: { position: 'relative' }, children: (0, jsx_runtime_1.jsxs)(Card_1.default, { className: cardClasses, padding: 20, ...remainingProps, children: [(0, jsx_runtime_1.jsxs)("div", { className: 'flex-1-1 overflow-hidden', children: [(0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { exitBeforeEnter: true, children: (0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { initial: hasAnimation ? { opacity: 0, x: 100 } : false, animate: { opacity: 1, x: 0 }, exit: hasAnimation ? { opacity: 0, x: -100 } : undefined, transition: {
69
+ duration: 1.5,
70
+ ease: [0.25, 1, 0.5, 1],
71
+ }, children: pages[currentPage] }, currentPage) }), hasMultiplePages && showPageNavigation && ((0, jsx_runtime_1.jsx)("div", { className: 'margin-5', children: (0, jsx_runtime_1.jsx)("div", { className: 'position-absolute bottom-5', style: { right: '45px' }, children: (0, jsx_runtime_1.jsxs)("div", { className: 'display-flex', children: [(0, jsx_runtime_1.jsx)(Button_1.default, { bsStyle: 'muted', bsSize: 'xs', onClick: prevPage, iconName: 'rioglyph-arrow-left', iconOnly: true }), (0, jsx_runtime_1.jsx)(Button_1.default, { bsStyle: 'muted', bsSize: 'xs', onClick: nextPage, iconName: 'rioglyph-arrow-right', iconOnly: true })] }) }) }))] }), dismissible && ((0, jsx_runtime_1.jsx)("div", { className: 'flex-0 margin-left-10 margin-right--5 margin-top--5 margin-top-0-ls align-self-start align-self-center-ls', children: (0, jsx_runtime_1.jsx)(Button_1.default, { bsStyle: 'muted', bsSize: 'sm', onClick: onClose, iconName: 'rioglyph-remove', iconOnly: true }) }))] }) }) })) }) }));
47
72
  };
48
73
  Banner.Page = BannerPage_1.default;
49
74
  Banner.Icon = BannerIcon_1.default;
@@ -2,19 +2,39 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // @ts-ignore-next-line importsNotUsedAsValues
6
+ const react_1 = require("react");
5
7
  const classnames_1 = tslib_1.__importDefault(require("classnames"));
6
8
  const FormLabel = (props) => {
7
9
  const { className = '', children, supportingText, ...remainingProps } = props;
10
+ const elementRef = (0, react_1.useRef)(null);
11
+ const [parentSize, setParentSize] = (0, react_1.useState)(null);
8
12
  const isLabel = 'htmlFor' in remainingProps;
13
+ (0, react_1.useEffect)(() => {
14
+ if (!elementRef.current) {
15
+ return;
16
+ }
17
+ const parent = elementRef.current.parentElement;
18
+ if (!parent) {
19
+ return;
20
+ }
21
+ if (parent.classList.contains('form-group-lg')) {
22
+ setParentSize('lg');
23
+ }
24
+ else if (parent.classList.contains('form-group-sm')) {
25
+ setParentSize('sm');
26
+ }
27
+ }, []);
28
+ const supportingTextClasses = (0, classnames_1.default)('text-color-gray', 'text-italic', parentSize === 'sm' && 'text-size-10', parentSize === 'lg' && 'text-size-14', !parentSize && 'text-size-12');
9
29
  if (isLabel) {
10
- const labelClasses = (0, classnames_1.default)('display-inline-flex flex-wrap justify-content-between width-100pct', className);
30
+ const labelClasses = (0, classnames_1.default)(!supportingText && 'display-inline-block', supportingText && 'display-inline-flex flex-wrap justify-content-between width-100pct', className);
11
31
  return (
12
32
  // biome-ignore lint/a11y/noLabelWithoutControl: <explanation>
13
- (0, jsx_runtime_1.jsxs)("label", { ...remainingProps, className: labelClasses, children: [(0, jsx_runtime_1.jsx)("span", { children: children }), supportingText && (0, jsx_runtime_1.jsx)("span", { className: 'text-italic text-size-12 text-color-gray', children: supportingText })] }));
33
+ (0, jsx_runtime_1.jsxs)("label", { ref: elementRef, ...remainingProps, className: labelClasses, children: [(0, jsx_runtime_1.jsx)("span", { children: children }), supportingText && (0, jsx_runtime_1.jsx)("span", { className: supportingTextClasses, children: supportingText })] }));
14
34
  }
15
- const classes = (0, classnames_1.default)('text-size-12 text-color-dark', 'max-width-100pct', supportingText && 'display-inline-flex flex-wrap justify-content-between width-100pct', !className.includes('margin-bottom') && 'margin-bottom-5', className);
35
+ const classes = (0, classnames_1.default)('text-color-dark', 'max-width-100pct', parentSize === 'sm' && 'text-size-10', parentSize === 'lg' && 'text-size-14', !parentSize && 'text-size-12', !supportingText && 'display-inline-block', supportingText && 'display-inline-flex flex-wrap justify-content-between width-100pct', !className.includes('margin-bottom') && 'margin-bottom-5', className);
16
36
  return (
17
37
  // @ts-ignore
18
- (0, jsx_runtime_1.jsxs)("div", { ...remainingProps, className: classes, children: [children, supportingText && (0, jsx_runtime_1.jsx)("span", { className: 'text-italic text-size-12 text-color-gray', children: supportingText })] }));
38
+ (0, jsx_runtime_1.jsxs)("div", { ref: elementRef, ...remainingProps, className: classes, children: [children, supportingText && (0, jsx_runtime_1.jsx)("span", { className: supportingTextClasses, children: supportingText })] }));
19
39
  };
20
40
  exports.default = FormLabel;
@@ -41,11 +41,13 @@ const ListMenu = (props) => {
41
41
  }
42
42
  });
43
43
  // Convert the menu to an expandable panel for smaller screens
44
- const handleResize = (0, debounce_1.default)(RESIZE_THROTTLING)(() => {
44
+ const handleMobileSize = (0, debounce_1.default)(RESIZE_THROTTLING)(() => {
45
45
  buildMobileHeader();
46
46
  setIsMobileMode(window.innerWidth < MOBILE_MAX_WIDTH);
47
47
  });
48
- (0, useWindowResize_1.default)(handleResize);
48
+ // Render a dropdown menu on mobile on mount
49
+ (0, react_1.useEffect)(handleMobileSize, []);
50
+ (0, useWindowResize_1.default)(handleMobileSize);
49
51
  const focusInput = () => {
50
52
  inputRef.current?.focus();
51
53
  };
@@ -59,7 +61,8 @@ const ListMenu = (props) => {
59
61
  (0, useEffectOnce_1.default)(() => {
60
62
  focusFilter && focusInput();
61
63
  });
62
- (0, react_1.useLayoutEffect)(() => buildMobileHeader, [menuItems]);
64
+ // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
65
+ (0, react_1.useEffect)(() => buildMobileHeader, [menuItems]);
63
66
  const handleClear = () => focusFilter && focusInput();
64
67
  const handleFilterChange = (value) => {
65
68
  setFilterValue(value);
@@ -20,7 +20,7 @@ const SingleMapMarker = (props) => {
20
20
  const largeAnchor = anchorSize === 'lg';
21
21
  const classes = (0, classnames_1.default)(active && 'active', 'rio-map-marker', 'rio-map-marker-bottom-center', !clickable && 'not-clickable', className);
22
22
  const anchorClasses = (0, classnames_1.default)('rio-map-anchor', largeAnchor ? 'rio-map-anchor-lg' : '', cursor);
23
- const singleClasses = (0, classnames_1.default)('rio-map-single', fixed && 'fixed', moving && 'moving', textColor, markerOnHover && 'visible-on-hover', active && 'active', pinging && 'pinging', cursor);
23
+ const singleClasses = (0, classnames_1.default)('rio-map-single', fixed && 'fixed', moving && 'moving', textColor, markerOnHover && 'visible-on-hover', active && 'active', pinging && 'pinging', typeof name === 'string' && name.length === 1 && 'single-letter', cursor);
24
24
  const markerBackgroundColor = `var(${mapTypes_1.markerColorMapping[markerColor]})`;
25
25
  return ((0, jsx_runtime_1.jsx)("div", { className: classes, style: { ...style, color: markerBackgroundColor }, "data-marker-type": markerColor.replace('bg-', 'single-'), children: (0, jsx_runtime_1.jsxs)("div", { className: 'rio-map-marker-translate', children: [!anchorOnly && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: singleClasses, children: [(0, jsx_runtime_1.jsx)(MapStateIndicator, { moving: moving, bearing: bearing, stateIconName: stateIconName }), getIcons(iconNames), name && (0, jsx_runtime_1.jsx)("div", { className: 'rio-map-name', children: name }), exceptionCount > 0 && (0, jsx_runtime_1.jsx)("div", { className: 'rio-map-bubble exception', children: exceptionCount }), warningCount > 0 && (0, jsx_runtime_1.jsx)("div", { className: 'rio-map-bubble warning', children: warningCount })] }), (0, jsx_runtime_1.jsx)("div", { className: 'rio-map-anchor-arrow' })] })), (0, jsx_runtime_1.jsx)("div", { className: anchorClasses, children: anchorIconName && largeAnchor && (0, jsx_runtime_1.jsx)("span", { className: `rioglyph rioglyph-${anchorIconName}` }) })] }) }));
26
26
  };
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "1.7.0"
2
+ "version": "1.7.1"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rio-cloud/rio-uikit",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "The RIO UIKIT component library",
5
5
  "repository": {
6
6
  "type": "git",
package/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "1.7.0"
2
+ "version": "1.7.1"
3
3
  }