@telefonica/mistica 17.5.0 → 17.7.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/css/mistica.css +1 -1
- package/dist/accordion.css-mistica.js +6 -6
- package/dist/align.css-mistica.js +1 -1
- package/dist/autocomplete.css-mistica.js +1 -1
- package/dist/avatar.css-mistica.js +1 -1
- package/dist/badge.css-mistica.js +1 -1
- package/dist/box.css-mistica.js +13 -13
- package/dist/boxed.css-mistica.js +24 -24
- package/dist/button-group.css-mistica.js +1 -1
- package/dist/button-layout.css-mistica.js +14 -14
- package/dist/button.css-mistica.js +34 -34
- package/dist/callout.css-mistica.js +11 -11
- package/dist/card-cover.d.ts +2 -2
- package/dist/card-data.d.ts +2 -2
- package/dist/card-data.js +6 -8
- package/dist/card-internal.css-mistica.js +47 -29
- package/dist/card-internal.css.d.ts +4 -0
- package/dist/card-internal.d.ts +38 -3
- package/dist/card-internal.js +394 -301
- package/dist/card-media.d.ts +2 -2
- package/dist/card-media.js +7 -9
- package/dist/card-naked.d.ts +2 -2
- package/dist/card-naked.js +9 -11
- package/dist/carousel.css-mistica.js +8 -8
- package/dist/checkbox.css-mistica.js +11 -11
- package/dist/checkbox.d.ts +2 -0
- package/dist/checkbox.js +10 -10
- package/dist/chip.css-mistica.js +15 -15
- package/dist/circle.css-mistica.js +1 -1
- package/dist/community/advanced-data-card.css-mistica.js +20 -11
- package/dist/community/advanced-data-card.css.d.ts +2 -0
- package/dist/community/advanced-data-card.d.ts +7 -3
- package/dist/community/advanced-data-card.js +164 -142
- package/dist/community/ai-card.css-mistica.js +13 -13
- package/dist/community/ai-card.js +1 -1
- package/dist/community/blocks.css-mistica.js +1 -1
- package/dist/community/cyber/example-component.css-mistica.js +1 -1
- package/dist/community/example-component.css-mistica.js +2 -2
- package/dist/counter.css-mistica.js +1 -1
- package/dist/cover-hero.css-mistica.js +2 -2
- package/dist/credit-card-number-field.css-mistica.js +3 -3
- package/dist/date-field.css-mistica.js +1 -1
- package/dist/date-time-picker.css-mistica.js +1 -1
- package/dist/dialog.css-mistica.js +4 -4
- package/dist/divider.css-mistica.js +5 -5
- package/dist/double-field.css-mistica.js +2 -2
- package/dist/drawer.css-mistica.js +1 -1
- package/dist/empty-state-card.css-mistica.js +1 -1
- package/dist/empty-state.css-mistica.js +5 -5
- package/dist/fade-in.css-mistica.js +1 -1
- package/dist/fade-out.css-mistica.js +1 -1
- package/dist/feedback.css-mistica.js +1 -1
- package/dist/file-upload.css-mistica.js +7 -7
- package/dist/fixed-footer-layout.css-mistica.js +2 -2
- package/dist/form.css-mistica.js +1 -1
- package/dist/generated/mistica-icons/icon-document-information-filled.js +165 -0
- package/dist/generated/mistica-icons/icon-document-information-light.js +165 -0
- package/dist/generated/mistica-icons/icon-document-information-regular.js +165 -0
- package/dist/generated/mistica-icons/icon-internet-roaming-filled.js +159 -0
- package/dist/generated/mistica-icons/icon-internet-roaming-light.js +159 -0
- package/dist/generated/mistica-icons/icon-internet-roaming-regular.js +159 -0
- package/dist/generated/mistica-icons/icon-mobile-information-filled.js +165 -0
- package/dist/generated/mistica-icons/icon-mobile-information-light.js +173 -0
- package/dist/generated/mistica-icons/icon-mobile-information-regular.js +165 -0
- package/dist/generated/mistica-icons/icon-search-ai-filled.js +165 -0
- package/dist/generated/mistica-icons/icon-search-ai-light.js +165 -0
- package/dist/generated/mistica-icons/icon-search-ai-regular.js +165 -0
- package/dist/grid-layout.css-mistica.js +3 -3
- package/dist/grid.css-mistica.js +120 -120
- package/dist/header.css-mistica.js +1 -1
- package/dist/hero.css-mistica.js +2 -2
- package/dist/horizontal-scroll.css-mistica.js +1 -1
- package/dist/icon-button.css-mistica.js +53 -53
- package/dist/icons/icon-chevron.css-mistica.js +2 -2
- package/dist/icons/icon-error.css-mistica.js +1 -1
- package/dist/image.css-mistica.js +10 -10
- package/dist/index.d.ts +12 -0
- package/dist/index.js +48 -0
- package/dist/inline.css-mistica.js +11 -11
- package/dist/list.css-mistica.js +7 -7
- package/dist/loading-bar.css-mistica.js +1 -1
- package/dist/loading-screen.css-mistica.js +4 -4
- package/dist/logo.css-mistica.js +5 -5
- package/dist/menu.css-mistica.js +26 -24
- package/dist/menu.css.d.ts +2 -2
- package/dist/menu.d.ts +15 -3
- package/dist/menu.js +184 -162
- package/dist/mosaic.css-mistica.js +1 -1
- package/dist/navigation-bar.css-mistica.js +9 -9
- package/dist/navigation-breadcrumbs.css-mistica.js +1 -1
- package/dist/navigation-shared.css-mistica.js +9 -9
- package/dist/package-version.js +1 -1
- package/dist/pagination.css-mistica.js +18 -18
- package/dist/pin-field.css-mistica.js +1 -1
- package/dist/popover.css-mistica.js +1 -1
- package/dist/popover.d.ts +1 -0
- package/dist/progress-bar.css-mistica.js +6 -6
- package/dist/radio-button.css-mistica.js +19 -19
- package/dist/radio-button.d.ts +3 -1
- package/dist/radio-button.js +73 -72
- package/dist/rating.css-mistica.js +2 -2
- package/dist/responsive-layout.css-mistica.js +6 -6
- package/dist/screen-reader-only.css-mistica.js +1 -1
- package/dist/select.css-mistica.js +15 -15
- package/dist/sheet-action-row.css-mistica.js +1 -1
- package/dist/sheet-common.css-mistica.js +1 -1
- package/dist/sheet-info.css-mistica.js +1 -1
- package/dist/sidenav-bar-layout.css-mistica.js +1 -1
- package/dist/sidenav-bar.css-mistica.js +71 -71
- package/dist/sidenav-bar.js +55 -50
- package/dist/skeletons.css-mistica.js +6 -6
- package/dist/skins/skin-contract.css-mistica.js +738 -738
- package/dist/skip-link.css-mistica.js +1 -1
- package/dist/slider.css-mistica.js +18 -18
- package/dist/snackbar.css-mistica.js +4 -4
- package/dist/spinner.css-mistica.js +1 -1
- package/dist/square.css-mistica.js +1 -1
- package/dist/stack.css-mistica.js +5 -5
- package/dist/stacking-group.css-mistica.js +1 -1
- package/dist/stepper.css-mistica.js +2 -2
- package/dist/switch-component.css-mistica.js +35 -35
- package/dist/switch-component.d.ts +2 -0
- package/dist/switch-component.js +19 -18
- package/dist/table.css-mistica.js +9 -9
- package/dist/tabs.css-mistica.js +17 -17
- package/dist/tag.css-mistica.js +1 -1
- package/dist/text-field-base.css-mistica.js +16 -16
- package/dist/text-field-components.css-mistica.js +3 -3
- package/dist/text-link.css-mistica.js +6 -6
- package/dist/text.css-mistica.js +6 -6
- package/dist/timeline.css-mistica.js +9 -9
- package/dist/timer.css-mistica.js +6 -6
- package/dist/tooltip.css-mistica.js +1 -1
- package/dist/tooltip.d.ts +3 -1
- package/dist/tooltip.js +158 -147
- package/dist/touchable.css-mistica.js +1 -1
- package/dist/utils/aspect-ratio-support.css-mistica.js +2 -2
- package/dist/video.css-mistica.js +1 -1
- package/dist/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +1 -1
- package/dist-es/accordion.css-mistica.js +6 -6
- package/dist-es/align.css-mistica.js +1 -1
- package/dist-es/autocomplete.css-mistica.js +1 -1
- package/dist-es/avatar.css-mistica.js +1 -1
- package/dist-es/badge.css-mistica.js +1 -1
- package/dist-es/box.css-mistica.js +13 -13
- package/dist-es/boxed.css-mistica.js +23 -23
- package/dist-es/button-group.css-mistica.js +1 -1
- package/dist-es/button-layout.css-mistica.js +14 -14
- package/dist-es/button.css-mistica.js +34 -34
- package/dist-es/callout.css-mistica.js +11 -11
- package/dist-es/card-data.js +10 -12
- package/dist-es/card-internal.css-mistica.js +25 -19
- package/dist-es/card-internal.js +482 -395
- package/dist-es/card-media.js +11 -13
- package/dist-es/card-naked.js +14 -16
- package/dist-es/carousel.css-mistica.js +8 -8
- package/dist-es/checkbox.css-mistica.js +11 -11
- package/dist-es/checkbox.js +19 -19
- package/dist-es/chip.css-mistica.js +15 -15
- package/dist-es/circle.css-mistica.js +1 -1
- package/dist-es/community/advanced-data-card.css-mistica.js +10 -7
- package/dist-es/community/advanced-data-card.js +214 -192
- package/dist-es/community/ai-card.css-mistica.js +4 -4
- package/dist-es/community/ai-card.js +1 -1
- package/dist-es/community/blocks.css-mistica.js +1 -1
- package/dist-es/community/cyber/example-component.css-mistica.js +1 -1
- package/dist-es/community/example-component.css-mistica.js +2 -2
- package/dist-es/counter.css-mistica.js +1 -1
- package/dist-es/cover-hero.css-mistica.js +2 -2
- package/dist-es/credit-card-number-field.css-mistica.js +3 -3
- package/dist-es/date-field.css-mistica.js +1 -1
- package/dist-es/date-time-picker.css-mistica.js +1 -1
- package/dist-es/dialog.css-mistica.js +4 -4
- package/dist-es/divider.css-mistica.js +5 -5
- package/dist-es/double-field.css-mistica.js +2 -2
- package/dist-es/drawer.css-mistica.js +1 -1
- package/dist-es/empty-state-card.css-mistica.js +1 -1
- package/dist-es/empty-state.css-mistica.js +5 -5
- package/dist-es/fade-in.css-mistica.js +1 -1
- package/dist-es/fade-out.css-mistica.js +1 -1
- package/dist-es/feedback.css-mistica.js +1 -1
- package/dist-es/file-upload.css-mistica.js +7 -7
- package/dist-es/fixed-footer-layout.css-mistica.js +2 -2
- package/dist-es/form.css-mistica.js +1 -1
- package/dist-es/generated/mistica-icons/icon-document-information-filled.js +115 -0
- package/dist-es/generated/mistica-icons/icon-document-information-light.js +115 -0
- package/dist-es/generated/mistica-icons/icon-document-information-regular.js +115 -0
- package/dist-es/generated/mistica-icons/icon-internet-roaming-filled.js +109 -0
- package/dist-es/generated/mistica-icons/icon-internet-roaming-light.js +109 -0
- package/dist-es/generated/mistica-icons/icon-internet-roaming-regular.js +109 -0
- package/dist-es/generated/mistica-icons/icon-mobile-information-filled.js +115 -0
- package/dist-es/generated/mistica-icons/icon-mobile-information-light.js +123 -0
- package/dist-es/generated/mistica-icons/icon-mobile-information-regular.js +115 -0
- package/dist-es/generated/mistica-icons/icon-search-ai-filled.js +115 -0
- package/dist-es/generated/mistica-icons/icon-search-ai-light.js +115 -0
- package/dist-es/generated/mistica-icons/icon-search-ai-regular.js +115 -0
- package/dist-es/grid-layout.css-mistica.js +3 -3
- package/dist-es/grid.css-mistica.js +120 -120
- package/dist-es/header.css-mistica.js +1 -1
- package/dist-es/hero.css-mistica.js +2 -2
- package/dist-es/horizontal-scroll.css-mistica.js +1 -1
- package/dist-es/icon-button.css-mistica.js +53 -53
- package/dist-es/icons/icon-chevron.css-mistica.js +2 -2
- package/dist-es/icons/icon-error.css-mistica.js +1 -1
- package/dist-es/image.css-mistica.js +4 -4
- package/dist-es/index.js +1501 -1489
- package/dist-es/inline.css-mistica.js +11 -11
- package/dist-es/list.css-mistica.js +7 -7
- package/dist-es/loading-bar.css-mistica.js +1 -1
- package/dist-es/loading-screen.css-mistica.js +4 -4
- package/dist-es/logo.css-mistica.js +5 -5
- package/dist-es/menu.css-mistica.js +14 -15
- package/dist-es/menu.js +238 -216
- package/dist-es/mosaic.css-mistica.js +1 -1
- package/dist-es/navigation-bar.css-mistica.js +9 -9
- package/dist-es/navigation-breadcrumbs.css-mistica.js +1 -1
- package/dist-es/navigation-shared.css-mistica.js +9 -9
- package/dist-es/package-version.js +1 -1
- package/dist-es/pagination.css-mistica.js +18 -18
- package/dist-es/pin-field.css-mistica.js +1 -1
- package/dist-es/popover.css-mistica.js +1 -1
- package/dist-es/progress-bar.css-mistica.js +6 -6
- package/dist-es/radio-button.css-mistica.js +19 -19
- package/dist-es/radio-button.js +91 -90
- package/dist-es/rating.css-mistica.js +2 -2
- package/dist-es/responsive-layout.css-mistica.js +6 -6
- package/dist-es/screen-reader-only.css-mistica.js +1 -1
- package/dist-es/select.css-mistica.js +15 -15
- package/dist-es/sheet-action-row.css-mistica.js +1 -1
- package/dist-es/sheet-common.css-mistica.js +1 -1
- package/dist-es/sheet-info.css-mistica.js +1 -1
- package/dist-es/sidenav-bar-layout.css-mistica.js +1 -1
- package/dist-es/sidenav-bar.css-mistica.js +71 -71
- package/dist-es/sidenav-bar.js +70 -65
- package/dist-es/skeletons.css-mistica.js +6 -6
- package/dist-es/skins/skin-contract.css-mistica.js +738 -738
- package/dist-es/skip-link.css-mistica.js +1 -1
- package/dist-es/slider.css-mistica.js +18 -18
- package/dist-es/snackbar.css-mistica.js +4 -4
- package/dist-es/spinner.css-mistica.js +1 -1
- package/dist-es/square.css-mistica.js +1 -1
- package/dist-es/stack.css-mistica.js +5 -5
- package/dist-es/stacking-group.css-mistica.js +1 -1
- package/dist-es/stepper.css-mistica.js +2 -2
- package/dist-es/style.css +1 -1
- package/dist-es/switch-component.css-mistica.js +35 -35
- package/dist-es/switch-component.js +34 -33
- package/dist-es/table.css-mistica.js +9 -9
- package/dist-es/tabs.css-mistica.js +17 -17
- package/dist-es/tag.css-mistica.js +1 -1
- package/dist-es/text-field-base.css-mistica.js +16 -16
- package/dist-es/text-field-components.css-mistica.js +3 -3
- package/dist-es/text-link.css-mistica.js +6 -6
- package/dist-es/text.css-mistica.js +6 -6
- package/dist-es/timeline.css-mistica.js +9 -9
- package/dist-es/timer.css-mistica.js +6 -6
- package/dist-es/tooltip.css-mistica.js +1 -1
- package/dist-es/tooltip.js +198 -187
- package/dist-es/touchable.css-mistica.js +1 -1
- package/dist-es/utils/aspect-ratio-support.css-mistica.js +2 -2
- package/dist-es/video.css-mistica.js +1 -1
- package/dist-es/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +1 -1
- package/doc/components.md +35 -0
- package/package.json +4 -3
- package/src/card-cover.tsx +2 -2
- package/src/card-data.tsx +3 -4
- package/src/card-internal.css.ts +36 -0
- package/src/card-internal.tsx +162 -9
- package/src/card-media.tsx +3 -4
- package/src/card-naked.tsx +3 -4
- package/src/checkbox.tsx +6 -1
- package/src/community/__screenshot_tests__/__image_snapshots__/ai-card-screenshot-test-tsx-ai-card-line-break-at-chars-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/__image_snapshots__/ai-card-screenshot-test-tsx-ai-card-static-text-1-snap.png +0 -0
- package/src/community/__screenshot_tests__/ai-card-screenshot-test.tsx +28 -0
- package/src/community/__stories__/advanced-data-card-story.tsx +5 -0
- package/src/community/__type_tests__/advanced-data-card-type-test.tsx +3 -0
- package/src/community/advanced-data-card.css.ts +26 -1
- package/src/community/advanced-data-card.tsx +123 -73
- package/src/community/ai-card.tsx +3 -3
- package/src/index.tsx +12 -0
- package/src/menu.css.ts +5 -9
- package/src/menu.tsx +82 -64
- package/src/package-version.tsx +1 -1
- package/src/popover.tsx +1 -0
- package/src/radio-button.tsx +7 -1
- package/src/sidenav-bar.tsx +9 -2
- package/src/switch-component.tsx +7 -3
- package/src/tooltip.css.ts +1 -0
- package/src/tooltip.tsx +94 -90
|
@@ -10,17 +10,19 @@ import Divider from '../divider';
|
|
|
10
10
|
import {Text2, Text, useTextPresetSizes} from '../text';
|
|
11
11
|
import {vars} from '../skins/skin-contract.css';
|
|
12
12
|
import Box from '../box';
|
|
13
|
-
import Touchable from '../touchable';
|
|
14
13
|
import classNames from 'classnames';
|
|
14
|
+
import Touchable from '../touchable';
|
|
15
15
|
import {useInnerText, useTheme} from '../hooks';
|
|
16
16
|
import {getPrefixedDataAttributes} from '../utils/dom';
|
|
17
17
|
import Inline from '../inline';
|
|
18
18
|
import {applyCssVars} from '../utils/css';
|
|
19
19
|
import Tag from '../tag';
|
|
20
20
|
import {isBiggerHeading} from '../utils/headings';
|
|
21
|
-
import {TopActions} from '../card-internal';
|
|
21
|
+
import {TopActions, useControlState, CardWithControl} from '../card-internal';
|
|
22
|
+
import {useRadioContext} from '../radio-button';
|
|
23
|
+
import * as cardStyles from '../card-internal.css';
|
|
22
24
|
|
|
23
|
-
import type {CardAction} from '../card-internal';
|
|
25
|
+
import type {CardSelectionProps, CardAction} from '../card-internal';
|
|
24
26
|
import type {PressHandler} from '../touchable';
|
|
25
27
|
import type {ExclusifyUnion} from '../utils/utility-types';
|
|
26
28
|
import type StackingGroup from '../stacking-group';
|
|
@@ -55,7 +57,11 @@ type TouchableProps = {
|
|
|
55
57
|
}
|
|
56
58
|
>;
|
|
57
59
|
type TouchableCard<T> = T & TouchableProps;
|
|
58
|
-
type
|
|
60
|
+
type CardInteractionProps<T> = ExclusifyUnion<
|
|
61
|
+
| (TouchableCard<T> & {selected?: boolean})
|
|
62
|
+
| (T & {selected?: boolean})
|
|
63
|
+
| (Omit<T, 'actions' | 'onClose'> & CardSelectionProps)
|
|
64
|
+
>;
|
|
59
65
|
|
|
60
66
|
type CardContentProps = {
|
|
61
67
|
headline?: string | RendersNullableElement<typeof Tag>;
|
|
@@ -265,7 +271,7 @@ type AllowedSlot =
|
|
|
265
271
|
| typeof SimpleBlock
|
|
266
272
|
| typeof ValueBlock;
|
|
267
273
|
|
|
268
|
-
type AdvancedDataCardProps =
|
|
274
|
+
type AdvancedDataCardProps = CardInteractionProps<{
|
|
269
275
|
stackingGroup?: RendersNullableElement<typeof StackingGroup>;
|
|
270
276
|
headline?: RendersNullableElement<typeof Tag>;
|
|
271
277
|
pretitle?: string;
|
|
@@ -295,6 +301,10 @@ type AdvancedDataCardProps = MaybeTouchableCard<{
|
|
|
295
301
|
export const AdvancedDataCard = React.forwardRef<HTMLDivElement, AdvancedDataCardProps>(
|
|
296
302
|
(
|
|
297
303
|
{
|
|
304
|
+
selected,
|
|
305
|
+
checkbox,
|
|
306
|
+
switch: switchProps,
|
|
307
|
+
radioValue,
|
|
298
308
|
stackingGroup,
|
|
299
309
|
headline,
|
|
300
310
|
pretitle,
|
|
@@ -326,14 +336,24 @@ export const AdvancedDataCard = React.forwardRef<HTMLDivElement, AdvancedDataCar
|
|
|
326
336
|
},
|
|
327
337
|
ref
|
|
328
338
|
) => {
|
|
329
|
-
const
|
|
330
|
-
|
|
339
|
+
const {isChecked, toggleChecked} = useControlState(switchProps || checkbox);
|
|
340
|
+
const radioContext = useRadioContext();
|
|
341
|
+
const isSelectable = !!switchProps || !!checkbox || radioValue !== undefined;
|
|
342
|
+
const isSelected =
|
|
343
|
+
switchProps || checkbox
|
|
344
|
+
? isChecked
|
|
345
|
+
: radioValue !== undefined
|
|
346
|
+
? radioContext.selectedValue === radioValue
|
|
347
|
+
: selected;
|
|
348
|
+
const {isIos} = useTheme();
|
|
349
|
+
const isTouchable =
|
|
350
|
+
isSelectable || !!touchableProps.href || !!touchableProps.onPress || !!touchableProps.to;
|
|
331
351
|
const footerProps = {button, footerImage, footerText, footerTextLinesMax, buttonLink};
|
|
332
352
|
|
|
333
353
|
const hasFooter = !!button || !!footerImage || !!footerText || !!buttonLink;
|
|
334
354
|
const hasSlots = !!slot?.length;
|
|
335
355
|
|
|
336
|
-
const topActionsCount = (actions?.length || 0) + (onClose ? 1 : 0);
|
|
356
|
+
const topActionsCount = isSelectable ? 1 : (actions?.length || 0) + (onClose ? 1 : 0);
|
|
337
357
|
|
|
338
358
|
const {text: headlineText, ref: headlineRef} = useInnerText();
|
|
339
359
|
const {text: slotText, ref: slotRef} = useInnerText();
|
|
@@ -347,79 +367,109 @@ export const AdvancedDataCard = React.forwardRef<HTMLDivElement, AdvancedDataCar
|
|
|
347
367
|
.filter(Boolean)
|
|
348
368
|
.join(' ');
|
|
349
369
|
|
|
370
|
+
const content = (
|
|
371
|
+
<>
|
|
372
|
+
{isTouchable && <div className={styles.touchableCardHoverOverlay} />}
|
|
373
|
+
|
|
374
|
+
<div
|
|
375
|
+
className={classNames(
|
|
376
|
+
styles.cardContentStyle,
|
|
377
|
+
!hasFooter && !hasSlots ? styles.minHeight : ''
|
|
378
|
+
)}
|
|
379
|
+
aria-hidden={isTouchable && !isSelectable}
|
|
380
|
+
>
|
|
381
|
+
<Box paddingTop={8}>
|
|
382
|
+
<Inline space={0}>
|
|
383
|
+
<Stack space={8}>
|
|
384
|
+
{stackingGroup}
|
|
385
|
+
<CardContent
|
|
386
|
+
headline={headline}
|
|
387
|
+
headlineRef={headlineRef}
|
|
388
|
+
pretitle={pretitle}
|
|
389
|
+
pretitleAs={pretitleAs}
|
|
390
|
+
pretitleLinesMax={pretitleLinesMax}
|
|
391
|
+
title={title}
|
|
392
|
+
titleAs={titleAs}
|
|
393
|
+
titleLinesMax={titleLinesMax}
|
|
394
|
+
subtitle={subtitle}
|
|
395
|
+
subtitleLinesMax={subtitleLinesMax}
|
|
396
|
+
description={description}
|
|
397
|
+
descriptionLinesMax={descriptionLinesMax}
|
|
398
|
+
/>
|
|
399
|
+
</Stack>
|
|
400
|
+
{/** Hack to avoid content from rendering on top of the top action buttons */}
|
|
401
|
+
{!stackingGroup && (
|
|
402
|
+
<div
|
|
403
|
+
style={applyCssVars({
|
|
404
|
+
[styles.vars.topActionsCount]: String(topActionsCount),
|
|
405
|
+
})}
|
|
406
|
+
className={classNames(
|
|
407
|
+
styles.topActionsWithoutIcon,
|
|
408
|
+
switchProps && styles.switchSpace[isIos ? 'ios' : 'default']
|
|
409
|
+
)}
|
|
410
|
+
/>
|
|
411
|
+
)}
|
|
412
|
+
</Inline>
|
|
413
|
+
</Box>
|
|
414
|
+
</div>
|
|
415
|
+
<div style={{flexGrow: 1}} />
|
|
416
|
+
{hasSlots && (
|
|
417
|
+
<div className={styles.slot} ref={slotRef} aria-hidden={isTouchable && !isSelectable}>
|
|
418
|
+
{slot.map((item, index) => {
|
|
419
|
+
return (
|
|
420
|
+
<div key={index}>
|
|
421
|
+
<div className={styles.paddingX}>{item}</div>
|
|
422
|
+
|
|
423
|
+
{index + 1 !== slot.length && (
|
|
424
|
+
<Box paddingY={slotDividerPadding}>
|
|
425
|
+
{!noSlotDivider && <Divider />}
|
|
426
|
+
</Box>
|
|
427
|
+
)}
|
|
428
|
+
</div>
|
|
429
|
+
);
|
|
430
|
+
})}
|
|
431
|
+
</div>
|
|
432
|
+
)}
|
|
433
|
+
</>
|
|
434
|
+
);
|
|
435
|
+
|
|
350
436
|
return (
|
|
351
437
|
<section
|
|
352
|
-
className={
|
|
438
|
+
className={classNames(
|
|
439
|
+
styles.container,
|
|
440
|
+
isSelected && cardStyles.selectionOutline,
|
|
441
|
+
isSelected && cardStyles.selectionOutlineColor.default
|
|
442
|
+
)}
|
|
353
443
|
{...getPrefixedDataAttributes({testid: 'AdvancedDataCard', ...dataAttributes})}
|
|
354
444
|
ref={ref}
|
|
355
445
|
aria-label={isTouchable ? undefined : ariaLabel}
|
|
356
446
|
>
|
|
357
447
|
<Boxed className={styles.dataCard} width="100%" height="100%" minHeight={styles.MIN_HEIGHT}>
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
)}
|
|
371
|
-
aria-hidden={isTouchable}
|
|
448
|
+
{isSelectable ? (
|
|
449
|
+
<CardWithControl
|
|
450
|
+
maybe
|
|
451
|
+
{...(checkbox
|
|
452
|
+
? {checkbox}
|
|
453
|
+
: switchProps
|
|
454
|
+
? {switch: switchProps}
|
|
455
|
+
: {radioValue: radioValue ?? ''})}
|
|
456
|
+
checked={isChecked}
|
|
457
|
+
onChange={toggleChecked}
|
|
458
|
+
aria-label={ariaLabel}
|
|
459
|
+
className={classNames(styles.touchable, styles.selectionTouchable)}
|
|
372
460
|
>
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
titleLinesMax={titleLinesMax}
|
|
386
|
-
subtitle={subtitle}
|
|
387
|
-
subtitleLinesMax={subtitleLinesMax}
|
|
388
|
-
description={description}
|
|
389
|
-
descriptionLinesMax={descriptionLinesMax}
|
|
390
|
-
/>
|
|
391
|
-
</Stack>
|
|
392
|
-
{/** Hack to avoid content from rendering on top of the top action buttons */}
|
|
393
|
-
{!stackingGroup && (
|
|
394
|
-
<div
|
|
395
|
-
style={applyCssVars({
|
|
396
|
-
[styles.vars.topActionsCount]: String(topActionsCount),
|
|
397
|
-
})}
|
|
398
|
-
className={styles.topActionsWithoutIcon}
|
|
399
|
-
/>
|
|
400
|
-
)}
|
|
401
|
-
</Inline>
|
|
402
|
-
</Box>
|
|
403
|
-
</div>
|
|
404
|
-
<div style={{flexGrow: 1}} />
|
|
405
|
-
{hasSlots && (
|
|
406
|
-
<div className={styles.slot} ref={slotRef} aria-hidden={isTouchable}>
|
|
407
|
-
{slot.map((item, index) => {
|
|
408
|
-
return (
|
|
409
|
-
<div key={index}>
|
|
410
|
-
<div className={styles.paddingX}>{item}</div>
|
|
411
|
-
|
|
412
|
-
{index + 1 !== slot.length && (
|
|
413
|
-
<Box paddingY={slotDividerPadding}>
|
|
414
|
-
{!noSlotDivider && <Divider />}
|
|
415
|
-
</Box>
|
|
416
|
-
)}
|
|
417
|
-
</div>
|
|
418
|
-
);
|
|
419
|
-
})}
|
|
420
|
-
</div>
|
|
421
|
-
)}
|
|
422
|
-
</Touchable>
|
|
461
|
+
{content}
|
|
462
|
+
</CardWithControl>
|
|
463
|
+
) : (
|
|
464
|
+
<Touchable
|
|
465
|
+
maybe
|
|
466
|
+
{...touchableProps}
|
|
467
|
+
aria-label={isTouchable ? ariaLabel : undefined}
|
|
468
|
+
className={styles.touchable}
|
|
469
|
+
>
|
|
470
|
+
{content}
|
|
471
|
+
</Touchable>
|
|
472
|
+
)}
|
|
423
473
|
{hasFooter && <CardFooter {...footerProps} />}
|
|
424
474
|
</Boxed>
|
|
425
475
|
<TopActions actions={actions} onClose={onClose} />
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import {BaseTouchable} from '../touchable';
|
|
5
|
-
import {
|
|
5
|
+
import {Text2} from '../text';
|
|
6
6
|
import {vars} from '../skins/skin-contract.css';
|
|
7
7
|
import {useIsInViewport} from '../hooks';
|
|
8
8
|
import {isClientSide} from '../utils/environment';
|
|
@@ -201,7 +201,7 @@ const AiCard = ({
|
|
|
201
201
|
</span>
|
|
202
202
|
)}
|
|
203
203
|
<div ref={textLineRef} className={styles.textLine} aria-hidden="true" style={textLineStyle}>
|
|
204
|
-
<
|
|
204
|
+
<Text2 regular color={vars.colors.textPrimary} as="span">
|
|
205
205
|
<span className={styles.textWrapper}>
|
|
206
206
|
<span className={styles.ghost}>
|
|
207
207
|
{text}
|
|
@@ -222,7 +222,7 @@ const AiCard = ({
|
|
|
222
222
|
)}
|
|
223
223
|
</span>
|
|
224
224
|
</span>
|
|
225
|
-
</
|
|
225
|
+
</Text2>
|
|
226
226
|
</div>
|
|
227
227
|
</BaseTouchable>
|
|
228
228
|
);
|
package/src/index.tsx
CHANGED
|
@@ -972,6 +972,9 @@ export {default as IconDisturbRegular} from './generated/mistica-icons/icon-dist
|
|
|
972
972
|
export {default as IconDnaFilled} from './generated/mistica-icons/icon-dna-filled';
|
|
973
973
|
export {default as IconDnaLight} from './generated/mistica-icons/icon-dna-light';
|
|
974
974
|
export {default as IconDnaRegular} from './generated/mistica-icons/icon-dna-regular';
|
|
975
|
+
export {default as IconDocumentInformationFilled} from './generated/mistica-icons/icon-document-information-filled';
|
|
976
|
+
export {default as IconDocumentInformationLight} from './generated/mistica-icons/icon-document-information-light';
|
|
977
|
+
export {default as IconDocumentInformationRegular} from './generated/mistica-icons/icon-document-information-regular';
|
|
975
978
|
export {default as IconDocumentOtherFilled} from './generated/mistica-icons/icon-document-other-filled';
|
|
976
979
|
export {default as IconDocumentOtherLight} from './generated/mistica-icons/icon-document-other-light';
|
|
977
980
|
export {default as IconDocumentOtherRegular} from './generated/mistica-icons/icon-document-other-regular';
|
|
@@ -1393,6 +1396,9 @@ export {default as IconInternetPendriveFilled} from './generated/mistica-icons/i
|
|
|
1393
1396
|
export {default as IconInternetPendriveLight} from './generated/mistica-icons/icon-internet-pendrive-light';
|
|
1394
1397
|
export {default as IconInternetPendriveRegular} from './generated/mistica-icons/icon-internet-pendrive-regular';
|
|
1395
1398
|
export {default as IconInternetRegular} from './generated/mistica-icons/icon-internet-regular';
|
|
1399
|
+
export {default as IconInternetRoamingFilled} from './generated/mistica-icons/icon-internet-roaming-filled';
|
|
1400
|
+
export {default as IconInternetRoamingLight} from './generated/mistica-icons/icon-internet-roaming-light';
|
|
1401
|
+
export {default as IconInternetRoamingRegular} from './generated/mistica-icons/icon-internet-roaming-regular';
|
|
1396
1402
|
export {default as IconIntranetFilled} from './generated/mistica-icons/icon-intranet-filled';
|
|
1397
1403
|
export {default as IconIntranetLight} from './generated/mistica-icons/icon-intranet-light';
|
|
1398
1404
|
export {default as IconIntranetRegular} from './generated/mistica-icons/icon-intranet-regular';
|
|
@@ -1585,6 +1591,9 @@ export {default as IconMobileDeviceRegular} from './generated/mistica-icons/icon
|
|
|
1585
1591
|
export {default as IconMobileEuroFilled} from './generated/mistica-icons/icon-mobile-euro-filled';
|
|
1586
1592
|
export {default as IconMobileEuroLight} from './generated/mistica-icons/icon-mobile-euro-light';
|
|
1587
1593
|
export {default as IconMobileEuroRegular} from './generated/mistica-icons/icon-mobile-euro-regular';
|
|
1594
|
+
export {default as IconMobileInformationFilled} from './generated/mistica-icons/icon-mobile-information-filled';
|
|
1595
|
+
export {default as IconMobileInformationLight} from './generated/mistica-icons/icon-mobile-information-light';
|
|
1596
|
+
export {default as IconMobileInformationRegular} from './generated/mistica-icons/icon-mobile-information-regular';
|
|
1588
1597
|
export {default as IconMobilePauseFilled} from './generated/mistica-icons/icon-mobile-pause-filled';
|
|
1589
1598
|
export {default as IconMobilePauseLight} from './generated/mistica-icons/icon-mobile-pause-light';
|
|
1590
1599
|
export {default as IconMobilePauseRegular} from './generated/mistica-icons/icon-mobile-pause-regular';
|
|
@@ -1967,6 +1976,9 @@ export {default as IconSdFilled} from './generated/mistica-icons/icon-sd-filled'
|
|
|
1967
1976
|
export {default as IconSdLight} from './generated/mistica-icons/icon-sd-light';
|
|
1968
1977
|
export {default as IconSdRegular} from './generated/mistica-icons/icon-sd-regular';
|
|
1969
1978
|
export {default as IconSeaLight} from './generated/mistica-icons/icon-sea-light';
|
|
1979
|
+
export {default as IconSearchAiFilled} from './generated/mistica-icons/icon-search-ai-filled';
|
|
1980
|
+
export {default as IconSearchAiLight} from './generated/mistica-icons/icon-search-ai-light';
|
|
1981
|
+
export {default as IconSearchAiRegular} from './generated/mistica-icons/icon-search-ai-regular';
|
|
1970
1982
|
export {default as IconSearchCloudFilled} from './generated/mistica-icons/icon-search-cloud-filled';
|
|
1971
1983
|
export {default as IconSearchCloudLight} from './generated/mistica-icons/icon-search-cloud-light';
|
|
1972
1984
|
export {default as IconSearchCloudRegular} from './generated/mistica-icons/icon-search-cloud-regular';
|
package/src/menu.css.ts
CHANGED
|
@@ -4,23 +4,21 @@ import {vars as skinVars} from './skins/skin-contract.css';
|
|
|
4
4
|
import * as mq from './media-queries.css';
|
|
5
5
|
|
|
6
6
|
const top = createVar();
|
|
7
|
-
const bottom = createVar();
|
|
8
7
|
const left = createVar();
|
|
9
8
|
const width = createVar();
|
|
10
|
-
const right = createVar();
|
|
11
9
|
const maxHeight = createVar();
|
|
10
|
+
const maxWidth = createVar();
|
|
12
11
|
const transformOrigin = createVar();
|
|
13
12
|
|
|
14
13
|
const MENU_MIN_WIDTH = 136;
|
|
15
|
-
const MENU_MAX_WIDTH = 280;
|
|
14
|
+
export const MENU_MAX_WIDTH = 280;
|
|
16
15
|
|
|
17
16
|
export const vars = {
|
|
18
17
|
top,
|
|
19
|
-
bottom,
|
|
20
18
|
left,
|
|
21
|
-
right,
|
|
22
19
|
width,
|
|
23
20
|
maxHeight,
|
|
21
|
+
maxWidth,
|
|
24
22
|
transformOrigin,
|
|
25
23
|
};
|
|
26
24
|
|
|
@@ -35,12 +33,10 @@ export const menuContainer = style([
|
|
|
35
33
|
}),
|
|
36
34
|
{
|
|
37
35
|
top,
|
|
38
|
-
bottom,
|
|
39
36
|
left,
|
|
40
|
-
right,
|
|
41
37
|
width,
|
|
42
|
-
minWidth: MENU_MIN_WIDTH,
|
|
43
|
-
maxWidth: MENU_MAX_WIDTH,
|
|
38
|
+
minWidth: `min(${MENU_MIN_WIDTH}px, ${maxWidth})`,
|
|
39
|
+
maxWidth: `min(${MENU_MAX_WIDTH}px, ${maxWidth})`,
|
|
44
40
|
maxHeight,
|
|
45
41
|
transformOrigin,
|
|
46
42
|
listStyleType: 'none',
|
package/src/menu.tsx
CHANGED
|
@@ -270,8 +270,14 @@ export const MenuSection = ({children}: MenuSectionProps): JSX.Element => {
|
|
|
270
270
|
);
|
|
271
271
|
};
|
|
272
272
|
|
|
273
|
-
const MARGIN_THRESHOLD = 12;
|
|
274
273
|
const MENU_OFFSET_FROM_TARGET = 8;
|
|
274
|
+
const REFLECTED_PLACEMENT = {top: 'bottom', bottom: 'top', left: 'right', right: 'left'} as const;
|
|
275
|
+
const TRANSFORM_ORIGINS = {
|
|
276
|
+
top: 'center bottom',
|
|
277
|
+
bottom: 'center top',
|
|
278
|
+
left: 'right center',
|
|
279
|
+
right: 'left center',
|
|
280
|
+
} as const;
|
|
275
281
|
|
|
276
282
|
type MenuRenderProps = {
|
|
277
283
|
ref: (element: HTMLElement | null) => void;
|
|
@@ -286,19 +292,36 @@ type TargetRenderProps = {
|
|
|
286
292
|
};
|
|
287
293
|
|
|
288
294
|
export type MenuProps = {
|
|
295
|
+
/**
|
|
296
|
+
* Width in pixels. Values are clamped to the range 136–280.
|
|
297
|
+
* The final width never exceeds the viewport width, even if that
|
|
298
|
+
* means going below the 136px minimum.
|
|
299
|
+
*
|
|
300
|
+
* Examples: 100 → 136, 200 → 200, 500 → 280.
|
|
301
|
+
*/
|
|
289
302
|
width?: number;
|
|
290
303
|
renderTarget: (props: TargetRenderProps) => React.ReactNode;
|
|
291
304
|
renderMenu: (props: MenuRenderProps) => React.ReactNode;
|
|
292
305
|
children?: void;
|
|
293
|
-
position?: 'left' | 'right';
|
|
294
306
|
dataAttributes?: DataAttributes;
|
|
295
|
-
}
|
|
307
|
+
} & ExclusifyUnion<
|
|
308
|
+
| {
|
|
309
|
+
/** @deprecated Use placement and alignment instead. */
|
|
310
|
+
position?: 'left' | 'right';
|
|
311
|
+
}
|
|
312
|
+
| {
|
|
313
|
+
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
314
|
+
alignment?: 'start' | 'middle' | 'end';
|
|
315
|
+
}
|
|
316
|
+
>;
|
|
296
317
|
|
|
297
318
|
export const Menu = ({
|
|
298
319
|
renderTarget,
|
|
299
320
|
renderMenu,
|
|
300
321
|
width,
|
|
301
322
|
position = 'left',
|
|
323
|
+
placement = 'bottom',
|
|
324
|
+
alignment = position === 'left' ? 'start' : 'end',
|
|
302
325
|
dataAttributes,
|
|
303
326
|
}: MenuProps): JSX.Element => {
|
|
304
327
|
const [isMenuOpen, setIsMenuOpen] = React.useState(false);
|
|
@@ -309,11 +332,9 @@ export const Menu = ({
|
|
|
309
332
|
const menuRef = React.useRef<HTMLDivElement | null>(null);
|
|
310
333
|
|
|
311
334
|
const [itemsComputedProps, setItemsComputedProps] = React.useState<{
|
|
312
|
-
left
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
bottom: string;
|
|
316
|
-
maxHeight?: number;
|
|
335
|
+
left: number;
|
|
336
|
+
top: number;
|
|
337
|
+
maxHeight: number;
|
|
317
338
|
transformOrigin: string;
|
|
318
339
|
} | null>(null);
|
|
319
340
|
|
|
@@ -326,44 +347,52 @@ export const Menu = ({
|
|
|
326
347
|
return;
|
|
327
348
|
}
|
|
328
349
|
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
const
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
if (isMenuOnBottom) {
|
|
348
|
-
setItemsComputedProps({
|
|
349
|
-
left: leftDirection,
|
|
350
|
-
right: rightDirection,
|
|
351
|
-
top: `${bottomTargetWithOffset}px`,
|
|
352
|
-
bottom: 'auto',
|
|
353
|
-
maxHeight: menuFitsOnBottom ? undefined : availableSpaceOnBottom,
|
|
354
|
-
transformOrigin: 'center top',
|
|
355
|
-
});
|
|
356
|
-
} else {
|
|
357
|
-
setItemsComputedProps({
|
|
358
|
-
left: leftDirection,
|
|
359
|
-
right: rightDirection,
|
|
360
|
-
top: 'auto',
|
|
361
|
-
bottom: `${windowSize.height - topTargetWithOffset}px`,
|
|
362
|
-
maxHeight: menuFitsOnTop ? undefined : availableSpaceOnTop,
|
|
363
|
-
transformOrigin: 'center bottom',
|
|
364
|
-
});
|
|
350
|
+
const availableSpace = {
|
|
351
|
+
top: targetRect.top - MENU_OFFSET_FROM_TARGET,
|
|
352
|
+
bottom: windowSize.height - targetRect.bottom - MENU_OFFSET_FROM_TARGET,
|
|
353
|
+
left: targetRect.left - MENU_OFFSET_FROM_TARGET,
|
|
354
|
+
right: windowSize.width - targetRect.right - MENU_OFFSET_FROM_TARGET,
|
|
355
|
+
};
|
|
356
|
+
const menuSize = placement === 'top' || placement === 'bottom' ? menu.scrollHeight : menu.offsetWidth;
|
|
357
|
+
const candidateReflectedPlacement = REFLECTED_PLACEMENT[placement];
|
|
358
|
+
let finalPlacement =
|
|
359
|
+
availableSpace[placement] < menuSize &&
|
|
360
|
+
availableSpace[candidateReflectedPlacement] > availableSpace[placement]
|
|
361
|
+
? candidateReflectedPlacement
|
|
362
|
+
: placement;
|
|
363
|
+
if (
|
|
364
|
+
(finalPlacement === 'left' || finalPlacement === 'right') &&
|
|
365
|
+
availableSpace[finalPlacement] < menu.offsetWidth
|
|
366
|
+
) {
|
|
367
|
+
finalPlacement = availableSpace.bottom >= availableSpace.top ? 'bottom' : 'top';
|
|
365
368
|
}
|
|
366
|
-
|
|
369
|
+
|
|
370
|
+
const isVertical = finalPlacement === 'top' || finalPlacement === 'bottom';
|
|
371
|
+
const maxHeight = Math.max(0, isVertical ? availableSpace[finalPlacement] : windowSize.height);
|
|
372
|
+
const heightMenu = Math.min(menu.scrollHeight, maxHeight);
|
|
373
|
+
const widthMenu = menu.offsetWidth;
|
|
374
|
+
const targetStart = isVertical ? targetRect.left : targetRect.top;
|
|
375
|
+
const targetSize = isVertical ? targetRect.width : targetRect.height;
|
|
376
|
+
const alignmentSize = isVertical ? widthMenu : heightMenu;
|
|
377
|
+
const alignmentOffset = alignment === 'start' ? 0 : alignment === 'end' ? 1 : 0.5;
|
|
378
|
+
const alignedPosition = targetStart + (targetSize - alignmentSize) * alignmentOffset;
|
|
379
|
+
const shiftedPosition = Math.max(
|
|
380
|
+
0,
|
|
381
|
+
Math.min(alignedPosition, (isVertical ? windowSize.width : windowSize.height) - alignmentSize)
|
|
382
|
+
);
|
|
383
|
+
const positions = {
|
|
384
|
+
top: {left: shiftedPosition, top: targetRect.top - MENU_OFFSET_FROM_TARGET - heightMenu},
|
|
385
|
+
bottom: {left: shiftedPosition, top: targetRect.bottom + MENU_OFFSET_FROM_TARGET},
|
|
386
|
+
left: {left: targetRect.left - MENU_OFFSET_FROM_TARGET - widthMenu, top: shiftedPosition},
|
|
387
|
+
right: {left: targetRect.right + MENU_OFFSET_FROM_TARGET, top: shiftedPosition},
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
setItemsComputedProps({
|
|
391
|
+
...positions[finalPlacement],
|
|
392
|
+
maxHeight,
|
|
393
|
+
transformOrigin: TRANSFORM_ORIGINS[finalPlacement],
|
|
394
|
+
});
|
|
395
|
+
}, [placement, alignment, isMenuOpen, menu, target, width, windowSize]);
|
|
367
396
|
|
|
368
397
|
const targetProps = React.useMemo(
|
|
369
398
|
() => ({
|
|
@@ -504,29 +533,18 @@ export const Menu = ({
|
|
|
504
533
|
<div
|
|
505
534
|
style={{
|
|
506
535
|
...applyCssVars({
|
|
536
|
+
[styles.vars.maxWidth]:
|
|
537
|
+
`${Math.min(styles.MENU_MAX_WIDTH, Math.max(0, windowSize.width))}px`,
|
|
538
|
+
...(width && {
|
|
539
|
+
[styles.vars.width]: `${width}px`,
|
|
540
|
+
}),
|
|
507
541
|
...(itemsComputedProps
|
|
508
542
|
? {
|
|
509
|
-
[styles.vars.top]: itemsComputedProps.top
|
|
510
|
-
[styles.vars.
|
|
543
|
+
[styles.vars.top]: `${itemsComputedProps.top}px`,
|
|
544
|
+
[styles.vars.left]: `${itemsComputedProps.left}px`,
|
|
545
|
+
[styles.vars.maxHeight]: `${itemsComputedProps.maxHeight}px`,
|
|
511
546
|
[styles.vars.transformOrigin]:
|
|
512
547
|
itemsComputedProps.transformOrigin,
|
|
513
|
-
|
|
514
|
-
...(itemsComputedProps.left !== undefined && {
|
|
515
|
-
[styles.vars.left]: `${itemsComputedProps.left}px`,
|
|
516
|
-
}),
|
|
517
|
-
|
|
518
|
-
...(itemsComputedProps.right !== undefined && {
|
|
519
|
-
[styles.vars.right]: `${itemsComputedProps.right}px`,
|
|
520
|
-
}),
|
|
521
|
-
|
|
522
|
-
...(itemsComputedProps.maxHeight !== undefined && {
|
|
523
|
-
[styles.vars.maxHeight]:
|
|
524
|
-
`${itemsComputedProps.maxHeight}px`,
|
|
525
|
-
}),
|
|
526
|
-
|
|
527
|
-
...(width !== undefined && {
|
|
528
|
-
[styles.vars.width]: width ? `${width}px` : '',
|
|
529
|
-
}),
|
|
530
548
|
}
|
|
531
549
|
: {}),
|
|
532
550
|
}),
|
package/src/package-version.tsx
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// DO NOT EDIT THIS FILE. It's autogenerated by set-version.js
|
|
2
|
-
export const PACKAGE_VERSION = '17.
|
|
2
|
+
export const PACKAGE_VERSION = '17.7.0' as string;
|
package/src/popover.tsx
CHANGED
package/src/radio-button.tsx
CHANGED
|
@@ -44,6 +44,7 @@ type PropsRender = {
|
|
|
44
44
|
}) => React.ReactNode;
|
|
45
45
|
children?: undefined;
|
|
46
46
|
dataAttributes?: DataAttributes;
|
|
47
|
+
className?: string;
|
|
47
48
|
'aria-label'?: string;
|
|
48
49
|
'aria-labelledby'?: string;
|
|
49
50
|
};
|
|
@@ -54,6 +55,7 @@ type PropsChildren = {
|
|
|
54
55
|
children?: React.ReactNode;
|
|
55
56
|
render?: undefined;
|
|
56
57
|
dataAttributes?: DataAttributes;
|
|
58
|
+
className?: string;
|
|
57
59
|
'aria-label'?: string;
|
|
58
60
|
'aria-labelledby'?: string;
|
|
59
61
|
};
|
|
@@ -62,6 +64,7 @@ const RadioButton = ({
|
|
|
62
64
|
value,
|
|
63
65
|
id,
|
|
64
66
|
dataAttributes,
|
|
67
|
+
className,
|
|
65
68
|
'aria-labelledby': ariaLabelledby,
|
|
66
69
|
'aria-label': ariaLabel,
|
|
67
70
|
...rest
|
|
@@ -171,7 +174,10 @@ const RadioButton = ({
|
|
|
171
174
|
}
|
|
172
175
|
}}
|
|
173
176
|
onKeyDown={disabled ? undefined : handleKeyDown}
|
|
174
|
-
className={
|
|
177
|
+
className={classnames(
|
|
178
|
+
disabled ? styles.radioButtonContainerDisabled : styles.radioButton,
|
|
179
|
+
className
|
|
180
|
+
)}
|
|
175
181
|
{...getPrefixedDataAttributes({testid: 'RadioButton', ...dataAttributes})}
|
|
176
182
|
>
|
|
177
183
|
{rest.render ? (
|
package/src/sidenav-bar.tsx
CHANGED
|
@@ -446,8 +446,15 @@ const SidenavBar = ({
|
|
|
446
446
|
const footerDividerSentinelRef = React.useRef<HTMLDivElement>(null);
|
|
447
447
|
const bodyRef = React.useRef<HTMLDivElement>(null);
|
|
448
448
|
|
|
449
|
+
// The mobile treatment replaces the whole rail, so a trip to a narrow screen unmounts the body and
|
|
450
|
+
// its sentinels. Both dividers go back to their rest state, and the observers of the new body decide
|
|
451
|
+
// again: a divider earned by a scroll before the trip does not belong to the body that comes back.
|
|
449
452
|
React.useEffect(() => {
|
|
450
|
-
if (!bodyRef.current)
|
|
453
|
+
if (!bodyRef.current) {
|
|
454
|
+
setShowHeaderDivider(false);
|
|
455
|
+
setShowFooterDivider(false);
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
451
458
|
|
|
452
459
|
// The sentinels have no height, and at rest they sit exactly on the edge of the scrollport. A
|
|
453
460
|
// fractional layout (a boxed sidenav measures 100vh minus its margins) can leave them half a
|
|
@@ -478,7 +485,7 @@ const SidenavBar = ({
|
|
|
478
485
|
headerObserver.disconnect();
|
|
479
486
|
footerObserver.disconnect();
|
|
480
487
|
};
|
|
481
|
-
}, []);
|
|
488
|
+
}, [isTabletOrSmaller]);
|
|
482
489
|
|
|
483
490
|
// The rail is travelling between its two widths. See `columnsWhileMoving`.
|
|
484
491
|
const isMoving = isSidenavMoving(collapseState);
|