material-plus-ui 0.0.1 → 1.1.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/README.md +39 -28
- package/dist/components/accordion/MPAccordion.d.ts +115 -0
- package/dist/components/accordion/MPAccordion.js +1 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/alert/MPAlert.d.ts +91 -0
- package/dist/components/alert/MPAlert.js +1 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/index.js +1 -0
- package/dist/components/animate-appear/MPAnimateAppear.d.ts +56 -0
- package/dist/components/animate-appear/MPAnimateAppear.js +1 -0
- package/dist/components/animate-appear/index.d.ts +2 -0
- package/dist/components/animate-appear/index.js +1 -0
- package/dist/components/animate-blink/MPAnimateBlink.d.ts +41 -0
- package/dist/components/animate-blink/MPAnimateBlink.js +1 -0
- package/dist/components/animate-blink/index.d.ts +2 -0
- package/dist/components/animate-blink/index.js +1 -0
- package/dist/components/animate-fade/MPAnimateFade.d.ts +38 -0
- package/dist/components/animate-fade/MPAnimateFade.js +1 -0
- package/dist/components/animate-fade/index.d.ts +2 -0
- package/dist/components/animate-fade/index.js +1 -0
- package/dist/components/animate-grow/MPAnimateGrow.d.ts +52 -0
- package/dist/components/animate-grow/MPAnimateGrow.js +1 -0
- package/dist/components/animate-grow/index.d.ts +2 -0
- package/dist/components/animate-grow/index.js +1 -0
- package/dist/components/animate-headline/MPAnimateHeadline.d.ts +63 -0
- package/dist/components/animate-headline/MPAnimateHeadline.js +1 -0
- package/dist/components/animate-headline/index.d.ts +2 -0
- package/dist/components/animate-headline/index.js +1 -0
- package/dist/components/animate-lighting/MPAnimateLighting.d.ts +68 -0
- package/dist/components/animate-lighting/MPAnimateLighting.js +1 -0
- package/dist/components/animate-lighting/index.d.ts +2 -0
- package/dist/components/animate-lighting/index.js +1 -0
- package/dist/components/animate-marquee/MPAnimateMarquee.d.ts +66 -0
- package/dist/components/animate-marquee/MPAnimateMarquee.js +1 -0
- package/dist/components/animate-marquee/index.d.ts +2 -0
- package/dist/components/animate-marquee/index.js +1 -0
- package/dist/components/animate-rotate/MPAnimateRotate.d.ts +56 -0
- package/dist/components/animate-rotate/MPAnimateRotate.js +1 -0
- package/dist/components/animate-rotate/index.d.ts +2 -0
- package/dist/components/animate-rotate/index.js +1 -0
- package/dist/components/animate-slide/MPAnimateSlide.d.ts +53 -0
- package/dist/components/animate-slide/MPAnimateSlide.js +1 -0
- package/dist/components/animate-slide/index.d.ts +2 -0
- package/dist/components/animate-slide/index.js +1 -0
- package/dist/components/animate-typing/MPAnimateTyping.d.ts +59 -0
- package/dist/components/animate-typing/MPAnimateTyping.js +1 -0
- package/dist/components/animate-typing/index.d.ts +2 -0
- package/dist/components/animate-typing/index.js +1 -0
- package/dist/components/animate-zoom/MPAnimateZoom.d.ts +44 -0
- package/dist/components/animate-zoom/MPAnimateZoom.js +1 -0
- package/dist/components/animate-zoom/index.d.ts +2 -0
- package/dist/components/animate-zoom/index.js +1 -0
- package/dist/components/aspect-ratio/MPAspectRatio.d.ts +69 -0
- package/dist/components/aspect-ratio/MPAspectRatio.js +1 -0
- package/dist/components/aspect-ratio/index.d.ts +2 -0
- package/dist/components/aspect-ratio/index.js +1 -0
- package/dist/components/avatar/MPAvatar.d.ts +104 -0
- package/dist/components/avatar/MPAvatar.js +1 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/badge/MPBadge.d.ts +104 -0
- package/dist/components/badge/MPBadge.js +1 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/blockquote/MPBlockquote.d.ts +73 -0
- package/dist/components/blockquote/MPBlockquote.js +1 -0
- package/dist/components/blockquote/index.d.ts +2 -0
- package/dist/components/blockquote/index.js +1 -0
- package/dist/components/bottom-navigation/MPBottomNavigation.d.ts +144 -0
- package/dist/components/bottom-navigation/MPBottomNavigation.js +1 -0
- package/dist/components/bottom-navigation/index.d.ts +2 -0
- package/dist/components/bottom-navigation/index.js +1 -0
- package/dist/components/box/MPBox.d.ts +78 -0
- package/dist/components/box/MPBox.js +1 -0
- package/dist/components/box/index.d.ts +2 -0
- package/dist/components/box/index.js +1 -0
- package/dist/components/breadcrumb/MPBreadcrumb.d.ts +127 -0
- package/dist/components/breadcrumb/MPBreadcrumb.js +1 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/breadcrumb/index.js +1 -0
- package/dist/components/button/MPButton.d.ts +75 -0
- package/dist/components/button/MPButton.js +1 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/button-group/MPButtonGroup.d.ts +31 -0
- package/dist/components/button-group/MPButtonGroup.js +1 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/button-group/index.js +1 -0
- package/dist/components/card/MPCard.d.ts +73 -0
- package/dist/components/card/MPCard.js +1 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/carousel/MPCarousel.d.ts +116 -0
- package/dist/components/carousel/MPCarousel.js +1 -0
- package/dist/components/carousel/index.d.ts +2 -0
- package/dist/components/carousel/index.js +1 -0
- package/dist/components/chat-bubble/MPChatBubble.d.ts +132 -0
- package/dist/components/chat-bubble/MPChatBubble.js +1 -0
- package/dist/components/chat-bubble/index.d.ts +2 -0
- package/dist/components/chat-bubble/index.js +1 -0
- package/dist/components/checkbox/MPCheckbox.d.ts +76 -0
- package/dist/components/checkbox/MPCheckbox.js +1 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/chip/MPChip.d.ts +74 -0
- package/dist/components/chip/MPChip.js +1 -0
- package/dist/components/chip/index.d.ts +2 -0
- package/dist/components/chip/index.js +1 -0
- package/dist/components/collapsible/MPCollapsible.d.ts +97 -0
- package/dist/components/collapsible/MPCollapsible.js +1 -0
- package/dist/components/collapsible/index.d.ts +2 -0
- package/dist/components/collapsible/index.js +1 -0
- package/dist/components/color-picker/MPColorPicker.d.ts +131 -0
- package/dist/components/color-picker/MPColorPicker.js +1 -0
- package/dist/components/color-picker/index.d.ts +2 -0
- package/dist/components/color-picker/index.js +1 -0
- package/dist/components/combobox/MPCombobox.d.ts +175 -0
- package/dist/components/combobox/MPCombobox.js +1 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/combobox/index.js +1 -0
- package/dist/components/container/MPContainer.d.ts +75 -0
- package/dist/components/container/MPContainer.js +1 -0
- package/dist/components/container/index.d.ts +2 -0
- package/dist/components/container/index.js +1 -0
- package/dist/components/date-picker/MPDatePicker.d.ts +98 -0
- package/dist/components/date-picker/MPDatePicker.js +1 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/date-range-picker/MPDateRangePicker.d.ts +98 -0
- package/dist/components/date-range-picker/MPDateRangePicker.js +1 -0
- package/dist/components/date-range-picker/index.d.ts +2 -0
- package/dist/components/date-range-picker/index.js +1 -0
- package/dist/components/date-time-picker/MPDateTimePicker.d.ts +78 -0
- package/dist/components/date-time-picker/MPDateTimePicker.js +1 -0
- package/dist/components/date-time-picker/index.d.ts +2 -0
- package/dist/components/date-time-picker/index.js +1 -0
- package/dist/components/dialog/MPDialog.d.ts +150 -0
- package/dist/components/dialog/MPDialog.js +1 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/dialog/index.js +1 -0
- package/dist/components/divider/MPDivider.d.ts +80 -0
- package/dist/components/divider/MPDivider.js +1 -0
- package/dist/components/divider/index.d.ts +2 -0
- package/dist/components/divider/index.js +1 -0
- package/dist/components/drawer/MPDrawer.d.ts +168 -0
- package/dist/components/drawer/MPDrawer.js +1 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/empty/MPEmpty.d.ts +74 -0
- package/dist/components/empty/MPEmpty.js +1 -0
- package/dist/components/empty/index.d.ts +2 -0
- package/dist/components/empty/index.js +1 -0
- package/dist/components/file-picker/MPFilePicker.d.ts +113 -0
- package/dist/components/file-picker/MPFilePicker.js +1 -0
- package/dist/components/file-picker/index.d.ts +2 -0
- package/dist/components/file-picker/index.js +1 -0
- package/dist/components/floating-action-button/MPFloatingActionButton.d.ts +126 -0
- package/dist/components/floating-action-button/MPFloatingActionButton.js +1 -0
- package/dist/components/floating-action-button/index.d.ts +2 -0
- package/dist/components/floating-action-button/index.js +1 -0
- package/dist/components/grid/MPGrid.d.ts +155 -0
- package/dist/components/grid/MPGrid.js +1 -0
- package/dist/components/grid/index.d.ts +2 -0
- package/dist/components/grid/index.js +1 -0
- package/dist/components/highlight/MPHighlight.d.ts +95 -0
- package/dist/components/highlight/MPHighlight.js +1 -0
- package/dist/components/highlight/index.d.ts +2 -0
- package/dist/components/highlight/index.js +1 -0
- package/dist/components/icon-button/MPIconButton.d.ts +59 -0
- package/dist/components/icon-button/MPIconButton.js +1 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/icon-button/index.js +1 -0
- package/dist/components/list/MPList.d.ts +96 -0
- package/dist/components/list/MPList.js +1 -0
- package/dist/components/list/index.d.ts +2 -0
- package/dist/components/list/index.js +1 -0
- package/dist/components/locale/MPLocaleProvider.d.ts +63 -0
- package/dist/components/locale/MPLocaleProvider.js +1 -0
- package/dist/components/locale/index.d.ts +2 -0
- package/dist/components/locale/index.js +1 -0
- package/dist/components/menu/MPMenu.d.ts +232 -0
- package/dist/components/menu/MPMenu.js +1 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/index.js +1 -0
- package/dist/components/number-field/MPNumberField.d.ts +117 -0
- package/dist/components/number-field/MPNumberField.js +1 -0
- package/dist/components/number-field/index.d.ts +2 -0
- package/dist/components/number-field/index.js +1 -0
- package/dist/components/otp-field/MPOtpField.d.ts +89 -0
- package/dist/components/otp-field/MPOtpField.js +1 -0
- package/dist/components/otp-field/index.d.ts +2 -0
- package/dist/components/otp-field/index.js +1 -0
- package/dist/components/overlay/MPOverlay.d.ts +96 -0
- package/dist/components/overlay/MPOverlay.js +1 -0
- package/dist/components/overlay/index.d.ts +2 -0
- package/dist/components/overlay/index.js +1 -0
- package/dist/components/pagination/MPPagination.d.ts +106 -0
- package/dist/components/pagination/MPPagination.js +1 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/index.js +1 -0
- package/dist/components/panes/MPPanes.d.ts +100 -0
- package/dist/components/panes/MPPanes.js +1 -0
- package/dist/components/panes/index.d.ts +2 -0
- package/dist/components/panes/index.js +1 -0
- package/dist/components/pill/MPPill.d.ts +117 -0
- package/dist/components/pill/MPPill.js +1 -0
- package/dist/components/pill/index.d.ts +2 -0
- package/dist/components/pill/index.js +1 -0
- package/dist/components/popover/MPPopover.d.ts +143 -0
- package/dist/components/popover/MPPopover.js +1 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/index.js +1 -0
- package/dist/components/progress-box/MPProgressBox.d.ts +40 -0
- package/dist/components/progress-box/MPProgressBox.js +1 -0
- package/dist/components/progress-box/index.d.ts +2 -0
- package/dist/components/progress-box/index.js +1 -0
- package/dist/components/progress-circular/MPProgressCircular.d.ts +32 -0
- package/dist/components/progress-circular/MPProgressCircular.js +1 -0
- package/dist/components/progress-circular/index.d.ts +2 -0
- package/dist/components/progress-circular/index.js +1 -0
- package/dist/components/progress-linear/MPProgressLinear.d.ts +32 -0
- package/dist/components/progress-linear/MPProgressLinear.js +1 -0
- package/dist/components/progress-linear/index.d.ts +2 -0
- package/dist/components/progress-linear/index.js +1 -0
- package/dist/components/radio-group/MPRadioGroup.d.ts +81 -0
- package/dist/components/radio-group/MPRadioGroup.js +1 -0
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/index.js +1 -0
- package/dist/components/rating/MPRating.d.ts +135 -0
- package/dist/components/rating/MPRating.js +1 -0
- package/dist/components/rating/index.d.ts +2 -0
- package/dist/components/rating/index.js +1 -0
- package/dist/components/segmented-button/MPSegmentedButton.d.ts +75 -0
- package/dist/components/segmented-button/MPSegmentedButton.js +1 -0
- package/dist/components/segmented-button/index.d.ts +2 -0
- package/dist/components/segmented-button/index.js +1 -0
- package/dist/components/select/MPSelect.d.ts +103 -0
- package/dist/components/select/MPSelect.js +1 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/shortcut/MPShortcut.d.ts +67 -0
- package/dist/components/shortcut/MPShortcut.js +1 -0
- package/dist/components/shortcut/index.d.ts +2 -0
- package/dist/components/shortcut/index.js +1 -0
- package/dist/components/skeleton/MPSkeleton.d.ts +76 -0
- package/dist/components/skeleton/MPSkeleton.js +1 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/slider/MPSlider.d.ts +77 -0
- package/dist/components/slider/MPSlider.js +1 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/snackbar/MPSnackbar.d.ts +175 -0
- package/dist/components/snackbar/MPSnackbar.js +1 -0
- package/dist/components/snackbar/index.d.ts +2 -0
- package/dist/components/snackbar/index.js +1 -0
- package/dist/components/spoiler/MPSpoiler.d.ts +106 -0
- package/dist/components/spoiler/MPSpoiler.js +1 -0
- package/dist/components/spoiler/index.d.ts +2 -0
- package/dist/components/spoiler/index.js +1 -0
- package/dist/components/switch/MPSwitch.d.ts +75 -0
- package/dist/components/switch/MPSwitch.js +1 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/table/MPTable.d.ts +120 -0
- package/dist/components/table/MPTable.js +1 -0
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/tabs/MPTabs.d.ts +145 -0
- package/dist/components/tabs/MPTabs.js +1 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/text-field/MPTextField.d.ts +51 -22
- package/dist/components/text-field/MPTextField.js +1 -1
- package/dist/components/text-link/MPTextLink.d.ts +88 -0
- package/dist/components/text-link/MPTextLink.js +1 -0
- package/dist/components/text-link/index.d.ts +2 -0
- package/dist/components/text-link/index.js +1 -0
- package/dist/components/time-picker/MPTimePicker.d.ts +108 -0
- package/dist/components/time-picker/MPTimePicker.js +1 -0
- package/dist/components/time-picker/index.d.ts +2 -0
- package/dist/components/time-picker/index.js +1 -0
- package/dist/components/timeline/MPTimeline.d.ts +96 -0
- package/dist/components/timeline/MPTimeline.js +1 -0
- package/dist/components/timeline/index.d.ts +2 -0
- package/dist/components/timeline/index.js +1 -0
- package/dist/components/tooltip/MPTooltip.d.ts +117 -0
- package/dist/components/tooltip/MPTooltip.js +1 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/typography/MPTypography.d.ts +94 -0
- package/dist/components/typography/MPTypography.js +1 -0
- package/dist/components/typography/index.d.ts +2 -0
- package/dist/components/typography/index.js +1 -0
- package/dist/constants/icons.d.ts +49 -0
- package/dist/constants/icons.js +1 -1
- package/dist/index.d.ts +73 -0
- package/dist/index.js +1 -1
- package/dist/internal/Calendar.d.ts +118 -0
- package/dist/internal/Calendar.js +1 -0
- package/dist/internal/FieldOutline.d.ts +109 -0
- package/dist/internal/FieldOutline.js +1 -0
- package/dist/internal/Picker.d.ts +153 -0
- package/dist/internal/Picker.js +1 -0
- package/dist/internal/StateLayer.d.ts +45 -0
- package/dist/internal/StateLayer.js +1 -0
- package/dist/internal/SupportingText.d.ts +23 -0
- package/dist/internal/SupportingText.js +1 -0
- package/dist/internal/WidthSizer.d.ts +31 -0
- package/dist/internal/WidthSizer.js +1 -0
- package/dist/internal/accent.d.ts +39 -0
- package/dist/internal/accent.js +1 -0
- package/dist/internal/animate.d.ts +179 -0
- package/dist/internal/animate.js +1 -0
- package/dist/internal/button-group.d.ts +21 -0
- package/dist/internal/button-group.js +1 -0
- package/dist/internal/color.d.ts +125 -0
- package/dist/internal/color.js +1 -0
- package/dist/internal/date.d.ts +179 -0
- package/dist/internal/date.js +1 -0
- package/dist/internal/i18n.d.ts +241 -0
- package/dist/internal/i18n.js +1 -0
- package/dist/internal/inert.d.ts +11 -0
- package/dist/internal/inert.js +1 -0
- package/dist/internal/locale.d.ts +43 -0
- package/dist/internal/locale.js +1 -0
- package/dist/internal/menu.d.ts +23 -0
- package/dist/internal/menu.js +1 -0
- package/dist/internal/progress.d.ts +126 -0
- package/dist/internal/progress.js +1 -0
- package/dist/internal/scale.d.ts +127 -0
- package/dist/internal/scale.js +1 -0
- package/dist/internal/surface.d.ts +76 -0
- package/dist/internal/surface.js +1 -0
- package/dist/internal/visually-hidden.d.ts +23 -0
- package/dist/internal/visually-hidden.js +1 -0
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1871 -20
- package/dist/types.d.ts +262 -16
- package/package.json +16 -21
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { MPColor, MPSize } from '../../types';
|
|
3
|
+
/** Which side of the track the label sits on. */
|
|
4
|
+
export type MPSwitchLabelPlacement = 'start' | 'end';
|
|
5
|
+
export interface MPSwitchProps {
|
|
6
|
+
/** Whether the switch is on. Use with `onCheckedChange` for a controlled one. */
|
|
7
|
+
checked?: boolean;
|
|
8
|
+
/** Whether it starts on, for an uncontrolled one. */
|
|
9
|
+
defaultChecked?: boolean;
|
|
10
|
+
/** Called with the new state — a boolean, not an event. */
|
|
11
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
12
|
+
/** The text beside the track, wired to it by Base UI's Field. */
|
|
13
|
+
label?: React.ReactNode;
|
|
14
|
+
/** The line under the label. Replaced by `errorMessage` when there is one. */
|
|
15
|
+
description?: React.ReactNode;
|
|
16
|
+
/** The message under the label, which also turns the switch over. */
|
|
17
|
+
errorMessage?: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Draws a tick in the thumb when it is on and a cross when it is off.
|
|
20
|
+
*
|
|
21
|
+
* Off by default, and worth turning on wherever the two states are not
|
|
22
|
+
* obviously different in context: the thumb's position and the track's colour
|
|
23
|
+
* are otherwise the only signals, and one of those is a hue.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
icons?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Which side the label sits on. `end` reads as a caption for the control;
|
|
29
|
+
* `start` is for a settings list, where the labels form a column and every
|
|
30
|
+
* switch lines up on the right.
|
|
31
|
+
* @default 'end'
|
|
32
|
+
*/
|
|
33
|
+
labelPlacement?: MPSwitchLabelPlacement;
|
|
34
|
+
/**
|
|
35
|
+
* The track's size and the label's type scale.
|
|
36
|
+
* @default 'md'
|
|
37
|
+
*/
|
|
38
|
+
size?: MPSize;
|
|
39
|
+
/**
|
|
40
|
+
* Which accent family the track takes when it is on.
|
|
41
|
+
* @default 'primary'
|
|
42
|
+
*/
|
|
43
|
+
color?: MPColor;
|
|
44
|
+
/** Marks the switch required. */
|
|
45
|
+
required?: boolean;
|
|
46
|
+
/** Greys the switch out and stops it taking input. */
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
/** Shows the state without allowing it to be changed. */
|
|
49
|
+
readOnly?: boolean;
|
|
50
|
+
/** Name of the form control. */
|
|
51
|
+
name?: string;
|
|
52
|
+
/**
|
|
53
|
+
* The id put on the control and pointed at by the label. Generated when it is
|
|
54
|
+
* left out.
|
|
55
|
+
*/
|
|
56
|
+
id?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Stretches the row, so a `start` label takes the slack and the track sits
|
|
59
|
+
* against the far edge. This is what makes a column of settings line up.
|
|
60
|
+
*/
|
|
61
|
+
fullWidth?: boolean;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A Material Design switch.
|
|
65
|
+
*
|
|
66
|
+
* The difference from a checkbox is not visual, it is temporal: a checkbox is a
|
|
67
|
+
* value that gets submitted with a form, a switch takes effect the moment it
|
|
68
|
+
* moves. If there is a Save button underneath, it should have been a checkbox.
|
|
69
|
+
*
|
|
70
|
+
* The thumb is the one thing in this library that actually travels, so this is
|
|
71
|
+
* also the only place the spec's `standard` easing is read — quick to leave, slow
|
|
72
|
+
* to arrive, which is what makes a 200ms move read as something being pushed
|
|
73
|
+
* rather than as something being teleported and then apologised for.
|
|
74
|
+
*/
|
|
75
|
+
export declare const MPSwitch: React.ForwardRefExoticComponent<MPSwitchProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Switch as n}from"@base-ui/react/switch";import{Field as i}from"@base-ui/react/field";import{MPIcon as c}from"../icon/MPIcon";import{CheckIcon as s,CloseIcon as o}from"../../constants/icons";import{accentSlots as l}from"../../internal/accent";import{MPStateLayer as d}from"../../internal/StateLayer";import{MPSupportingText as h}from"../../internal/SupportingText";import{PROSE_TEXT as m,hasContent as p}from"../../internal/scale";const u={xs:{track:"h-5 w-8",thumb:"left-[5px] size-2.5 data-checked:left-[15px] data-checked:size-3.5",halo:"size-8",glyph:8},sm:{track:"h-6 w-10",thumb:"left-1.5 size-3 data-checked:left-[19px] data-checked:size-[18px]",halo:"size-9",glyph:10},md:{track:"h-8 w-13",thumb:"left-2 size-4 data-checked:left-6 data-checked:size-6",halo:"size-10",glyph:14},lg:{track:"h-9 w-15",thumb:"left-[9px] size-[18px] data-checked:left-7 data-checked:size-7",halo:"size-11",glyph:16},xl:{track:"h-10 w-17",thumb:"left-2.5 size-5 data-checked:left-[33px] data-checked:size-[30px]",halo:"size-12",glyph:18}};export const MPSwitch=r.forwardRef(function({checked:f,defaultChecked:g,onCheckedChange:k,label:x,description:b,errorMessage:z,icons:y=!1,labelPlacement:w="end",size:j="md",color:N="primary",required:_=!1,disabled:C=!1,readOnly:M=!1,name:v,id:P,fullWidth:R=!1},S){const W=p(z),q=W?"error":N,F=u[j],I=r.useId(),L=P??I,O=e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e(n.Root,{ref:S,id:L,name:v,checked:f,defaultChecked:g,required:_,disabled:C,readOnly:M,onCheckedChange:e=>k?.(e),className:["mp-switch__track group relative box-border inline-flex shrink-0 p-0","rounded-mp-full appearance-none font-[inherit] outline-none","transition-[background-color,box-shadow]","duration-(--mp-sys-motion-duration-short4) ease-mp-standard",F.track,C?["bg-mp-surface-container-highest inset-ring-2 inset-ring-mp-on-surface/12","cursor-default","data-checked:bg-mp-on-surface/12 data-checked:inset-ring-0"].join(" "):[M?"cursor-default":"cursor-pointer","bg-mp-surface-container-highest inset-ring-2",W?"inset-ring-mp-error":"inset-ring-mp-outline","data-checked:inset-ring-0 data-checked:bg-(--_mp-accent)"].join(" ")].join(" "),children:a(n.Thumb,{className:["mp-switch__thumb absolute top-1/2 flex -translate-y-1/2 items-center justify-center","rounded-full","transition-[left,width,height,background-color]","duration-(--mp-sys-motion-duration-short4) ease-mp-standard",F.thumb,C?"bg-mp-on-surface/38 data-checked:bg-mp-surface-container-highest":[W?"bg-mp-error":"bg-mp-outline","data-checked:bg-(--_mp-on-accent)"].join(" ")].join(" "),children:[C?null:e(d,{layer:["top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",F.halo,"bg-mp-on-surface group-data-checked:bg-(--_mp-accent)"].join(" ")}),y?a(t,{children:[e("span",{className:["hidden items-center group-data-checked:flex",C?"text-mp-surface-container-highest":"text-(--_mp-accent)"].join(" "),children:e(c,{icon:s,size:F.glyph,strokeWidth:3})}),e("span",{className:"text-mp-surface-container-highest flex items-center group-data-checked:hidden",children:e(c,{icon:o,size:F.glyph,strokeWidth:3})})]}):null]})})}),T=p(x)||p(b)||W?a("span",{className:["flex min-w-0 flex-col gap-0.5","start"===w?"flex-1":""].filter(Boolean).join(" "),children:[p(x)?a(i.Label,{htmlFor:L,className:["leading-[1.4]",C?"text-mp-on-surface/38 cursor-default":M?"text-mp-on-surface":"text-mp-on-surface cursor-pointer"].join(" "),children:[x,_?e("span",{"aria-hidden":"true",children:" *"}):null]}):null,e(h,{description:b,errorMessage:z})]}):null;return e(i.Root,{className:["mp-switch align-top",R?"flex w-full":"inline-flex"].join(" "),disabled:C,invalid:W,"data-mp-size":j,style:l(q),children:e("div",{className:["flex w-full items-start gap-3",m[j]].join(" "),children:a(t,"start"===w?{children:[T,O]}:{children:[O,T]})})})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{MPSwitch}from"./MPSwitch";
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { MPAlign, MPColor, MPSize, MPVariant } from '../../types';
|
|
3
|
+
/** Which edge the text in a column lines up against. */
|
|
4
|
+
export type MPTableAlign = MPAlign;
|
|
5
|
+
/**
|
|
6
|
+
* A column: its heading, its default width, and how to get a cell out of a row.
|
|
7
|
+
*
|
|
8
|
+
* This is the whole reason the component takes data rather than markup. A `<td>`
|
|
9
|
+
* written out per row can silently disagree with the `<th>` above it about how
|
|
10
|
+
* many there are or what order they come in; a column list cannot.
|
|
11
|
+
*/
|
|
12
|
+
export interface MPTableColumn<Row> {
|
|
13
|
+
/**
|
|
14
|
+
* Identifies the column, and — unless `render` says otherwise — names the
|
|
15
|
+
* property to read off each row.
|
|
16
|
+
*/
|
|
17
|
+
key: string;
|
|
18
|
+
/** The heading. Defaults to the `key`, which is usually not what you want. */
|
|
19
|
+
label?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* The column's default width. A number is pixels; a string is any CSS length.
|
|
22
|
+
*
|
|
23
|
+
* "Default" is meant: the table still balances the columns to fill its width,
|
|
24
|
+
* so this is a starting proportion rather than a guarantee.
|
|
25
|
+
*/
|
|
26
|
+
width?: number | string;
|
|
27
|
+
/**
|
|
28
|
+
* Text alignment. Numbers usually want `end` so their digits line up in a
|
|
29
|
+
* column; everything else wants `start`.
|
|
30
|
+
* @default 'start'
|
|
31
|
+
*/
|
|
32
|
+
align?: MPTableAlign;
|
|
33
|
+
/**
|
|
34
|
+
* Renders the cell. Without it the cell is `row[key]` rendered as-is, which
|
|
35
|
+
* covers strings and numbers and nothing else.
|
|
36
|
+
*/
|
|
37
|
+
render?: (row: Row, index: number) => React.ReactNode;
|
|
38
|
+
}
|
|
39
|
+
export interface MPTableProps<Row> extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'children'> {
|
|
40
|
+
/** The columns, in the order they appear. */
|
|
41
|
+
headers: readonly MPTableColumn<Row>[];
|
|
42
|
+
/** The rows. */
|
|
43
|
+
items: readonly Row[];
|
|
44
|
+
/**
|
|
45
|
+
* A stable key per row. Defaults to the row's index, which is fine for a
|
|
46
|
+
* static table and wrong for one that sorts or filters.
|
|
47
|
+
*/
|
|
48
|
+
getRowKey?: (row: Row, index: number) => React.Key;
|
|
49
|
+
/** Shown above the table, and read out as its accessible name. */
|
|
50
|
+
caption?: React.ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* What to show instead of rows when `items` is empty.
|
|
53
|
+
* @default 'No data'
|
|
54
|
+
*/
|
|
55
|
+
empty?: React.ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* Tints every other row. Useful for a wide table where the eye has to track
|
|
58
|
+
* across; noise on a narrow one.
|
|
59
|
+
* @default false
|
|
60
|
+
*/
|
|
61
|
+
striped?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Lights the row under the pointer.
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
hoverable?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Pins the header while the body scrolls. Only does anything if something
|
|
69
|
+
* around the table actually constrains its height.
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
72
|
+
stickyHeader?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Makes rows activatable. Also turns on the hover treatment.
|
|
75
|
+
*
|
|
76
|
+
* A row that answers a press has to answer a keyboard too, so each one joins
|
|
77
|
+
* the tab order and takes Enter and Space. That is the honest minimum for a
|
|
78
|
+
* `<tr>` — a row cannot be wrapped in a `<button>` the way an
|
|
79
|
+
* [MPListItem](../layout/list) is, because a `<button>` is not something a
|
|
80
|
+
* `<tbody>` may contain.
|
|
81
|
+
*
|
|
82
|
+
* It is also worth knowing what it costs: a table of two hundred rows becomes
|
|
83
|
+
* two hundred tab stops. When the row's job is to *navigate*, put a link in
|
|
84
|
+
* the first cell instead — one tab stop per row that is already announced as
|
|
85
|
+
* a link and can be opened in a new tab.
|
|
86
|
+
*/
|
|
87
|
+
onRowClick?: (row: Row, index: number) => void;
|
|
88
|
+
/**
|
|
89
|
+
* How much surface the sheet around the table paints.
|
|
90
|
+
* @default 'outlined'
|
|
91
|
+
*/
|
|
92
|
+
variant?: MPVariant;
|
|
93
|
+
/**
|
|
94
|
+
* @default 'md'
|
|
95
|
+
*/
|
|
96
|
+
size?: MPSize;
|
|
97
|
+
/**
|
|
98
|
+
* Which accent family a hovered or pressed row reads. The cells themselves
|
|
99
|
+
* stay neutral.
|
|
100
|
+
* @default 'primary'
|
|
101
|
+
*/
|
|
102
|
+
color?: MPColor;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* A grid of data.
|
|
106
|
+
*
|
|
107
|
+
* The sheet takes the same `variant`, `size` and `color` as everything it might
|
|
108
|
+
* sit next to. What the table adds is the part that is genuinely tabular: the
|
|
109
|
+
* columns, the rows, and the fact that the two cannot drift apart.
|
|
110
|
+
*
|
|
111
|
+
* ## Why it is not `React.forwardRef`
|
|
112
|
+
*
|
|
113
|
+
* It is generic in `Row`, and a `forwardRef` component's type erases that: the
|
|
114
|
+
* wrapper is typed as one component rather than as a function with a type
|
|
115
|
+
* parameter, so `headers` and `items` would stop checking against each other and
|
|
116
|
+
* `column.render` would hand back `unknown`. Losing that check would cost more
|
|
117
|
+
* than a ref on the scroll container is worth — and a caller who needs one can
|
|
118
|
+
* put it on a `<div>` of their own around this.
|
|
119
|
+
*/
|
|
120
|
+
export declare function MPTable<Row>({ headers, items, getRowKey, caption, empty, striped, hoverable, stickyHeader, onRowClick, variant, size, color, className, style, ...props }: MPTableProps<Row>): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{accentSlots as r}from"../../internal/accent";import{META_TEXT as o}from"../../internal/scale";import{CONTAINER_SURFACE as l}from"../../internal/surface";const a={xs:"0.625rem",sm:"0.75rem",md:"1rem",lg:"1.25rem",xl:"1.5rem"},n={xs:"0.375rem",sm:"0.625rem",md:"1rem",lg:"1.25rem",xl:"1.5rem"},i={xs:"text-mp-body-small",sm:"text-mp-body-small",md:"text-mp-body-medium",lg:"text-mp-body-medium",xl:"text-mp-body-large"},m={xs:"text-mp-label-medium",sm:"text-mp-label-medium",md:"text-mp-title-small",lg:"text-mp-title-small",xl:"text-mp-title-medium"},s=["[--_mp-row:transparent]","transition-[background-color] duration-(--mp-sys-motion-duration-short4)"].join(" ");export function MPTable({headers:c,items:d,getRowKey:p,caption:u,empty:x="No data",striped:y=!1,hoverable:f=!1,stickyHeader:v=!1,onRowClick:h,variant:b="outlined",size:g="md",color:w="primary",className:k,style:N,...j}){const _=a[g],$=n[g],C=Boolean(h),A=f||C,B={padding:`${$} ${_}`},z={...B,backgroundColor:"var(--_mp-color-surface-container)"},T={borderTop:"1px solid var(--_mp-color-outline-variant)",backgroundColor:"var(--_mp-row)"};return e("div",{"data-mp-size":g,"data-mp-variant":b,className:["mp-table rounded-mp-md overflow-x-auto",l[b],k??""].filter(Boolean).join(" "),style:{...r(w),...N},...j,children:t("table",{className:`text-mp-on-surface w-full text-start ${i[g]}`,style:{borderCollapse:"collapse"},children:[u?e("caption",{className:`text-mp-on-surface-variant ${o}`,style:{...B,textAlign:"start"},children:u}):null,e("colgroup",{children:c.map(t=>{return e("col",{style:void 0===t.width?void 0:{width:(r=t.width,"number"==typeof r?`${r}px`:r)}},t.key);var r})}),e("thead",{children:e("tr",{children:c.map(t=>e("th",{scope:"col",className:["text-mp-on-surface-variant whitespace-nowrap",m[g],v?"sticky top-0 z-10":""].filter(Boolean).join(" "),style:{...z,textAlign:t.align??"start"},children:t.label??t.key},t.key))})}),e("tbody",{children:0===d.length?e("tr",{className:s,style:T,children:e("td",{colSpan:c.length,className:"text-mp-on-surface-variant",style:{padding:`2rem ${_}`,textAlign:"center"},children:x})}):d.map((t,r)=>e("tr",{className:[s,y&&r%2==1?"[--_mp-row:var(--_mp-color-surface-container-low)]":"",A?"hover:[--_mp-row:var(--_mp-color-surface-container)]":"",C?["cursor-pointer","outline-mp-secondary focus-visible:outline-2","focus-visible:-outline-offset-2 focus-visible:outline-solid outline-none"].join(" "):""].filter(Boolean).join(" "),style:T,tabIndex:C?0:void 0,onClick:h?()=>h(t,r):void 0,onKeyDown:h?e=>{"Enter"!==e.key&&" "!==e.key||e.target===e.currentTarget&&(e.preventDefault(),h(t,r))}:void 0,children:c.map(o=>e("td",{style:{...B,textAlign:o.align??"start"},children:o.render?o.render(t,r):t[o.key]},o.key))},p?p(t,r):r))})]})})}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{MPTable}from"./MPTable";
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { MPColor, MPStyleProps } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* MD3's two kinds of tab.
|
|
5
|
+
*
|
|
6
|
+
* They are not two levels of emphasis, they are two *depths*: primary tabs are
|
|
7
|
+
* the top level of a screen, and secondary tabs divide the content inside one of
|
|
8
|
+
* them. The specification draws that difference three ways — the indicator is
|
|
9
|
+
* 3dp and rounded against 2dp and square, it hugs the label rather than filling
|
|
10
|
+
* the tab, and the chosen label takes the accent rather than the plain ink — and
|
|
11
|
+
* all three are here.
|
|
12
|
+
*
|
|
13
|
+
* There is deliberately no third value. A `variant` ladder like the buttons' one
|
|
14
|
+
* would be an emphasis axis, and a tab bar has nothing to be emphatic about: it
|
|
15
|
+
* is the map of a screen, not an action on it.
|
|
16
|
+
*/
|
|
17
|
+
export type MPTabsVariant = 'primary' | 'secondary';
|
|
18
|
+
/** Where the glyph sits relative to the label. */
|
|
19
|
+
export type MPTabIconPosition = 'top' | 'start';
|
|
20
|
+
/**
|
|
21
|
+
* A tab's value. The same restraint `MPSelect` puts on its own — an identifier,
|
|
22
|
+
* not an arbitrary object, because it is also what picks out the panel.
|
|
23
|
+
*/
|
|
24
|
+
export type MPTabValue = string | number;
|
|
25
|
+
export interface MPTabsProps extends MPStyleProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'defaultValue' | 'onChange'> {
|
|
26
|
+
/**
|
|
27
|
+
* Which of MD3's two kinds of tab bar this is: `primary` for the top level of
|
|
28
|
+
* a screen, `secondary` for a division inside one of its panels.
|
|
29
|
+
* @default 'primary'
|
|
30
|
+
*/
|
|
31
|
+
variant?: MPTabsVariant;
|
|
32
|
+
/**
|
|
33
|
+
* Which accent family the chosen tab and the indicator read.
|
|
34
|
+
* @default 'primary'
|
|
35
|
+
*/
|
|
36
|
+
color?: MPColor;
|
|
37
|
+
/** The chosen tab. Use with `onValueChange` for a controlled set. */
|
|
38
|
+
value?: MPTabValue | null;
|
|
39
|
+
/** Which starts chosen, for an uncontrolled set. */
|
|
40
|
+
defaultValue?: MPTabValue | null;
|
|
41
|
+
/** Called with the chosen tab's value. */
|
|
42
|
+
onValueChange?: (value: MPTabValue | null) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Where a tab's glyph sits. Defaults to what the variant does in the
|
|
45
|
+
* specification: above the label on a primary tab, before it on a secondary
|
|
46
|
+
* one.
|
|
47
|
+
*/
|
|
48
|
+
iconPosition?: MPTabIconPosition;
|
|
49
|
+
/**
|
|
50
|
+
* Whether moving the arrow keys also chooses the tab they land on.
|
|
51
|
+
*
|
|
52
|
+
* `false` by default. Automatic activation is only kind when every panel is
|
|
53
|
+
* already on the page; the moment one of them fetches, walking past four tabs
|
|
54
|
+
* fires four requests.
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
activateOnFocus?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the arrow keys wrap from the last tab back to the first.
|
|
60
|
+
* @default true
|
|
61
|
+
*/
|
|
62
|
+
loopFocus?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* The hairline under the bar, which is MD3's own divider between a tab bar and
|
|
65
|
+
* the content it is about. Turn it off inside a card that already has an edge.
|
|
66
|
+
* @default true
|
|
67
|
+
*/
|
|
68
|
+
divider?: boolean;
|
|
69
|
+
/** The tabs share the bar's full width, each taking an equal part of it. */
|
|
70
|
+
fullWidth?: boolean;
|
|
71
|
+
/** The accessible name of the bar. */
|
|
72
|
+
'aria-label'?: string;
|
|
73
|
+
/** The `MPTab`s and the `MPTabPanel`s. */
|
|
74
|
+
children?: React.ReactNode;
|
|
75
|
+
}
|
|
76
|
+
export interface MPTabProps extends Omit<React.ComponentPropsWithoutRef<'button'>, 'value' | 'color'> {
|
|
77
|
+
/** Identifies the tab, and picks out the panel with the same value. */
|
|
78
|
+
value: MPTabValue;
|
|
79
|
+
/**
|
|
80
|
+
* The glyph. Drawn above or before the label depending on the bar's
|
|
81
|
+
* `iconPosition`, and sized by the bar's rung.
|
|
82
|
+
*/
|
|
83
|
+
icon?: React.ReactNode;
|
|
84
|
+
/** Unavailable, but still listed. */
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
/** The tab's label. */
|
|
87
|
+
children?: React.ReactNode;
|
|
88
|
+
}
|
|
89
|
+
export interface MPTabPanelProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
90
|
+
/** Which tab shows this panel. */
|
|
91
|
+
value: MPTabValue;
|
|
92
|
+
/**
|
|
93
|
+
* Keeps the panel in the DOM while it is hidden — for a panel that is
|
|
94
|
+
* expensive to build, or that holds form state which should survive being
|
|
95
|
+
* switched away from.
|
|
96
|
+
* @default false
|
|
97
|
+
*/
|
|
98
|
+
keepMounted?: boolean;
|
|
99
|
+
children?: React.ReactNode;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* One set of panels, one of which is shown.
|
|
103
|
+
*
|
|
104
|
+
* Base UI owns everything that makes a tab bar a tab bar rather than a row of
|
|
105
|
+
* buttons: roving focus so the whole bar is one tab stop, the arrow keys, Home
|
|
106
|
+
* and End, the `tab`/`tabpanel` roles and the `aria-controls` wiring between
|
|
107
|
+
* them, and the measurement that puts the indicator under the chosen tab. What
|
|
108
|
+
* is here is the Material surface and the ladders.
|
|
109
|
+
*
|
|
110
|
+
* The tabs and the panels are composed rather than passed as data, unlike
|
|
111
|
+
* [MPSelect](../inputs/select) — a panel is a subtree, and there is no useful
|
|
112
|
+
* shape for "an array of arbitrary React trees" that is not just children. They
|
|
113
|
+
* are sorted into the bar and the body here rather than made the caller's
|
|
114
|
+
* problem with a wrapper element they have to remember.
|
|
115
|
+
*
|
|
116
|
+
* ## Horizontal only
|
|
117
|
+
*
|
|
118
|
+
* There is no `orientation`, and the omission is the specification's. MD3 has no
|
|
119
|
+
* vertical tabs: a column of destinations down the side of a screen is a
|
|
120
|
+
* **navigation rail**, which is a different component with different behaviour —
|
|
121
|
+
* it switches what the *screen* is rather than which panel of one is showing,
|
|
122
|
+
* and it is not one tab stop with arrow keys inside it. A tab bar turned on its
|
|
123
|
+
* side would claim the tab contract while looking like the other thing.
|
|
124
|
+
*
|
|
125
|
+
* A bar with more tabs than room scrolls rather than wrapping, which is MD3's
|
|
126
|
+
* scrollable tabs: a tab bar on two lines has stopped being a bar, and the
|
|
127
|
+
* indicator has nowhere sensible to sit.
|
|
128
|
+
*/
|
|
129
|
+
export declare const MPTabs: React.ForwardRefExoticComponent<MPTabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
130
|
+
/**
|
|
131
|
+
* One tab.
|
|
132
|
+
*
|
|
133
|
+
* It has no `size`, no `color` and no `variant` of its own: all three belong to
|
|
134
|
+
* the bar, which is the only place they can be set once and mean the same thing
|
|
135
|
+
* for every tab. A bar whose third tab is a rung out is not a bar.
|
|
136
|
+
*/
|
|
137
|
+
export declare const MPTab: React.ForwardRefExoticComponent<MPTabProps & React.RefAttributes<HTMLButtonElement>>;
|
|
138
|
+
/**
|
|
139
|
+
* The content behind one tab.
|
|
140
|
+
*
|
|
141
|
+
* Unmounted while it is hidden unless `keepMounted` says otherwise, which is the
|
|
142
|
+
* right default for the common case — four panels of which one is on screen —
|
|
143
|
+
* and the wrong one for a panel holding a half-filled form.
|
|
144
|
+
*/
|
|
145
|
+
export declare const MPTabPanel: React.ForwardRefExoticComponent<MPTabPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{Tabs as i}from"@base-ui/react/tabs";import{accentSlots as n}from"../../internal/accent";import{MPStateLayer as o}from"../../internal/StateLayer";import{CONTROL_GAP as l,hasContent as r,SHEET_GAP as s}from"../../internal/scale";const c=a.createContext({variant:"primary",size:"md",iconPosition:"top",fullWidth:!1}),m={xs:"h-8",sm:"h-10",md:"h-12",lg:"h-14",xl:"h-16"},u={xs:"h-11",sm:"h-13",md:"h-16",lg:"h-18",xl:"h-20"},p={xs:"text-mp-label-medium",sm:"text-mp-label-large",md:"text-mp-title-small",lg:"text-mp-title-small",xl:"text-mp-title-medium"},d={xs:"px-3",sm:"px-3.5",md:"px-4",lg:"px-5",xl:"px-6"},f={xs:12,sm:14,md:16,lg:20,xl:24},h={xs:18,sm:20,md:24,lg:24,xl:28};function x(e,t,i,n=""){a.Children.toArray(e).forEach(e=>{if(!a.isValidElement(e))return void(r(e)&&t.push(e));if(e.type===a.Fragment)return void x(e.props.children,t,i,`${n}${String(e.key)}/`);const o=n?a.cloneElement(e,{key:`${n}${String(e.key)}`}):e;e.type===MPTabPanel?i.push(o):t.push(o)})}export const MPTabs=a.forwardRef(function({variant:o="primary",color:l="primary",size:r="md",value:m,defaultValue:u,onValueChange:p,iconPosition:d,activateOnFocus:h=!1,loopFocus:v=!0,divider:b=!0,fullWidth:y=!1,className:_,style:w,children:g,"aria-label":j,...P},N){const k=d??("primary"===o?"top":"start"),M=a.useMemo(()=>({variant:o,size:r,iconPosition:k,fullWidth:y}),[o,r,k,y]),$=[],z=[];return x(g,$,z),e(c.Provider,{value:M,children:t(i.Root,{ref:N,value:m,defaultValue:u,onValueChange:e=>p?.(e),"data-mp-size":r,"data-mp-variant":o,className:["mp-tabs flex min-w-0 flex-col",s[r],_??""].filter(Boolean).join(" "),style:{...n(l),"--_mp-tab-inset":`${f[r]}px`,...w},...P,children:[t(i.List,{"aria-label":j,activateOnFocus:h,loopFocus:v,className:["mp-tabs__list relative flex shrink-0",b?"border-mp-outline-variant border-b":"",y?"w-full":"","overflow-x-auto overflow-y-hidden"].filter(Boolean).join(" "),children:[$,e(i.Indicator,{className:["mp-tabs__indicator pointer-events-none absolute bottom-0","bg-(--_mp-accent)","primary"===o?["h-0.75 rounded-t-full","left-[calc(var(--active-tab-left)_+_var(--_mp-tab-inset))]","w-[calc(var(--active-tab-width)_-_2_*_var(--_mp-tab-inset))]"].join(" "):"left-(--active-tab-left) h-0.5 w-(--active-tab-width)","[transition-property:left,width]","duration-(--mp-sys-motion-duration-short4) ease-mp-standard"].join(" ")})]}),z]})})});export const MPTab=a.forwardRef(function({value:n,icon:s,disabled:f=!1,className:x,children:v,...b},y){const{variant:_,size:w,iconPosition:g,fullWidth:j}=a.useContext(c),P="top"===g&&r(s);return t(i.Tab,{ref:y,value:n,disabled:f,className:["mp-tabs__tab group relative flex shrink-0 items-center justify-center","box-border appearance-none bg-transparent font-[inherit] whitespace-nowrap select-none","overflow-hidden outline-none","transition-[color] duration-(--mp-sys-motion-duration-short4) ease-mp-standard",P?`flex-col gap-1 ${u[w]}`:`flex-row ${m[w]}`,P?"":l[w],p[w],d[w],f?"text-mp-on-surface/38 cursor-default":["text-mp-on-surface-variant cursor-pointer","primary"===_?"data-active:text-(--_mp-accent)":"data-active:text-mp-on-surface"].join(" "),"outline-mp-secondary focus-visible:outline-2 focus-visible:-outline-offset-2","focus-visible:outline-solid",j?"flex-1":"",x??""].filter(Boolean).join(" "),...b,children:[f?null:e(o,{}),r(s)?e("span",{className:"relative flex shrink-0 items-center justify-center",style:{width:h[w],height:h[w]},children:s}):null,r(v)?e("span",{className:"relative truncate",children:v}):null]})});export const MPTabPanel=a.forwardRef(function({value:t,keepMounted:a=!1,className:n,children:o,...l},r){return e(i.Panel,{ref:r,value:t,keepMounted:a,className:["mp-tabs__panel text-mp-on-surface min-w-0 flex-1","rounded-mp-xs outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none",n??""].filter(Boolean).join(" "),...l,children:o})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{MPTab,MPTabPanel,MPTabs}from"./MPTabs";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { MPMessages } from '../../internal/i18n';
|
|
3
|
+
import type { MPStyleProps } from '../../types';
|
|
2
4
|
/** The input modes this field is built for. */
|
|
3
5
|
export type MPTextFieldType = 'email' | 'password' | 'text';
|
|
4
|
-
export interface MPTextFieldProps {
|
|
6
|
+
export interface MPTextFieldProps extends MPStyleProps {
|
|
5
7
|
/**
|
|
6
8
|
* The field's text. This is a controlled component: what is shown is what is
|
|
7
9
|
* passed, except during composition — see `onChange`.
|
|
@@ -15,33 +17,45 @@ export interface MPTextFieldProps {
|
|
|
15
17
|
* @default 'text'
|
|
16
18
|
*/
|
|
17
19
|
type?: MPTextFieldType;
|
|
18
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Placeholder shown while the field is empty.
|
|
22
|
+
*
|
|
23
|
+
* With a floating label it is held back until the label has risen out of its
|
|
24
|
+
* way, which is the moment the field is focused. Two greyed strings in one box
|
|
25
|
+
* is not a hint, it is a collision.
|
|
26
|
+
*/
|
|
19
27
|
placeholder?: string;
|
|
20
28
|
/** Native `autocomplete` token — `'email'`, `'current-password'`, `'off'`. */
|
|
21
29
|
autoComplete?: string;
|
|
22
30
|
/**
|
|
23
|
-
* Label
|
|
24
|
-
*
|
|
25
|
-
*
|
|
31
|
+
* Label for the field, drawn in the outline's notch and — while the field is
|
|
32
|
+
* empty, unfocused and has no `startIcon` — resting on the field's own line
|
|
33
|
+
* where a placeholder would be. See `floatingLabel`.
|
|
26
34
|
*/
|
|
27
35
|
label?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the label rests on the field's line while there is nothing to make
|
|
38
|
+
* room for, and rises into the notch on focus or on the first character.
|
|
39
|
+
*
|
|
40
|
+
* `false` pins it in the notch, which is the one thing a floating label costs:
|
|
41
|
+
* a field with a label and a field without one no longer sit at the same
|
|
42
|
+
* height in a form until both are filled.
|
|
43
|
+
*
|
|
44
|
+
* A `startIcon` holds the label up regardless. The icon is already standing
|
|
45
|
+
* where the resting label would be, and the two cannot share the spot.
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
floatingLabel?: boolean;
|
|
28
49
|
/** Marks the field required, both to assistive technology and to the label. */
|
|
29
50
|
required?: boolean;
|
|
30
51
|
/** Greys the field out and stops it taking input. */
|
|
31
52
|
disabled?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Draws the field at MUI's `medium` size instead of `small`.
|
|
34
|
-
* @default false
|
|
35
|
-
*/
|
|
36
|
-
large?: boolean;
|
|
37
53
|
/**
|
|
38
54
|
* Focuses the field on mount — except on a small screen, where it would
|
|
39
55
|
* summon the on-screen keyboard over the page the reader has just arrived at.
|
|
40
56
|
* @default false
|
|
41
57
|
*/
|
|
42
58
|
autoFocus?: boolean;
|
|
43
|
-
/** Stretches the field to the width of its container. */
|
|
44
|
-
fullWidth?: boolean;
|
|
45
59
|
/**
|
|
46
60
|
* Shows the value without allowing edits. Unlike `disabled` the text stays
|
|
47
61
|
* selectable and the field stays in the tab order, which is what you want for
|
|
@@ -73,11 +87,21 @@ export interface MPTextFieldProps {
|
|
|
73
87
|
*/
|
|
74
88
|
resizable?: boolean;
|
|
75
89
|
/**
|
|
76
|
-
* The id put on the control and pointed at by the label.
|
|
77
|
-
*
|
|
78
|
-
* name.
|
|
90
|
+
* The id put on the control and pointed at by the label. Generated when it is
|
|
91
|
+
* left out.
|
|
79
92
|
*/
|
|
80
93
|
id?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Which language the reveal toggle's name is written in. Falls back to the
|
|
96
|
+
* nearest `MPLocaleProvider`, then to English.
|
|
97
|
+
*
|
|
98
|
+
* It is the only text a text field invents — everything else in it is yours —
|
|
99
|
+
* and until it was in the table it was the one string in the library with no
|
|
100
|
+
* way at all to change it.
|
|
101
|
+
*/
|
|
102
|
+
locale?: string;
|
|
103
|
+
/** Overrides the two words the reveal toggle is announced by. */
|
|
104
|
+
passwordLabels?: Partial<MPMessages['textField']>;
|
|
81
105
|
/**
|
|
82
106
|
* Called with the field's text on every change, including each keystroke of
|
|
83
107
|
* an in-progress composition. The field shows what was actually typed until
|
|
@@ -97,14 +121,19 @@ export interface MPTextFieldProps {
|
|
|
97
121
|
onFormReset?: () => void;
|
|
98
122
|
}
|
|
99
123
|
/**
|
|
100
|
-
* A Material
|
|
124
|
+
* A Material Design text field that survives an IME.
|
|
125
|
+
*
|
|
126
|
+
* The control is an outlined text field, drawn from Material Design 3's own
|
|
127
|
+
* component tokens: `outline` at rest, `primary` and a 2px stroke on focus,
|
|
128
|
+
* `error` when there is a message, and the spec's disabled opacities. Behaviour
|
|
129
|
+
* that a field needs but has nothing to do with looks — the label association,
|
|
130
|
+
* the validity plumbing, the `aria-describedby` onto the supporting text —
|
|
131
|
+
* comes from Base UI's `Field`.
|
|
101
132
|
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* exposes, plus the parts of a field that are always assembled by hand
|
|
107
|
-
* anyway: the label, the helper text, the adornments and the password toggle.
|
|
133
|
+
* What this component adds is the handling around a controlled input that a
|
|
134
|
+
* language with an input method exposes, plus the parts of a field that are
|
|
135
|
+
* always assembled by hand anyway: the notch, the adornments and the password
|
|
136
|
+
* toggle.
|
|
108
137
|
*
|
|
109
138
|
* ## The composition problem
|
|
110
139
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as o from"react";import
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as o from"react";import{Field as n}from"@base-ui/react/field";import{MPIcon as a}from"../icon/MPIcon";import{MPFieldLabel as r,MPFieldOutline as l,useFloatingLabel as i}from"../../internal/FieldOutline";import{VisibilityIcon as s,VisibilityOffIcon as d}from"../../constants/icons";import{useMPLocale as p,useMPMessages as c}from"../../internal/locale";const u={xs:{padding:"px-2",control:"py-1.5",text:"text-mp-body-medium",icon:16},sm:{padding:"px-3",control:"py-2.5",text:"text-mp-body-medium",icon:18},md:{padding:"px-4",control:"py-4",text:"text-mp-body-large",icon:20},lg:{padding:"px-4",control:"py-5",text:"text-mp-body-large",icon:22},xl:{padding:"px-5",control:"py-6",text:"text-mp-body-large",icon:24}};export const MPTextField=o.forwardRef(function({value:m,name:f,type:x="text",placeholder:b,autoComplete:g,label:y,floatingLabel:h=!0,onChange:v,onFormReset:w,onSubmit:C,errorMessage:k="",required:j=!1,fullWidth:z=!1,readOnly:E=!1,autoFocus:F=!1,size:M="md",disabled:N=!1,disableEnterKey:P=!1,rows:S,maxLength:q,startIcon:D,resizable:L=!1,id:R,locale:I,passwordLabels:O},B){const K=p(I),U=c("textField",K,O),_=o.useRef(null),[T,W]=o.useState(!1),[$,A]=o.useState(!1),[G,H]=o.useState(m),J=o.useId(),Q=R??J,V=!!S,X=k.length>0,Y=u[M],Z=$?G:m,{shrunk:ee,focusProps:te}=i({floating:h&&!!y,filled:Z.length>0,pinned:!!D}),oe=o.useCallback(e=>{_.current=e,"function"==typeof B?B(e):B&&(B.current=e)},[B]),ne=e=>{e.preventDefault()};return o.useEffect(()=>{$||H(m)},[m,$]),o.useEffect(()=>{F&&!window.matchMedia("(max-width: 599.95px)").matches&&_.current?.focus()},[]),t(n.Root,{className:["mp-text-field group relative",z?"w-full":"inline-block","align-top"].join(" "),disabled:N,invalid:X,"data-mp-size":M,...te,children:[t("div",{className:["relative flex w-full items-center gap-2",Y.padding,V?"py-2":""].filter(Boolean).join(" "),children:[e(l,{label:y,required:j,notched:ee}),D?e("span",{className:"text-mp-on-surface-variant group-data-disabled:text-mp-on-surface/38 flex shrink-0 items-center",children:D}):null,e(n.Control,{render:V?e("textarea",{rows:S}):e("input",{}),id:Q,name:f,type:V?void 0:T?"text":x,required:j,readOnly:E,disabled:N,autoComplete:g,placeholder:ee?b:void 0,maxLength:q,value:Z,ref:oe,className:[`${Y.text} text-mp-on-surface w-full min-w-0 flex-1`,"font-[family-name:var(--mp-sys-typescale-body-large-font)]","appearance-none border-0 bg-transparent px-0 outline-none","caret-mp-primary",Y.control,V?"py-0":"",V&&L?"resize-y":"resize-none","group-data-disabled:text-mp-on-surface/38","placeholder:text-mp-on-surface-variant group-data-disabled:placeholder:text-mp-on-surface/38"].filter(Boolean).join(" "),onChange:e=>{w?.();const t=e.target.value;$&&H(t),v?.(t)},onCompositionStart:()=>{A(!0),H(m)},onCompositionUpdate:e=>{H(e.target.value)},onCompositionEnd:e=>{A(!1);const t=e.target.value;w?.(),v?.(t),H(t)},onKeyDown:e=>{if("Enter"===e.key){if(function(e){const t=e.nativeEvent;return t.isComposing||229===t.keyCode}(e))return;C?.(),V&&!P||e.preventDefault()}}}),"password"!==x||V?null:e("button",{type:"button","aria-label":T?U.hidePassword:U.showPassword,onClick:()=>W(e=>!e),onMouseDown:ne,onMouseUp:ne,disabled:N,className:["text-mp-on-surface-variant -mr-1 flex shrink-0 items-center justify-center","cursor-pointer appearance-none border-0 bg-transparent p-1 font-[inherit]","rounded-full outline-none","hover:text-mp-on-surface focus-visible:text-mp-primary","disabled:text-mp-on-surface/38 disabled:cursor-default"].join(" "),children:e(a,{icon:T?s:d,size:Y.icon})}),y?e(r,{size:M,label:y,required:j,htmlFor:Q,shrunk:ee,multiline:V}):null]}),X?e(n.Error,{match:!0,className:["mp-text-field__support text-mp-body-small text-mp-error mt-1 block",Y.padding,"group-data-disabled:text-mp-on-surface/38"].join(" "),children:k}):null]})});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { MPColor, MPSize } from '../../types';
|
|
4
|
+
/**
|
|
5
|
+
* When the line under a link is drawn.
|
|
6
|
+
*
|
|
7
|
+
* `always` is the default, and the reason is `color`: an `MPTextLink` takes no
|
|
8
|
+
* accent family unless one is asked for, so with the line off there would be
|
|
9
|
+
* nothing at all distinguishing a link from the sentence it sits in. That is
|
|
10
|
+
* also why this is not a boolean — "no underline" is a real choice for a link in
|
|
11
|
+
* a nav bar or a footer, where position already says what it is, and it should
|
|
12
|
+
* have to be spelled out rather than fallen into.
|
|
13
|
+
*/
|
|
14
|
+
export type MPTextLinkUnderline = 'always' | 'hover' | 'none';
|
|
15
|
+
export interface MPTextLinkProps extends Omit<React.ComponentPropsWithoutRef<'a'>, 'color'> {
|
|
16
|
+
/** Where the link goes. */
|
|
17
|
+
href: string;
|
|
18
|
+
/**
|
|
19
|
+
* When the underline is drawn.
|
|
20
|
+
* @default 'always'
|
|
21
|
+
*/
|
|
22
|
+
underline?: MPTextLinkUnderline;
|
|
23
|
+
/**
|
|
24
|
+
* Which accent family the link reads. Like `MPTypography` and unlike every
|
|
25
|
+
* control in the library this has **no default** — a link in a paragraph is
|
|
26
|
+
* usually the paragraph's own colour with a line under it, and a component
|
|
27
|
+
* that arrived pre-dyed is one a page has to undo.
|
|
28
|
+
*/
|
|
29
|
+
color?: MPColor;
|
|
30
|
+
/**
|
|
31
|
+
* The type scale. Also no default: a link inside a sentence is the size of the
|
|
32
|
+
* sentence. Set it for a link that stands on its own.
|
|
33
|
+
*/
|
|
34
|
+
size?: MPSize;
|
|
35
|
+
/**
|
|
36
|
+
* Opens the link in a new tab, with the `rel` that keeps the new page from
|
|
37
|
+
* reaching back into this one.
|
|
38
|
+
*
|
|
39
|
+
* A window changing under the reader is the one thing about a link that cannot
|
|
40
|
+
* be seen before it happens, so this also turns `icon` on by default and adds
|
|
41
|
+
* a line for a screen reader — see `newTabLabel`.
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
newTab?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* The mark after the label. `true` draws the arrow leaving its box when
|
|
47
|
+
* `newTab` is on and the chain otherwise, `false` draws nothing, and a node of
|
|
48
|
+
* your own replaces the glyph.
|
|
49
|
+
*
|
|
50
|
+
* Left out, it follows `newTab`.
|
|
51
|
+
*/
|
|
52
|
+
icon?: React.ReactNode | boolean;
|
|
53
|
+
/**
|
|
54
|
+
* What a screen reader hears after the label when `newTab` is on. A link
|
|
55
|
+
* without it says nothing of its own, so this changes nothing there.
|
|
56
|
+
* @default 'Opens in a new tab'
|
|
57
|
+
*/
|
|
58
|
+
newTabLabel?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Renders something other than an `<a>` — the `Link` a router brings, most of
|
|
61
|
+
* the time. `href` still goes through, so `render={<NextLink href="…" />}`
|
|
62
|
+
* needs it written once, on the `MPTextLink`.
|
|
63
|
+
*/
|
|
64
|
+
render?: useRender.RenderProp;
|
|
65
|
+
/** The label. */
|
|
66
|
+
children?: React.ReactNode;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A link, in a sentence or on its own.
|
|
70
|
+
*
|
|
71
|
+
* Everything about it is deliberately smaller than a button. It has no surface,
|
|
72
|
+
* no height of its own and no colour unless asked — what it has is a line under
|
|
73
|
+
* it, which is the one mark a reader already knows means "this goes somewhere".
|
|
74
|
+
*
|
|
75
|
+
* The three things it does that a bare `<a>` does not: it draws that line on a
|
|
76
|
+
* schedule (`always`, or only under the pointer), it marks a link that opens a
|
|
77
|
+
* new tab both visibly and for a screen reader, and it takes `render`, so the
|
|
78
|
+
* `Link` a router brings can wear all of it.
|
|
79
|
+
*
|
|
80
|
+
* ## Why this is not a button with an `href`
|
|
81
|
+
*
|
|
82
|
+
* `MPButton` deliberately has no `href`, and this is the other half of that
|
|
83
|
+
* decision. A link is announced as a link, opens in a new tab on the middle
|
|
84
|
+
* mouse button, and shows its destination in the status bar; a button does none
|
|
85
|
+
* of those and should not pretend to. Two components, because they are two
|
|
86
|
+
* things.
|
|
87
|
+
*/
|
|
88
|
+
export declare const MPTextLink: React.ForwardRefExoticComponent<MPTextLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,Fragment as n,jsxs as o}from"react/jsx-runtime";import*as r from"react";import{useRender as i}from"@base-ui/react/use-render";import{MPIcon as t}from"../icon/MPIcon";import{ExternalLinkIcon as l,LinkIcon as s}from"../../constants/icons";import{accentSlots as a}from"../../internal/accent";import{PROSE_TEXT as c}from"../../internal/scale";import{VISUALLY_HIDDEN as m}from"../../internal/visually-hidden";const p={always:"[&.mp-link]:underline",hover:"[&.mp-link]:no-underline [&.mp-link]:hover:underline",none:"[&.mp-link]:no-underline"},d=["[&.mp-link]:[text-underline-offset:0.2em]","[&.mp-link]:[text-decoration-thickness:0.08em]","[&.mp-link]:[text-decoration-color:color-mix(in_oklab,currentColor_45%,transparent)]","[&.mp-link]:hover:[text-decoration-color:currentColor]"].join(" ");export const MPTextLink=r.forwardRef(function({href:r,underline:u="always",color:f,size:k,newTab:h=!1,icon:x,newTabLabel:b="Opens in a new tab",render:v,className:y,style:w,children:j,..._},g){const N=h?"_blank":_.target,T="_blank"===N,z=x??T,C=!0===z?e(t,{icon:T?l:s,size:"0.95em"}):z,L=["mp-link cursor-pointer","transition-[color,text-decoration-color]","duration-(--mp-sys-motion-duration-short4)","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid focus-visible:rounded-mp-xs outline-none",k?c[k]:"",p[u],d,f?"[&.mp-link]:text-(--_mp-accent)":"[&.mp-link]:text-inherit",y??""].filter(Boolean).join(" ");return i({render:v??e("a",{}),ref:g,props:{href:r,target:N,rel:T?"noopener noreferrer":void 0,className:L,style:f?{...a(f),...w}:w,children:o(n,{children:[j,C?e("span",{className:"ms-[0.25em] inline-flex align-baseline",children:C}):null,T?o(n,{children:[" ",e("span",{className:m,children:b})]}):null]}),..._}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{MPTextLink}from"./MPTextLink";
|