@telefonica/mistica 17.5.0 → 17.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/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 +1 -1
- 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 +11 -11
- 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 +13 -13
- 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/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/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/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 +1 -1
- 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 +13 -13
- 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/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/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/package-version.tsx +1 -1
- package/src/radio-button.tsx +7 -1
- package/src/switch-component.tsx +7 -3
|
@@ -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/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.6.0' as string;
|
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/switch-component.tsx
CHANGED
|
@@ -6,6 +6,7 @@ https://github.com/storybookjs/storybook/issues/11980
|
|
|
6
6
|
|
|
7
7
|
'use client';
|
|
8
8
|
import * as React from 'react';
|
|
9
|
+
import classnames from 'classnames';
|
|
9
10
|
import {debounce} from './utils/helpers';
|
|
10
11
|
import {SPACE} from './utils/keys';
|
|
11
12
|
import {useControlProps} from './form-context';
|
|
@@ -36,6 +37,7 @@ type PropsRender = {
|
|
|
36
37
|
'aria-labelledby'?: string;
|
|
37
38
|
'aria-label'?: string;
|
|
38
39
|
dataAttributes?: DataAttributes;
|
|
40
|
+
className?: string;
|
|
39
41
|
};
|
|
40
42
|
|
|
41
43
|
type PropsChildren = {
|
|
@@ -49,6 +51,7 @@ type PropsChildren = {
|
|
|
49
51
|
'aria-labelledby'?: string;
|
|
50
52
|
'aria-label'?: string;
|
|
51
53
|
dataAttributes?: DataAttributes;
|
|
54
|
+
className?: string;
|
|
52
55
|
};
|
|
53
56
|
|
|
54
57
|
const Switch = (props: PropsRender | PropsChildren): JSX.Element => {
|
|
@@ -155,15 +158,16 @@ const Switch = (props: PropsRender | PropsChildren): JSX.Element => {
|
|
|
155
158
|
onKeyDown={disabled ? undefined : handleKeyDown}
|
|
156
159
|
tabIndex={disabled ? undefined : 0}
|
|
157
160
|
ref={focusableRef}
|
|
158
|
-
className={
|
|
161
|
+
className={classnames(
|
|
159
162
|
props.render
|
|
160
163
|
? disabled
|
|
161
164
|
? styles.containerDisabledFullWidth
|
|
162
165
|
: styles.containerFullWidth
|
|
163
166
|
: disabled
|
|
164
167
|
? styles.containerDisabled
|
|
165
|
-
: styles.container
|
|
166
|
-
|
|
168
|
+
: styles.container,
|
|
169
|
+
props.className
|
|
170
|
+
)}
|
|
167
171
|
aria-disabled={disabled}
|
|
168
172
|
aria-label={props['aria-label']}
|
|
169
173
|
aria-labelledby={props['aria-label'] ? undefined : labelId}
|