@m3ui-vue/m3ui-vue 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/dist/API.md +3661 -0
- package/dist/MIcon-CaEooCmZ.js.map +1 -1
- package/dist/{MTextField-B0wGv1Mx.js → MTextField-pJU1vFaR.js} +3 -3
- package/dist/MTextField-pJU1vFaR.js.map +1 -0
- package/dist/api.json +1 -0
- package/dist/barcode.js.map +1 -1
- package/dist/chart.js.map +1 -1
- package/dist/code-editor.js +2 -2
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MAbsolute.vue.d.ts +12 -0
- package/dist/components/MAlert.vue.d.ts +4 -0
- package/dist/components/MAppBar.vue.d.ts +12 -0
- package/dist/components/MAppLayout.vue.d.ts +2 -0
- package/dist/components/MAspectRatio.vue.d.ts +1 -0
- package/dist/components/MAutocomplete.vue.d.ts +18 -0
- package/dist/components/MAvatar.vue.d.ts +3 -0
- package/dist/components/MBadge.vue.d.ts +6 -0
- package/dist/components/MBar.vue.d.ts +5 -0
- package/dist/components/MBarcode.vue.d.ts +9 -0
- package/dist/components/MBottomSheet.vue.d.ts +3 -0
- package/dist/components/MBox.vue.d.ts +6 -0
- package/dist/components/MBreadcrumbs.vue.d.ts +2 -0
- package/dist/components/MButton.vue.d.ts +14 -4
- package/dist/components/MButtonGroup.vue.d.ts +7 -0
- package/dist/components/MCalendar.vue.d.ts +8 -0
- package/dist/components/MCard.vue.d.ts +17 -0
- package/dist/components/MCarousel.vue.d.ts +7 -1
- package/dist/components/MCenter.vue.d.ts +1 -0
- package/dist/components/MChart.vue.d.ts +7 -0
- package/dist/components/MChatBubble.vue.d.ts +10 -0
- package/dist/components/MCheckbox.vue.d.ts +5 -0
- package/dist/components/MChip.vue.d.ts +9 -0
- package/dist/components/MCircleProgressBar.vue.d.ts +7 -0
- package/dist/components/MCodeEditor.vue.d.ts +9 -0
- package/dist/components/MColorPicker.vue.d.ts +8 -0
- package/dist/components/MColorPickerModal.vue.d.ts +4 -0
- package/dist/components/MCommandPalette.vue.d.ts +8 -0
- package/dist/components/MConfirmDialog.vue.d.ts +7 -0
- package/dist/components/MContainer.vue.d.ts +4 -0
- package/dist/components/MContextMenu.vue.d.ts +3 -6
- package/dist/components/MCopyButton.vue.d.ts +10 -0
- package/dist/components/MDataTable.vue.d.ts +33 -12
- package/dist/components/MDatePicker.vue.d.ts +16 -0
- package/dist/components/MDatePickerModal.vue.d.ts +9 -0
- package/dist/components/MDateRangePicker.vue.d.ts +18 -0
- package/dist/components/MDateRangePickerModal.vue.d.ts +9 -0
- package/dist/components/MDialog.vue.d.ts +9 -7
- package/dist/components/MDivider.vue.d.ts +6 -0
- package/dist/components/MDragDropList.vue.d.ts +6 -0
- package/dist/components/MEmoji.vue.d.ts +6 -0
- package/dist/components/MEmojiButton.vue.d.ts +5 -0
- package/dist/components/MEmptyState.vue.d.ts +4 -0
- package/dist/components/MExpansionPanel.vue.d.ts +9 -0
- package/dist/components/MExportButton.vue.d.ts +8 -0
- package/dist/components/MFab.vue.d.ts +9 -0
- package/dist/components/MFabMenu.vue.d.ts +14 -0
- package/dist/components/MFileUpload.vue.d.ts +8 -0
- package/dist/components/MFixed.vue.d.ts +10 -0
- package/dist/components/MFlex.vue.d.ts +6 -0
- package/dist/components/MFooter.vue.d.ts +11 -0
- package/dist/components/MFullscreen.vue.d.ts +2 -0
- package/dist/components/MGrid.vue.d.ts +7 -0
- package/dist/components/MHotkeys.vue.d.ts +4 -0
- package/dist/components/MIcon.vue.d.ts +2 -0
- package/dist/components/MIconButton.vue.d.ts +10 -0
- package/dist/components/MInfiniteScroll.vue.d.ts +6 -0
- package/dist/components/MJsonEditor.vue.d.ts +8 -0
- package/dist/components/MJsonViewer.vue.d.ts +4 -0
- package/dist/components/MKanban.vue.d.ts +2 -0
- package/dist/components/MKbd.vue.d.ts +2 -0
- package/dist/components/MLightbox.vue.d.ts +4 -0
- package/dist/components/MList.vue.d.ts +7 -0
- package/dist/components/MListItem.vue.d.ts +24 -0
- package/dist/components/MListSubheader.vue.d.ts +6 -0
- package/dist/components/MLoadingIndicator.vue.d.ts +10 -0
- package/dist/components/MLoadingOverlay.vue.d.ts +5 -0
- package/dist/components/MMarkdown.vue.d.ts +3 -0
- package/dist/components/MMaskField.vue.d.ts +15 -0
- package/dist/components/MMasonry.vue.d.ts +5 -0
- package/dist/components/MMenu.vue.d.ts +3 -6
- package/dist/components/MMenuDivider.vue.d.ts +4 -0
- package/dist/components/MMenuItem.vue.d.ts +5 -0
- package/dist/components/MMultiAutocomplete.vue.d.ts +20 -0
- package/dist/components/MMultiSelect.vue.d.ts +21 -0
- package/dist/components/MNavigationBar.vue.d.ts +2 -0
- package/dist/components/MNavigationDrawer.vue.d.ts +11 -0
- package/dist/components/MNavigationRail.vue.d.ts +9 -6
- package/dist/components/MNavigationSuite.vue.d.ts +5 -3
- package/dist/components/MNumberField.vue.d.ts +17 -0
- package/dist/components/MOverlay.vue.d.ts +3 -0
- package/dist/components/MPageProgress.vue.d.ts +3 -0
- package/dist/components/MPagination.vue.d.ts +3 -0
- package/dist/components/MPasswordMeter.vue.d.ts +1 -0
- package/dist/components/MPinInput.vue.d.ts +11 -0
- package/dist/components/MProgressBar.vue.d.ts +6 -0
- package/dist/components/MPullToRefresh.vue.d.ts +8 -0
- package/dist/components/MQRCode.vue.d.ts +6 -0
- package/dist/components/MRadio.vue.d.ts +5 -0
- package/dist/components/MRadioGroup.vue.d.ts +6 -0
- package/dist/components/MRating.vue.d.ts +11 -0
- package/dist/components/MRelativeTime.vue.d.ts +1 -0
- package/dist/components/MResponsive.vue.d.ts +3 -0
- package/dist/components/MResult.vue.d.ts +6 -0
- package/dist/components/MRichTextEditor.vue.d.ts +8 -0
- package/dist/components/MScheduler.vue.d.ts +10 -0
- package/dist/components/MScrollable.vue.d.ts +3 -0
- package/dist/components/MSearchBar.vue.d.ts +6 -0
- package/dist/components/MSection.vue.d.ts +5 -0
- package/dist/components/MSegmentedButton.vue.d.ts +5 -0
- package/dist/components/MSelect.vue.d.ts +17 -0
- package/dist/components/MShader.vue.d.ts +1 -0
- package/dist/components/MShortNavigationBar.vue.d.ts +8 -9
- package/dist/components/MSideSheet.vue.d.ts +3 -0
- package/dist/components/MSignaturePad.vue.d.ts +7 -0
- package/dist/components/MSimpleCarousel.vue.d.ts +10 -0
- package/dist/components/MSkeleton.vue.d.ts +8 -0
- package/dist/components/MSlider.vue.d.ts +14 -0
- package/dist/components/MSnackbar.vue.d.ts +1 -0
- package/dist/components/MSpinner.vue.d.ts +6 -0
- package/dist/components/MSplitButton.vue.d.ts +7 -0
- package/dist/components/MSplitter.vue.d.ts +4 -0
- package/dist/components/MSpotlightSearch.vue.d.ts +18 -0
- package/dist/components/MStack.vue.d.ts +7 -0
- package/dist/components/MStatCard.vue.d.ts +7 -0
- package/dist/components/MStepper.vue.d.ts +7 -0
- package/dist/components/MSticky.vue.d.ts +2 -0
- package/dist/components/MSubtitle.vue.d.ts +4 -0
- package/dist/components/MSwitch.vue.d.ts +5 -6
- package/dist/components/MTable.vue.d.ts +17 -4
- package/dist/components/MTabs.vue.d.ts +6 -0
- package/dist/components/MTagInput.vue.d.ts +17 -0
- package/dist/components/MTerminal.vue.d.ts +4 -0
- package/dist/components/MText.vue.d.ts +10 -0
- package/dist/components/MTextField.vue.d.ts +18 -0
- package/dist/components/MTimePicker.vue.d.ts +10 -0
- package/dist/components/MTimePickerModal.vue.d.ts +5 -0
- package/dist/components/MTimeline.vue.d.ts +3 -0
- package/dist/components/MTitle.vue.d.ts +4 -0
- package/dist/components/MToggleButton.vue.d.ts +4 -0
- package/dist/components/MToolbar.vue.d.ts +5 -0
- package/dist/components/MTooltip.vue.d.ts +7 -0
- package/dist/components/MTopAppBar.vue.d.ts +8 -0
- package/dist/components/MTour.vue.d.ts +5 -0
- package/dist/components/MTransferList.vue.d.ts +11 -0
- package/dist/components/MTree.vue.d.ts +11 -0
- package/dist/components/MTreeTable.vue.d.ts +7 -0
- package/dist/components/MVirtualTable.vue.d.ts +6 -0
- package/dist/components/MWindow.vue.d.ts +32 -0
- package/dist/composables/useLocale.d.ts +2 -0
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +5239 -5242
- package/dist/m3ui.js.map +1 -1
- package/dist/markdown.js +1 -1
- package/dist/markdown.js.map +1 -1
- package/dist/qrcode.js.map +1 -1
- package/dist/rich-text-editor.js +3 -3
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/terminal.js.map +1 -1
- package/dist/{useLocale-CmI675Ab.js → useLocale-Drihe5G2.js} +13 -10
- package/dist/useLocale-Drihe5G2.js.map +1 -0
- package/package.json +4 -2
- package/src/__tests__/MHotkeys.test.ts +57 -0
- package/src/__tests__/hostLocale.test.ts +57 -0
- package/src/components/MAbsolute.vue +18 -0
- package/src/components/MAlert.vue +12 -0
- package/src/components/MAppBar.vue +12 -0
- package/src/components/MAppLayout.vue +11 -0
- package/src/components/MAspectRatio.vue +6 -0
- package/src/components/MAutocomplete.vue +24 -0
- package/src/components/MAvatar.vue +12 -1
- package/src/components/MBadge.vue +11 -0
- package/src/components/MBar.vue +19 -0
- package/src/components/MBarcode.vue +14 -0
- package/src/components/MBottomSheet.vue +12 -0
- package/src/components/MBox.vue +12 -0
- package/src/components/MBreadcrumbs.vue +7 -0
- package/src/components/MButton.vue +22 -4
- package/src/components/MButtonGroup.vue +13 -0
- package/src/components/MCalendar.vue +14 -0
- package/src/components/MCard.vue +26 -0
- package/src/components/MCarousel.vue +17 -1
- package/src/components/MCenter.vue +6 -0
- package/src/components/MChart.vue +12 -0
- package/src/components/MChatBubble.vue +17 -0
- package/src/components/MCheckbox.vue +11 -0
- package/src/components/MChip.vue +17 -0
- package/src/components/MCircleProgressBar.vue +13 -0
- package/src/components/MCodeEditor.vue +15 -0
- package/src/components/MColorPicker.vue +13 -0
- package/src/components/MColorPickerModal.vue +12 -0
- package/src/components/MCommandPalette.vue +16 -0
- package/src/components/MConfirmDialog.vue +15 -0
- package/src/components/MContainer.vue +9 -0
- package/src/components/MContextMenu.vue +17 -6
- package/src/components/MCopyButton.vue +16 -0
- package/src/components/MDataTable.vue +58 -12
- package/src/components/MDatePicker.vue +21 -0
- package/src/components/MDatePickerModal.vue +16 -0
- package/src/components/MDateRangePicker.vue +23 -0
- package/src/components/MDateRangePickerModal.vue +16 -0
- package/src/components/MDialog.vue +27 -7
- package/src/components/MDivider.vue +6 -0
- package/src/components/MDragDropList.vue +18 -0
- package/src/components/MEmoji.vue +6 -0
- package/src/components/MEmojiButton.vue +11 -0
- package/src/components/MEmojiSelector.vue +7 -0
- package/src/components/MEmptyState.vue +9 -0
- package/src/components/MExpansionPanel.vue +17 -0
- package/src/components/MExportButton.vue +15 -0
- package/src/components/MFab.vue +17 -0
- package/src/components/MFabMenu.vue +20 -0
- package/src/components/MFileUpload.vue +19 -0
- package/src/components/MFixed.vue +16 -0
- package/src/components/MFlex.vue +11 -0
- package/src/components/MFooter.vue +11 -0
- package/src/components/MFullscreen.vue +8 -0
- package/src/components/MGrid.vue +12 -0
- package/src/components/MHotkeys.vue +20 -13
- package/src/components/MIcon.vue +10 -1
- package/src/components/MIconButton.vue +13 -0
- package/src/components/MInfiniteScroll.vue +16 -0
- package/src/components/MJsonEditor.vue +13 -0
- package/src/components/MJsonViewer.vue +7 -0
- package/src/components/MKanban.vue +18 -0
- package/src/components/MKbd.vue +6 -0
- package/src/components/MLightbox.vue +16 -0
- package/src/components/MList.vue +15 -0
- package/src/components/MListDetail.vue +11 -0
- package/src/components/MListItem.vue +37 -0
- package/src/components/MListSubheader.vue +6 -0
- package/src/components/MLoadingIndicator.vue +15 -0
- package/src/components/MLoadingOverlay.vue +12 -0
- package/src/components/MMarkdown.vue +7 -0
- package/src/components/MMaskField.vue +21 -0
- package/src/components/MMasonry.vue +11 -0
- package/src/components/MMenu.vue +16 -6
- package/src/components/MMenuDivider.vue +4 -0
- package/src/components/MMenuItem.vue +16 -0
- package/src/components/MMultiAutocomplete.vue +26 -0
- package/src/components/MMultiSelect.vue +27 -0
- package/src/components/MNavigationBar.vue +7 -0
- package/src/components/MNavigationDrawer.vue +25 -0
- package/src/components/MNavigationRail.vue +24 -6
- package/src/components/MNavigationSuite.vue +20 -3
- package/src/components/MNotificationHost.vue +3 -0
- package/src/components/MNumberField.vue +24 -0
- package/src/components/MOverlay.vue +10 -0
- package/src/components/MPageProgress.vue +7 -0
- package/src/components/MPagination.vue +15 -1
- package/src/components/MPasswordMeter.vue +7 -0
- package/src/components/MPinInput.vue +19 -0
- package/src/components/MProgressBar.vue +9 -0
- package/src/components/MPullToRefresh.vue +17 -0
- package/src/components/MQRCode.vue +12 -0
- package/src/components/MRadio.vue +11 -0
- package/src/components/MRadioGroup.vue +11 -0
- package/src/components/MRating.vue +19 -0
- package/src/components/MRelative.vue +8 -0
- package/src/components/MRelativeTime.vue +6 -0
- package/src/components/MResponsive.vue +9 -0
- package/src/components/MResult.vue +14 -0
- package/src/components/MRichTextEditor.vue +14 -0
- package/src/components/MScheduler.vue +21 -0
- package/src/components/MScrollable.vue +8 -0
- package/src/components/MSearchBar.vue +17 -0
- package/src/components/MSection.vue +13 -0
- package/src/components/MSegmentedButton.vue +10 -0
- package/src/components/MSelect.vue +22 -0
- package/src/components/MShader.vue +13 -0
- package/src/components/MShape.vue +6 -0
- package/src/components/MShortNavigationBar.vue +23 -9
- package/src/components/MSideSheet.vue +13 -0
- package/src/components/MSignaturePad.vue +15 -0
- package/src/components/MSimpleCarousel.vue +18 -0
- package/src/components/MSkeleton.vue +8 -0
- package/src/components/MSlider.vue +21 -0
- package/src/components/MSnackbar.vue +5 -0
- package/src/components/MSpacer.vue +6 -0
- package/src/components/MSpinner.vue +10 -0
- package/src/components/MSplitButton.vue +14 -0
- package/src/components/MSplitter.vue +10 -0
- package/src/components/MSpotlightSearch.vue +27 -0
- package/src/components/MStack.vue +12 -0
- package/src/components/MStatCard.vue +13 -0
- package/src/components/MStepper.vue +12 -0
- package/src/components/MSticky.vue +7 -0
- package/src/components/MSubtitle.vue +9 -0
- package/src/components/MSupportingPane.vue +10 -0
- package/src/components/MSwitch.vue +14 -6
- package/src/components/MTable.vue +33 -4
- package/src/components/MTabs.vue +12 -0
- package/src/components/MTagInput.vue +23 -0
- package/src/components/MTerminal.vue +11 -0
- package/src/components/MText.vue +15 -0
- package/src/components/MTextField.vue +26 -0
- package/src/components/MTimePicker.vue +15 -0
- package/src/components/MTimePickerModal.vue +12 -0
- package/src/components/MTimeline.vue +7 -0
- package/src/components/MTitle.vue +9 -0
- package/src/components/MToggleButton.vue +12 -0
- package/src/components/MToolbar.vue +12 -0
- package/src/components/MTooltip.vue +15 -0
- package/src/components/MTopAppBar.vue +18 -0
- package/src/components/MTour.vue +13 -0
- package/src/components/MTransferList.vue +24 -0
- package/src/components/MTree.vue +11 -0
- package/src/components/MTreeTable.vue +15 -0
- package/src/components/MVirtualTable.vue +12 -0
- package/src/components/MWindow.vue +34 -0
- package/src/composables/useLocale.ts +16 -3
- package/src/plugin.ts +2 -1
- package/dist/MTextField-B0wGv1Mx.js.map +0 -1
- package/dist/useLocale-CmI675Ab.js.map +0 -1
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A single radio button, for when you lay out the options yourself. It's selected when `modelValue` equals its
|
|
4
|
+
* `value`; for a plain list of options, MRadioGroup is simpler.
|
|
5
|
+
*
|
|
6
|
+
* @event update:modelValue Emitted with `value` when the radio is selected.
|
|
7
|
+
*/
|
|
2
8
|
import { computed, useId } from "vue";
|
|
3
9
|
|
|
4
10
|
const props = withDefaults(
|
|
5
11
|
defineProps<{
|
|
12
|
+
/** The group's current value (v-model); share one ref between the radios of a group. */
|
|
6
13
|
modelValue: unknown;
|
|
14
|
+
/** The value this radio stands for; selecting it sets the v-model to it. */
|
|
7
15
|
value: unknown;
|
|
16
|
+
/** Text next to the radio. Clicking it selects the radio too. */
|
|
8
17
|
label?: string;
|
|
18
|
+
/** Grays the radio out and ignores clicks. */
|
|
9
19
|
disabled?: boolean;
|
|
20
|
+
/** Color role of the selected radio. */
|
|
10
21
|
color?: "primary" | "secondary" | "tertiary" | "error";
|
|
11
22
|
}>(),
|
|
12
23
|
{ disabled: false, color: "primary" },
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A group of radio buttons sharing a single selection, column or row layout.
|
|
4
|
+
*
|
|
5
|
+
* @event update:modelValue Emitted with the selected option's value.
|
|
6
|
+
*/
|
|
2
7
|
import MRadio from './MRadio.vue'
|
|
3
8
|
|
|
4
9
|
interface Option {
|
|
@@ -8,11 +13,17 @@ interface Option {
|
|
|
8
13
|
}
|
|
9
14
|
|
|
10
15
|
const props = withDefaults(defineProps<{
|
|
16
|
+
/** Selected value (v-model) */
|
|
11
17
|
modelValue: unknown
|
|
18
|
+
/** Radio options */
|
|
12
19
|
options: Option[]
|
|
20
|
+
/** Group label */
|
|
13
21
|
label?: string
|
|
22
|
+
/** Layout direction */
|
|
14
23
|
direction?: 'column' | 'row'
|
|
24
|
+
/** Disables all radios */
|
|
15
25
|
disabled?: boolean
|
|
26
|
+
/** Radio color */
|
|
16
27
|
color?: 'primary' | 'secondary' | 'tertiary' | 'error'
|
|
17
28
|
}>(), { direction: 'column', disabled: false, color: 'primary' })
|
|
18
29
|
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A star rating input with half increments and any Material Symbol icon. Not part of the official M3 spec, so
|
|
4
|
+
* it's built from M3 primitives: filled/outlined icon pairs, a state layer on hover/press, and a focus ring.
|
|
5
|
+
* Click or drag to rate (drag past the first icon to clear), or use the arrow keys, Home and End when focused.
|
|
6
|
+
*
|
|
7
|
+
* @event update:modelValue Emitted when the user rates by click, drag or keyboard (v-model). Dragging past the
|
|
8
|
+
* first icon emits 0
|
|
9
|
+
*/
|
|
2
10
|
import { computed, ref } from 'vue'
|
|
3
11
|
import MIcon from './MIcon.vue'
|
|
4
12
|
|
|
@@ -6,13 +14,24 @@ import MIcon from './MIcon.vue'
|
|
|
6
14
|
// Material Symbol pairs, on-surface-variant for the unselected icon, a 40px circular
|
|
7
15
|
// hover/press state layer (8%/10%) tinted with the active color, and a secondary focus ring.
|
|
8
16
|
const props = withDefaults(defineProps<{
|
|
17
|
+
/** Current rating (v-model) */
|
|
9
18
|
modelValue: number
|
|
19
|
+
/** Maximum stars */
|
|
10
20
|
max?: number
|
|
21
|
+
/** Star size in px */
|
|
11
22
|
size?: number
|
|
23
|
+
/** Display-only: not focusable, exposed as role="img" with the value as its label */
|
|
12
24
|
readonly?: boolean
|
|
25
|
+
/** Disables interaction */
|
|
13
26
|
disabled?: boolean
|
|
27
|
+
/** One of the 4 M3 roles ('primary' | 'secondary' | 'tertiary' | 'error'), or any other CSS color string */
|
|
14
28
|
color?: string
|
|
29
|
+
/** Material Symbol icon */
|
|
15
30
|
icon?: string
|
|
31
|
+
/**
|
|
32
|
+
* Allow half-star values (click the left half of an icon). Fractional values always render exactly, with or
|
|
33
|
+
* without this prop
|
|
34
|
+
*/
|
|
16
35
|
halfIncrements?: boolean
|
|
17
36
|
}>(), { max: 5, size: 28, color: 'primary', icon: 'star', halfIncrements: false })
|
|
18
37
|
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
/**
|
|
3
|
+
* Wrapper that sets `position: relative` on a container. Use it as the positioning parent for MAbsolute
|
|
4
|
+
* children.
|
|
5
|
+
*
|
|
6
|
+
* @slot default Content; absolutely positioned children are placed relative to it.
|
|
7
|
+
*/
|
|
8
|
+
-->
|
|
1
9
|
<template>
|
|
2
10
|
<div class="relative">
|
|
3
11
|
<slot />
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Renders a timestamp as human-readable relative text ("5 minutes ago", "in 2 hours") that keeps itself up to
|
|
4
|
+
* date, formatted with the native Intl.RelativeTimeFormat. It renders a semantic `<time>` element, and hovering
|
|
5
|
+
* it shows the full absolute date.
|
|
6
|
+
*/
|
|
2
7
|
import { computed, onUnmounted, ref, watch } from 'vue'
|
|
3
8
|
import { useLocale } from '../composables/useLocale'
|
|
4
9
|
|
|
5
10
|
const props = withDefaults(
|
|
6
11
|
defineProps<{
|
|
12
|
+
/** Required. The timestamp to format: an ISO string, epoch milliseconds, or a Date */
|
|
7
13
|
value: string | number | Date
|
|
8
14
|
/** BCP-47 locale tag (e.g. 'es-ES'). Defaults to the app's locale (via createM3UI/useLocale), then the browser's locale. */
|
|
9
15
|
locale?: string
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Shows or hides content at specific breakpoints using pure CSS (Tailwind's `hidden`/`block` utilities) — no JS
|
|
4
|
+
* resize listener.
|
|
5
|
+
*
|
|
6
|
+
* @slot default Content.
|
|
7
|
+
*/
|
|
2
8
|
import { computed } from 'vue'
|
|
3
9
|
|
|
4
10
|
type Breakpoint = 'sm-up' | 'md-up' | 'lg-up' | 'xl-up' | 'sm-down' | 'md-down' | 'lg-down' | 'xl-down'
|
|
5
11
|
|
|
6
12
|
const props = withDefaults(
|
|
7
13
|
defineProps<{
|
|
14
|
+
/** Show content only at this breakpoint range */
|
|
8
15
|
show?: Breakpoint
|
|
16
|
+
/** Hide content at this breakpoint range */
|
|
9
17
|
hide?: Breakpoint
|
|
18
|
+
/** HTML tag to render */
|
|
10
19
|
tag?: string
|
|
11
20
|
}>(),
|
|
12
21
|
{ tag: 'div' },
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A full result screen for the end of a flow: success, errors, empty states and HTTP error pages. Each status
|
|
4
|
+
* comes with its own icon, colors, title and description, and you can override any of them. The default texts
|
|
5
|
+
* come from the active locale (`useLocale`), so they follow the language passed to `createM3UI({ locale })`.
|
|
6
|
+
*
|
|
7
|
+
* @slot actions Action buttons, in a centered row below the description
|
|
8
|
+
* @slot default Extra content below the actions row, e.g. a secondary link or fine print
|
|
9
|
+
*/
|
|
2
10
|
import { computed } from 'vue'
|
|
3
11
|
import MIcon from './MIcon.vue'
|
|
4
12
|
import { useLocale, type M3Locale } from '../composables/useLocale'
|
|
5
13
|
|
|
6
14
|
const props = withDefaults(defineProps<{
|
|
15
|
+
/**
|
|
16
|
+
* Required. Picks the icon, its colors, and the default title/description. The three HTTP statuses also show
|
|
17
|
+
* the code in large type above the icon
|
|
18
|
+
*/
|
|
7
19
|
status: 'success' | 'error' | 'warning' | 'info' | '404' | '403' | '500'
|
|
20
|
+
/** Custom title, replaces the status default */
|
|
8
21
|
title?: string
|
|
22
|
+
/** Custom description, replaces the status default */
|
|
9
23
|
description?: string
|
|
10
24
|
}>(), {})
|
|
11
25
|
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A WYSIWYG editor built on tiptap, with a formatting toolbar covering text styles, lists, alignment, links,
|
|
4
|
+
* and images.
|
|
5
|
+
*
|
|
6
|
+
* @event update:modelValue Emitted with the editor HTML on every content change — powers v-model
|
|
7
|
+
*/
|
|
2
8
|
import { ref, watch, onMounted, onBeforeUnmount, shallowRef, computed } from 'vue'
|
|
3
9
|
import MIcon from './MIcon.vue'
|
|
4
10
|
import MMenu from './MMenu.vue'
|
|
@@ -40,10 +46,18 @@ const locale = useLocale()
|
|
|
40
46
|
|
|
41
47
|
const props = withDefaults(
|
|
42
48
|
defineProps<{
|
|
49
|
+
/** HTML content (v-model) */
|
|
43
50
|
modelValue: string
|
|
51
|
+
/** Placeholder text shown on an empty document */
|
|
44
52
|
placeholder?: string
|
|
53
|
+
/** Disables editing */
|
|
45
54
|
disabled?: boolean
|
|
55
|
+
/** Minimum editor height */
|
|
46
56
|
minHeight?: string
|
|
57
|
+
/**
|
|
58
|
+
* Object with all toolbar/dialog label overrides for i18n (see `RichTextEditorLabels`) — defaults come from
|
|
59
|
+
* useLocale()
|
|
60
|
+
*/
|
|
47
61
|
labels?: RichTextEditorLabels
|
|
48
62
|
}>(),
|
|
49
63
|
{ disabled: false, minHeight: '200px' },
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A week or day calendar grid. Events sit at their exact times, overlapping ones share the width, and anything
|
|
4
|
+
* that lasts all day or spans several days runs across the all-day row. Click a day header to open that day.
|
|
5
|
+
* Dates and times follow the app's locale.
|
|
6
|
+
*
|
|
7
|
+
* @slot event Content of each event block; allDay is true in the all-day row
|
|
8
|
+
* @event eventClick An event (in the grid or the all-day row) was clicked
|
|
9
|
+
* @event slotClick An empty spot in the grid was clicked
|
|
10
|
+
* @event update:date Navigation changed the date shown (YYYY-MM-DD)
|
|
11
|
+
* @event update:view The Day/Week toggle (or a day header) changed the view
|
|
12
|
+
*/
|
|
2
13
|
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
|
3
14
|
import MIconButton from './MIconButton.vue'
|
|
4
15
|
import { useLocale } from '../composables/useLocale'
|
|
@@ -22,12 +33,15 @@ export interface SchedulerEvent {
|
|
|
22
33
|
|
|
23
34
|
const props = withDefaults(
|
|
24
35
|
defineProps<{
|
|
36
|
+
/** Events to show (see `SchedulerEvent`) */
|
|
25
37
|
events?: SchedulerEvent[]
|
|
26
38
|
/** 'week' or 'day'; use v-model:view to follow the header's toggle. */
|
|
27
39
|
view?: 'week' | 'day'
|
|
28
40
|
/** The date shown (`YYYY-MM-DD`), today by default; use v-model:date to follow navigation. */
|
|
29
41
|
date?: string
|
|
42
|
+
/** First visible hour */
|
|
30
43
|
startHour?: number
|
|
44
|
+
/** Hour the grid ends at */
|
|
31
45
|
endHour?: number
|
|
32
46
|
/** First day of the week: 0 = Sunday, 1 = Monday. */
|
|
33
47
|
weekStartsOn?: 0 | 1
|
|
@@ -35,12 +49,19 @@ const props = withDefaults(
|
|
|
35
49
|
hourHeight?: number
|
|
36
50
|
/** A line across today's column at the current time. */
|
|
37
51
|
nowIndicator?: boolean
|
|
52
|
+
/** Locale for dates and times (Intl). Falls back to the app's configured locale */
|
|
38
53
|
locale?: string
|
|
54
|
+
/** Aria label of the previous button (defaults to the locale string) */
|
|
39
55
|
prevLabel?: string
|
|
56
|
+
/** Aria label of the next button (defaults to the locale string) */
|
|
40
57
|
nextLabel?: string
|
|
58
|
+
/** Label of the Today button (defaults to the locale string) */
|
|
41
59
|
todayLabel?: string
|
|
60
|
+
/** Label of the Day toggle (defaults to the locale string) */
|
|
42
61
|
dayViewLabel?: string
|
|
62
|
+
/** Label of the Week toggle (defaults to the locale string) */
|
|
43
63
|
weekViewLabel?: string
|
|
64
|
+
/** Label of the all-day row (defaults to the locale string) */
|
|
44
65
|
allDayLabel?: string
|
|
45
66
|
}>(),
|
|
46
67
|
{
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A constrained scroll area — vertical, horizontal, or both directions.
|
|
4
|
+
*
|
|
5
|
+
* @slot default The scrolling content.
|
|
6
|
+
*/
|
|
2
7
|
import { computed } from 'vue'
|
|
3
8
|
|
|
4
9
|
const props = withDefaults(
|
|
5
10
|
defineProps<{
|
|
11
|
+
/** Scroll direction */
|
|
6
12
|
direction?: 'vertical' | 'horizontal' | 'both'
|
|
13
|
+
/** Fixed height (CSS value) */
|
|
7
14
|
height?: string
|
|
15
|
+
/** Maximum height (CSS value) */
|
|
8
16
|
maxHeight?: string
|
|
9
17
|
}>(),
|
|
10
18
|
{ direction: 'vertical' },
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A collapsed search field that expands into a docked panel or a fullscreen overlay, with results shown below
|
|
4
|
+
* the input.
|
|
5
|
+
*
|
|
6
|
+
* @slot leading Overrides the collapsed bar's leading icon
|
|
7
|
+
* @slot trailing Trailing content in both the collapsed bar and the expanded header (e.g. an avatar)
|
|
8
|
+
* @slot default Results/suggestions content, shown below the input while expanded
|
|
9
|
+
* @event update:modelValue Emitted on every input change — powers v-model
|
|
10
|
+
* @event search Emitted when Enter is pressed in the input, with the current query
|
|
11
|
+
* @event update:expanded Emitted when the expanded state changes — powers v-model:expanded
|
|
12
|
+
*/
|
|
2
13
|
import { computed, ref, watch, onMounted, onUnmounted, nextTick, useId } from 'vue'
|
|
3
14
|
import MIcon from './MIcon.vue'
|
|
4
15
|
import MIconButton from './MIconButton.vue'
|
|
@@ -11,14 +22,17 @@ defineOptions({ inheritAttrs: false })
|
|
|
11
22
|
|
|
12
23
|
const props = withDefaults(
|
|
13
24
|
defineProps<{
|
|
25
|
+
/** Search query (v-model) */
|
|
14
26
|
modelValue?: string
|
|
15
27
|
/** Controls the expanded/collapsed state — also works uncontrolled if omitted. */
|
|
16
28
|
expanded?: boolean
|
|
29
|
+
/** Defaults to the locale's "Search..." */
|
|
17
30
|
placeholder?: string
|
|
18
31
|
/** 'docked' grows into a rounded panel anchored below the bar (default).
|
|
19
32
|
* 'fullscreen' takes over the whole viewport, matching M3's mobile
|
|
20
33
|
* search pattern — the leading icon becomes a back button either way. */
|
|
21
34
|
variant?: 'docked' | 'fullscreen'
|
|
35
|
+
/** Icon shown in the collapsed bar */
|
|
22
36
|
leadingIcon?: string
|
|
23
37
|
/** Which side of the *collapsed* bar the leading icon sits on. The
|
|
24
38
|
* expanded panel's back button always stays at the start regardless —
|
|
@@ -27,8 +41,11 @@ const props = withDefaults(
|
|
|
27
41
|
/** Centers the input/placeholder text instead of the M3-standard start
|
|
28
42
|
* alignment (an iOS-style look some apps use for the collapsed bar). */
|
|
29
43
|
textAlign?: 'start' | 'center'
|
|
44
|
+
/** Shows a spinner in the expanded header instead of the clear button */
|
|
30
45
|
loading?: boolean
|
|
46
|
+
/** Shows a clear (×) button once there is a query */
|
|
31
47
|
clearable?: boolean
|
|
48
|
+
/** Disables the collapsed bar */
|
|
32
49
|
disabled?: boolean
|
|
33
50
|
}>(),
|
|
34
51
|
{
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A titled content section with optional subtitle, header actions, and divider.
|
|
4
|
+
*
|
|
5
|
+
* @slot title Custom title content (overrides title prop)
|
|
6
|
+
* @slot subtitle Custom subtitle content (overrides subtitle prop)
|
|
7
|
+
* @slot actions Action buttons displayed in the header row
|
|
8
|
+
* @slot default Main section content
|
|
9
|
+
*/
|
|
2
10
|
import { computed } from 'vue'
|
|
3
11
|
import type { TextVariant } from './MText.vue'
|
|
4
12
|
|
|
5
13
|
const props = withDefaults(
|
|
6
14
|
defineProps<{
|
|
15
|
+
/** Section title text */
|
|
7
16
|
title?: string
|
|
17
|
+
/** Section subtitle text */
|
|
8
18
|
subtitle?: string
|
|
19
|
+
/** Show divider below header */
|
|
9
20
|
divider?: boolean
|
|
21
|
+
/** Gap between header and content */
|
|
10
22
|
gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
23
|
+
/** Typography variant for the title */
|
|
11
24
|
titleVariant?: TextVariant
|
|
12
25
|
}>(),
|
|
13
26
|
{ gap: 'md', divider: false, titleVariant: 'title-large' },
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A row of joined segments for choosing between a small set of related options — single or multi select.
|
|
4
|
+
*
|
|
5
|
+
* @event update:modelValue Emitted on selection change — powers v-model
|
|
6
|
+
*/
|
|
2
7
|
import MIcon from './MIcon.vue'
|
|
3
8
|
|
|
4
9
|
export interface SegmentedOption {
|
|
@@ -9,10 +14,15 @@ export interface SegmentedOption {
|
|
|
9
14
|
}
|
|
10
15
|
|
|
11
16
|
withDefaults(defineProps<{
|
|
17
|
+
/** Selected value(s) */
|
|
12
18
|
modelValue: string | number | (string | number)[]
|
|
19
|
+
/** The options to choose from; see `SegmentedOption`. */
|
|
13
20
|
options: SegmentedOption[]
|
|
21
|
+
/** Allow multiple selections */
|
|
14
22
|
multiSelect?: boolean
|
|
23
|
+
/** Button density */
|
|
15
24
|
density?: 'default' | 'comfortable' | 'compact'
|
|
25
|
+
/** Selected segment color */
|
|
16
26
|
color?: 'primary' | 'secondary' | 'tertiary'
|
|
17
27
|
}>(), { multiSelect: false, density: 'default', color: 'primary' })
|
|
18
28
|
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A single-value dropdown select, docked or as a modal dialog on smaller screens.
|
|
4
|
+
*
|
|
5
|
+
* @event update:modelValue Emitted with the selected option's value.
|
|
6
|
+
*/
|
|
2
7
|
import { computed, ref, useId, onMounted, onUnmounted, watch } from 'vue'
|
|
3
8
|
import MIcon from './MIcon.vue'
|
|
4
9
|
import MIconButton from './MIconButton.vue'
|
|
@@ -17,20 +22,37 @@ defineOptions({ inheritAttrs: false })
|
|
|
17
22
|
|
|
18
23
|
const props = withDefaults(
|
|
19
24
|
defineProps<{
|
|
25
|
+
/** Selected value (any type — v-model) */
|
|
20
26
|
modelValue: unknown
|
|
27
|
+
/** The options to choose from; see `SelectOption`. */
|
|
21
28
|
options: SelectOption[]
|
|
29
|
+
/** Field label */
|
|
22
30
|
label?: string
|
|
31
|
+
/** Placeholder when no value selected */
|
|
23
32
|
placeholder?: string
|
|
33
|
+
/** Visual style */
|
|
24
34
|
variant?: 'filled' | 'outlined'
|
|
35
|
+
/** Dropdown mode: docked (inline) or modal (dialog) */
|
|
25
36
|
mode?: 'docked' | 'modal'
|
|
37
|
+
/** Disables the select */
|
|
26
38
|
disabled?: boolean
|
|
39
|
+
/** Error state */
|
|
27
40
|
error?: boolean
|
|
41
|
+
/** Error message shown when error is true */
|
|
28
42
|
errorLabel?: string
|
|
43
|
+
/** Hint text below the field */
|
|
29
44
|
hint?: string
|
|
45
|
+
/** Marks as required — adds a red asterisk after the label */
|
|
30
46
|
required?: boolean
|
|
47
|
+
/** Material Symbol shown before the trigger */
|
|
31
48
|
leadingIcon?: string
|
|
49
|
+
/** Show a clear button to reset the selection */
|
|
32
50
|
clearable?: boolean
|
|
51
|
+
/**
|
|
52
|
+
* Overrides the auto-detected background color used to cut the floating label out of the outlined border
|
|
53
|
+
*/
|
|
33
54
|
fieldBg?: string
|
|
55
|
+
/** Text shown when options is empty — defaults to the current locale's string */
|
|
34
56
|
noResultsText?: string
|
|
35
57
|
}>(),
|
|
36
58
|
{
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A canvas container for hand-written shaders. Give it a GLSL fragment shader (Shadertoy-style — it runs on
|
|
4
|
+
* WebGL2 and works everywhere) and, optionally, a WGSL fragment shader that runs on WebGPU when the browser
|
|
5
|
+
* supports it. `renderer="auto"` picks WebGPU whenever both a `wgsl` source and browser support are present,
|
|
6
|
+
* otherwise it falls back to WebGL2 — so the same component works as a drop-in on old and new browsers alike.
|
|
7
|
+
*
|
|
8
|
+
* @slot loading Shown while the backend initializes (default: MSpinner)
|
|
9
|
+
* @slot fallback Shown when neither WebGL2 nor WebGPU is available at all
|
|
10
|
+
* @slot error Shown on a shader compile/link/runtime error, with the message
|
|
11
|
+
* @event error Emitted on a shader compile/link error, or a WebGPU runtime error
|
|
12
|
+
* @event ready Emitted once the backend has initialized — which backend ended up driving the canvas
|
|
13
|
+
*/
|
|
2
14
|
/// <reference types="@webgpu/types" />
|
|
3
15
|
import { ref, shallowRef, onMounted, onBeforeUnmount, watch } from 'vue'
|
|
4
16
|
import MSpinner from './MSpinner.vue'
|
|
@@ -22,6 +34,7 @@ const props = withDefaults(
|
|
|
22
34
|
renderer?: ShaderRenderer
|
|
23
35
|
/** Custom uniforms. Keys/shape are locked in at mount time; only values are reactive per frame. */
|
|
24
36
|
uniforms?: Record<string, number | number[]>
|
|
37
|
+
/** Freezes the render loop and the shader clock */
|
|
25
38
|
paused?: boolean
|
|
26
39
|
/** Device pixel ratio to render at. Defaults to devicePixelRatio, capped at 2 for performance. */
|
|
27
40
|
pixelRatio?: number
|
|
@@ -3,6 +3,12 @@ export { shapeNames } from 'shape-morph'
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup lang="ts">
|
|
6
|
+
/**
|
|
7
|
+
* Clips its content — or renders a filled shape with no content — into one of Material 3's 35 real "expressive"
|
|
8
|
+
* shapes. Changing `shape` spring-morphs into the new outline instead of snapping.
|
|
9
|
+
*
|
|
10
|
+
* @slot default Content clipped to the shape (an image, an icon, anything). Without it the shape is drawn filled with `fill`.
|
|
11
|
+
*/
|
|
6
12
|
import { onUnmounted, ref, useId, watch } from 'vue'
|
|
7
13
|
import { AnimatedMorph, getShape, toSvgPath, type ShapeName } from 'shape-morph'
|
|
8
14
|
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* M3 Expressive's shorter navigation bar (64dp, vs. MNavigationBar's classic 80dp) — a genuinely separate
|
|
4
|
+
* component, not just a size variant.
|
|
5
|
+
*
|
|
6
|
+
* @event update:modelValue Emitted when an item is clicked — powers v-model
|
|
7
|
+
*/
|
|
2
8
|
import { computed } from 'vue'
|
|
3
9
|
import MIcon from './MIcon.vue'
|
|
4
10
|
import MBadge from './MBadge.vue'
|
|
@@ -18,20 +24,28 @@ export interface ShortNavBarItem {
|
|
|
18
24
|
|
|
19
25
|
const props = withDefaults(
|
|
20
26
|
defineProps<{
|
|
27
|
+
/** Active item value, v-model */
|
|
21
28
|
modelValue: string | number
|
|
29
|
+
/** Array of nav bar items (see `ShortNavBarItem`) */
|
|
22
30
|
items: ShortNavBarItem[]
|
|
23
31
|
/**
|
|
24
|
-
* 'equal' (
|
|
25
|
-
* for
|
|
26
|
-
* of stretching edge to edge — recommended for medium-width screens, paired with iconPosition
|
|
27
|
-
* 'start'. Real Compose computes this via a custom MeasurePolicy at layout time; ported here as
|
|
28
|
-
* the same closed-form percentage formula (calculateCenteredContentHorizontalPadding), since it
|
|
29
|
-
* only ever depends on the item count, not on measured content size.
|
|
32
|
+
* 'equal' fills the bar edge to edge (small screens); 'centered' groups items toward the middle instead,
|
|
33
|
+
* recommended for medium/landscape screens
|
|
30
34
|
*/
|
|
35
|
+
// 'equal' (ShortNavigationBarArrangement.EqualWeight): items evenly fill the bar — recommended
|
|
36
|
+
// for small-width screens. 'centered' (.Centered): items are grouped toward the center instead
|
|
37
|
+
// of stretching edge to edge — recommended for medium-width screens, paired with iconPosition
|
|
38
|
+
// 'start'. Real Compose computes this via a custom MeasurePolicy at layout time; ported here as
|
|
39
|
+
// the same closed-form percentage formula (calculateCenteredContentHorizontalPadding), since it
|
|
40
|
+
// only ever depends on the item count, not on measured content size.
|
|
31
41
|
arrangement?: 'equal' | 'centered'
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
42
|
+
/**
|
|
43
|
+
* 'top' stacks the icon above the label; 'start' places it beside the label in one wider pill — typically
|
|
44
|
+
* paired with arrangement='centered'
|
|
45
|
+
*/
|
|
46
|
+
// NavigationItemIconPosition — 'top' stacks icon above label (ShortNavigationBarItem's
|
|
47
|
+
// default); 'start' places the icon beside the label inside a single wider pill, meant for
|
|
48
|
+
// the 'centered' arrangement on wider/landscape layouts.
|
|
35
49
|
iconPosition?: 'top' | 'start'
|
|
36
50
|
}>(),
|
|
37
51
|
{
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A panel that slides in from the right edge of the screen. Supports drag-to-dismiss from its left edge, or
|
|
4
|
+
* tapping the scrim.
|
|
5
|
+
*
|
|
6
|
+
* @slot header Replaces the default title text entirely — the close button stays
|
|
7
|
+
* @slot default Sheet body content (scrollable)
|
|
8
|
+
* @slot actions Footer action buttons, shown in a bordered strip below the content
|
|
9
|
+
* @event update:modelValue Emitted when the sheet closes (scrim click, drag-to-dismiss from the left edge, or
|
|
10
|
+
* the close button) — powers v-model
|
|
11
|
+
*/
|
|
2
12
|
import MIcon from './MIcon.vue'
|
|
3
13
|
import { useSheetMotion } from '../composables/_useSheetMotion'
|
|
4
14
|
|
|
5
15
|
withDefaults(defineProps<{
|
|
16
|
+
/** Open/closed state (v-model) */
|
|
6
17
|
modelValue: boolean
|
|
18
|
+
/** Sheet header title, ignored if the header slot is used */
|
|
7
19
|
title?: string
|
|
20
|
+
/** Tailwind width class for the panel (capped at max-w-[90vw]) */
|
|
8
21
|
width?: string
|
|
9
22
|
}>(), { width: 'w-80' })
|
|
10
23
|
|
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A bordered canvas that captures pointer strokes for signature capture. There's no v-model, since a signature
|
|
4
|
+
* isn't a simple value — read it out via events or the exposed methods.
|
|
5
|
+
*
|
|
6
|
+
* @event end Fires after a stroke ends, with a PNG data: URL of the canvas
|
|
7
|
+
* @event change Fires alongside end, and also after undo() — same data: URL payload
|
|
8
|
+
* @event begin Fires on the first pointerdown of a new stroke
|
|
9
|
+
*/
|
|
2
10
|
import { computed, onMounted, ref, watch } from 'vue'
|
|
3
11
|
|
|
4
12
|
const props = withDefaults(
|
|
5
13
|
defineProps<{
|
|
14
|
+
/** Canvas width in px */
|
|
6
15
|
width?: number
|
|
16
|
+
/** Canvas height in px */
|
|
7
17
|
height?: number
|
|
18
|
+
/** Stroke width */
|
|
8
19
|
lineWidth?: number
|
|
20
|
+
/** Stroke color */
|
|
9
21
|
color?: string
|
|
22
|
+
/** Canvas background color */
|
|
10
23
|
background?: string
|
|
24
|
+
/** Container border style */
|
|
11
25
|
variant?: 'filled' | 'outlined'
|
|
26
|
+
/** Disables drawing */
|
|
12
27
|
disabled?: boolean
|
|
13
28
|
}>(),
|
|
14
29
|
{
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A scroll-snap image carousel with three fixed-width layouts — hero (one protagonist item with peeking
|
|
4
|
+
* neighbors), multi-browse (several items at once, statically sized), and uncontained (variable-width items,
|
|
5
|
+
* optionally animated by scroll position). For the real M3 multi-browse carousel — where items continuously
|
|
6
|
+
* resize as you scroll instead of snapping between fixed widths — see MCarousel.
|
|
7
|
+
*
|
|
8
|
+
* @event change Fires with the new active item index whenever the track scrolls to a different closest item
|
|
9
|
+
*/
|
|
2
10
|
import { ref, computed, onMounted, onBeforeUnmount, watch, nextTick } from 'vue'
|
|
3
11
|
import MIcon from './MIcon.vue'
|
|
4
12
|
|
|
@@ -12,15 +20,25 @@ export interface SimpleCarouselItem {
|
|
|
12
20
|
|
|
13
21
|
const props = withDefaults(
|
|
14
22
|
defineProps<{
|
|
23
|
+
/** Slides to render — required */
|
|
15
24
|
items: SimpleCarouselItem[]
|
|
25
|
+
/** Carousel layout style */
|
|
16
26
|
layout?: 'hero' | 'multi-browse' | 'uncontained'
|
|
27
|
+
/** Track height */
|
|
17
28
|
height?: string
|
|
29
|
+
/** Show prev/next arrow buttons (fade in on hover) */
|
|
18
30
|
showArrows?: boolean
|
|
31
|
+
/** Show dot indicators below the track */
|
|
19
32
|
showIndicators?: boolean
|
|
33
|
+
/** Auto-advance slides — pauses while the pointer is over the carousel */
|
|
20
34
|
autoplay?: boolean
|
|
35
|
+
/** Autoplay interval in ms */
|
|
21
36
|
interval?: number
|
|
37
|
+
/** Gap between items in pixels */
|
|
22
38
|
gap?: number
|
|
39
|
+
/** Number of visible items (multi-browse layout only) */
|
|
23
40
|
visibleItems?: number
|
|
41
|
+
/** Dynamically grow the centered item and shrink the others while scrolling (uncontained layout only) */
|
|
24
42
|
animated?: boolean
|
|
25
43
|
}>(),
|
|
26
44
|
{
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A loading placeholder shape — text, circular, rectangular, or rounded — with pulse or wave animation.
|
|
4
|
+
*/
|
|
2
5
|
withDefaults(defineProps<{
|
|
6
|
+
/** Skeleton shape */
|
|
3
7
|
variant?: 'text' | 'circular' | 'rectangular' | 'rounded'
|
|
8
|
+
/** CSS width (defaults to 100%, or 40px for circular) */
|
|
4
9
|
width?: string
|
|
10
|
+
/** CSS height (defaults to 14px for text, 40px for circular, 100px otherwise) */
|
|
5
11
|
height?: string
|
|
12
|
+
/** Number of text lines (text variant only) — the last line renders at 60% width */
|
|
6
13
|
lines?: number
|
|
14
|
+
/** Animation style */
|
|
7
15
|
animation?: 'pulse' | 'wave' | 'none'
|
|
8
16
|
}>(), {
|
|
9
17
|
variant: 'text',
|