@rio-m3e/vue 0.6.3 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/README.md +99 -4
  2. package/dist/app-bar/AppBar.vue.d.ts +42 -0
  3. package/dist/app-bar/AppBar.vue.js +91 -0
  4. package/dist/badge/Badge.vue.d.ts +15 -0
  5. package/dist/badge/Badge.vue.js +28 -0
  6. package/dist/bottom-sheet/BottomSheet.vue.d.ts +34 -0
  7. package/dist/bottom-sheet/BottomSheet.vue.js +82 -0
  8. package/dist/browser/rio-vue.css +9130 -0
  9. package/dist/browser/rio-vue.global.js +600 -0
  10. package/dist/browser/rio-vue.js +600 -0
  11. package/dist/button/Button.vue.d.ts +1 -0
  12. package/dist/button/Button.vue.js +23 -2
  13. package/dist/button-group/ButtonGroup.vue.d.ts +6 -1
  14. package/dist/button-group/ButtonGroup.vue.js +27 -4
  15. package/dist/button-group/context.js +4 -2
  16. package/dist/card/Card.vue.d.ts +24 -0
  17. package/dist/card/Card.vue.js +44 -0
  18. package/dist/card/CardActions.vue.d.ts +14 -0
  19. package/dist/card/CardActions.vue.js +14 -0
  20. package/dist/card/CardContent.vue.d.ts +14 -0
  21. package/dist/card/CardContent.vue.js +14 -0
  22. package/dist/card/CardHeader.vue.d.ts +27 -0
  23. package/dist/card/CardHeader.vue.js +34 -0
  24. package/dist/card/CardMedia.vue.d.ts +14 -0
  25. package/dist/card/CardMedia.vue.js +14 -0
  26. package/dist/checkbox/Checkbox.vue.d.ts +1 -0
  27. package/dist/checkbox/Checkbox.vue.js +3 -0
  28. package/dist/chip/AssistChip.vue.d.ts +1 -0
  29. package/dist/chip/AssistChip.vue.js +3 -0
  30. package/dist/chip/ChipSet.vue.d.ts +1 -0
  31. package/dist/chip/ChipSet.vue.js +4 -1
  32. package/dist/chip/FilterChip.vue.d.ts +3 -2
  33. package/dist/chip/FilterChip.vue.js +3 -0
  34. package/dist/chip/InputChip.vue.d.ts +1 -0
  35. package/dist/chip/InputChip.vue.js +3 -0
  36. package/dist/chip/SuggestionChip.vue.d.ts +1 -0
  37. package/dist/chip/SuggestionChip.vue.js +3 -0
  38. package/dist/date-picker/DatePicker.vue.d.ts +16 -3
  39. package/dist/date-picker/DatePicker.vue.js +13 -4
  40. package/dist/date-picker/DatePickerCalendar.vue.js +1 -4
  41. package/dist/date-picker/DatePickerDialog.vue.d.ts +17 -3
  42. package/dist/date-picker/DatePickerDialog.vue.js +66 -22
  43. package/dist/date-picker/DateRangeCalendar.vue.js +17 -8
  44. package/dist/date-picker/DateRangePickerDialog.vue.d.ts +17 -3
  45. package/dist/date-picker/DateRangePickerDialog.vue.js +29 -16
  46. package/dist/dialog/Dialog.vue.d.ts +11 -2
  47. package/dist/dialog/Dialog.vue.js +35 -5
  48. package/dist/divider/Divider.vue.d.ts +5 -0
  49. package/dist/divider/Divider.vue.js +21 -0
  50. package/dist/fab/Fab.vue.d.ts +27 -0
  51. package/dist/fab/Fab.vue.js +70 -0
  52. package/dist/fab-menu/FabMenu.vue.d.ts +34 -0
  53. package/dist/fab-menu/FabMenu.vue.js +76 -0
  54. package/dist/fab-menu/FabMenuItem.vue.d.ts +22 -0
  55. package/dist/fab-menu/FabMenuItem.vue.js +29 -0
  56. package/dist/fab-menu/context.js +4 -0
  57. package/dist/icon-button/IconButton.vue.d.ts +1 -0
  58. package/dist/icon-button/IconButton.vue.js +23 -2
  59. package/dist/ime/composing.js +24 -0
  60. package/dist/index.d.ts +68 -40
  61. package/dist/index.js +68 -40
  62. package/dist/list/List.vue.d.ts +1 -0
  63. package/dist/list/List.vue.js +4 -1
  64. package/dist/list/ListItem.vue.d.ts +7 -1
  65. package/dist/list/ListItem.vue.js +4 -1
  66. package/dist/loading-indicator/LoadingIndicator.vue.d.ts +1 -0
  67. package/dist/loading-indicator/LoadingIndicator.vue.js +4 -1
  68. package/dist/menu/Menu.vue.d.ts +2 -2
  69. package/dist/menu/Menu.vue.js +11 -2
  70. package/dist/navigation-bar/NavigationBar.vue.d.ts +31 -0
  71. package/dist/navigation-bar/NavigationBar.vue.js +63 -0
  72. package/dist/navigation-bar/NavigationBarItem.vue.d.ts +40 -0
  73. package/dist/navigation-bar/NavigationBarItem.vue.js +84 -0
  74. package/dist/navigation-bar/context.js +3 -0
  75. package/dist/navigation-rail/NavigationRail.vue.d.ts +46 -0
  76. package/dist/navigation-rail/NavigationRail.vue.js +112 -0
  77. package/dist/navigation-rail/NavigationRailItem.vue.d.ts +41 -0
  78. package/dist/navigation-rail/NavigationRailItem.vue.js +85 -0
  79. package/dist/navigation-rail/NavigationRailSection.vue.d.ts +17 -0
  80. package/dist/navigation-rail/NavigationRailSection.vue.js +20 -0
  81. package/dist/navigation-rail/context.js +3 -0
  82. package/dist/overflow/OverflowItem.vue.d.ts +16 -0
  83. package/dist/overflow/OverflowItem.vue.js +24 -0
  84. package/dist/overflow/OverflowMenu.vue.js +94 -0
  85. package/dist/overflow/overflow.js +79 -0
  86. package/dist/progress/CircularProgress.vue.d.ts +1 -0
  87. package/dist/progress/CircularProgress.vue.js +5 -2
  88. package/dist/progress/LinearProgress.vue.d.ts +1 -0
  89. package/dist/progress/LinearProgress.vue.js +5 -2
  90. package/dist/radio/Radio.vue.d.ts +1 -0
  91. package/dist/radio/Radio.vue.js +4 -1
  92. package/dist/radio/RadioGroup.vue.d.ts +1 -0
  93. package/dist/radio/RadioGroup.vue.js +10 -2
  94. package/dist/scroll-field/ScrollField.vue.d.ts +1 -0
  95. package/dist/scroll-field/ScrollField.vue.js +3 -0
  96. package/dist/search/Search.vue.d.ts +58 -0
  97. package/dist/search/Search.vue.js +161 -0
  98. package/dist/select/AfterOptions.vue.js +11 -0
  99. package/dist/select/Select.vue.d.ts +5 -4
  100. package/dist/select/Select.vue.js +41 -31
  101. package/dist/select/SelectOption.vue.d.ts +4 -1
  102. package/dist/select/SelectOption.vue.js +8 -5
  103. package/dist/side-sheet/SideSheet.vue.d.ts +43 -0
  104. package/dist/side-sheet/SideSheet.vue.js +103 -0
  105. package/dist/slider/RangeSlider.vue.d.ts +1 -0
  106. package/dist/slider/RangeSlider.vue.js +3 -0
  107. package/dist/slider/Slider.vue.d.ts +1 -0
  108. package/dist/slider/Slider.vue.js +3 -0
  109. package/dist/snackbar/Snackbar.vue.d.ts +31 -0
  110. package/dist/snackbar/Snackbar.vue.js +48 -0
  111. package/dist/snackbar/SnackbarHost.vue.d.ts +40 -0
  112. package/dist/snackbar/SnackbarHost.vue.js +110 -0
  113. package/dist/snackbar/snackbar.d.ts +16 -0
  114. package/dist/snackbar/snackbar.js +11 -0
  115. package/dist/split-button/SplitButton.vue.d.ts +3 -2
  116. package/dist/split-button/SplitButton.vue.js +3 -0
  117. package/dist/switch/Switch.vue.d.ts +1 -0
  118. package/dist/switch/Switch.vue.js +3 -0
  119. package/dist/tabs/Tab.vue.d.ts +19 -0
  120. package/dist/tabs/Tab.vue.js +66 -0
  121. package/dist/tabs/TabGroup.vue.d.ts +22 -0
  122. package/dist/tabs/TabGroup.vue.js +25 -0
  123. package/dist/tabs/TabPanel.vue.d.ts +15 -0
  124. package/dist/tabs/TabPanel.vue.js +20 -0
  125. package/dist/tabs/Tabs.vue.d.ts +32 -0
  126. package/dist/tabs/Tabs.vue.js +95 -0
  127. package/dist/tabs/context.js +5 -0
  128. package/dist/text-field/TextField.vue.d.ts +8 -2
  129. package/dist/text-field/TextField.vue.js +91 -47
  130. package/dist/time-picker/TimeInput.vue.d.ts +7 -1
  131. package/dist/time-picker/TimeInput.vue.js +5 -2
  132. package/dist/time-picker/TimePickerDialog.vue.d.ts +9 -3
  133. package/dist/time-picker/TimePickerDialog.vue.js +5 -2
  134. package/dist/time-picker/TimeScroll.vue.d.ts +7 -1
  135. package/dist/time-picker/TimeScroll.vue.js +5 -2
  136. package/dist/toolbar/FabPlace.vue.js +14 -0
  137. package/dist/toolbar/Toolbar.vue.d.ts +34 -0
  138. package/dist/toolbar/Toolbar.vue.js +115 -0
  139. package/dist/toolbar/context.js +3 -0
  140. package/package.json +6 -4
@@ -1,6 +1,7 @@
1
1
  import { useLocale, useMessages } from "../locale/locale.js";
2
2
  import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, toDisplayString, unref, useModel, useTemplateRef } from "vue";
3
3
  import { attachSlider, createRangeSlider } from "@rio-m3e/core";
4
+ import "@rio-m3e/styles/base/accent.css";
4
5
  import "@rio-m3e/styles/base/focus-ring.css";
5
6
  import "@rio-m3e/styles/base/reduced-motion.css";
6
7
  import "@rio-m3e/styles/base/direction.css";
@@ -19,6 +20,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
19
20
  valueIndicator: { type: Boolean },
20
21
  format: { type: Function },
21
22
  locale: {},
23
+ color: {},
22
24
  disabled: { type: Boolean },
23
25
  softDisabled: { type: Boolean },
24
26
  modelValue: {},
@@ -44,6 +46,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
44
46
  locale: locale.value,
45
47
  disabled: props.disabled,
46
48
  softDisabled: props.softDisabled,
49
+ color: props.color,
47
50
  name: props.name
48
51
  }),
49
52
  messages: () => messages.value,
@@ -1,4 +1,5 @@
1
1
  import { SliderProps } from "@rio-m3e/core";
2
+ import "@rio-m3e/styles/base/accent.css";
2
3
  import "@rio-m3e/styles/base/focus-ring.css";
3
4
  import "@rio-m3e/styles/base/reduced-motion.css";
4
5
  import "@rio-m3e/styles/base/direction.css";
@@ -1,6 +1,7 @@
1
1
  import { useLocale } from "../locale/locale.js";
2
2
  import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, ref, renderSlot, toDisplayString, unref, useModel, useSlots, useTemplateRef } from "vue";
3
3
  import { attachSlider, createSlider, mergePartAttrs } from "@rio-m3e/core";
4
+ import "@rio-m3e/styles/base/accent.css";
4
5
  import "@rio-m3e/styles/base/focus-ring.css";
5
6
  import "@rio-m3e/styles/base/reduced-motion.css";
6
7
  import "@rio-m3e/styles/base/direction.css";
@@ -20,6 +21,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
20
21
  valueIndicator: { type: Boolean },
21
22
  format: { type: Function },
22
23
  locale: {},
24
+ color: {},
23
25
  disabled: { type: Boolean },
24
26
  softDisabled: { type: Boolean },
25
27
  modelValue: {}
@@ -45,6 +47,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
45
47
  locale: locale.value,
46
48
  disabled: props.disabled,
47
49
  softDisabled: props.softDisabled,
50
+ color: props.color,
48
51
  centered: props.centered
49
52
  }),
50
53
  content: () => ({ icon: !!slots.icon }),
@@ -0,0 +1,31 @@
1
+ import { SnackbarMessages, SnackbarProps } from "@rio-m3e/core";
2
+ import "@rio-m3e/styles/snackbar.css";
3
+ interface Props extends SnackbarProps {
4
+ /** The message. The default slot takes richer content instead. */
5
+ message?: string;
6
+ /** A language tag, for the close button's name. Without it, the one provided, or the page's. */
7
+ locale?: string;
8
+ /** Replaces the close button's name. */
9
+ messages?: Partial<SnackbarMessages>;
10
+ }
11
+ type __VLS_Slots = {
12
+ /** The message, in place of the `message` prop */
13
+ default?: () => unknown;
14
+ /** The close button's icon, in place of the one the app registered (`close`) */
15
+ 'close-icon'?: () => unknown;
16
+ };
17
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ action: () => any;
19
+ dismiss: () => any;
20
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
21
+ onAction?: (() => any) | undefined;
22
+ onDismiss?: (() => any) | undefined;
23
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
25
+ declare const _default: typeof __VLS_export;
26
+ type __VLS_WithSlots<T, S> = T & {
27
+ new (): {
28
+ $slots: S;
29
+ };
30
+ };
31
+ export { _default as default };
@@ -0,0 +1,48 @@
1
+ import _sfc_main$1 from "../button/Button.vue.js";
2
+ import _sfc_main$2 from "../icon-button/IconButton.vue.js";
3
+ import _sfc_main$3 from "../icon/Icon.vue.js";
4
+ import { useLocale, useMessages } from "../locale/locale.js";
5
+ import { createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
6
+ import { createSnackbar } from "@rio-m3e/core";
7
+ import "@rio-m3e/styles/snackbar.css";
8
+ // src/snackbar/Snackbar.vue
9
+ const _sfc_main = /*@__PURE__*/ defineComponent({
10
+ __name: "Snackbar",
11
+ props: {
12
+ message: {},
13
+ locale: {},
14
+ messages: {},
15
+ action: {},
16
+ dismissible: { type: Boolean },
17
+ actionOnNewLine: { type: Boolean }
18
+ },
19
+ emits: ["action", "dismiss"],
20
+ setup(__props, { emit: __emit }) {
21
+ const emit = __emit;
22
+ const text = useMessages("snackbar", useLocale(() => __props.locale), () => __props.messages);
23
+ const snackbar = createSnackbar({ props: () => ({
24
+ action: __props.action,
25
+ dismissible: __props.dismissible,
26
+ actionOnNewLine: __props.actionOnNewLine
27
+ }) });
28
+ return (_ctx, _cache) => {
29
+ return openBlock(), createElementBlock("div", normalizeProps(guardReactiveProps(unref(snackbar).parts.root())), [createElementVNode("div", normalizeProps(guardReactiveProps(unref(snackbar).parts.supportingText())), [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.message), 1)])], 16), unref(snackbar).showsActions() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(snackbar).parts.actions())), [unref(snackbar).showsAction() ? (openBlock(), createBlock(_sfc_main$1, {
30
+ key: 0,
31
+ variant: "text",
32
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("action"))
33
+ }, {
34
+ default: withCtx(() => [createTextVNode(toDisplayString(__props.action), 1)]),
35
+ _: 1
36
+ })) : createCommentVNode("v-if", true), unref(snackbar).showsDismiss() ? (openBlock(), createBlock(_sfc_main$2, {
37
+ key: 1,
38
+ label: unref(text).dismiss,
39
+ variant: "standard",
40
+ onClick: _cache[1] || (_cache[1] = ($event) => emit("dismiss"))
41
+ }, {
42
+ default: withCtx(() => [renderSlot(_ctx.$slots, "close-icon", {}, () => [createVNode(_sfc_main$3, { alias: "close" })])]),
43
+ _: 3
44
+ }, 8, ["label"])) : createCommentVNode("v-if", true)], 16)) : createCommentVNode("v-if", true)], 16);
45
+ };
46
+ }
47
+ });
48
+ export { _sfc_main as default };
@@ -0,0 +1,40 @@
1
+ import { SnackbarController } from "./snackbar.js";
2
+ import { ComponentPublicInstance } from "vue";
3
+ import { SnackbarEntry, SnackbarHostProps, SnackbarMessages } from "@rio-m3e/core";
4
+ import "@rio-m3e/styles/base/reduced-motion.css";
5
+ import "@rio-m3e/styles/snackbar.css";
6
+ interface Props extends Omit<SnackbarHostProps, 'anchor'> {
7
+ /**
8
+ * What else the snackbar keeps clear of, besides Rio's FABs, toolbars, and navigation bars: an
9
+ * element, a component's template ref, or a selector for some.
10
+ */
11
+ anchor?: string | Element | ComponentPublicInstance | null;
12
+ /** A language tag, for the close button's name. Without it, the one provided, or the page's. */
13
+ locale?: string;
14
+ /** Replaces the close button's name. */
15
+ messages?: Partial<SnackbarMessages>;
16
+ }
17
+ type __VLS_Slots = {
18
+ /** The app's content: `useSnackbar()` inside it shows snackbars here. */
19
+ default?: () => unknown;
20
+ /**
21
+ * The snackbar, in place of a `RioSnackbar` with the request's message and buttons: a
22
+ * `RioSnackbar` of the app's own, with `action` and `dismiss` on its buttons.
23
+ */
24
+ snackbar?: (props: {
25
+ snackbar: SnackbarEntry;
26
+ /** Ends the snackbar with its action. */
27
+ action: () => void;
28
+ /** Ends the snackbar, dismissed. */
29
+ dismiss: () => void;
30
+ }) => unknown;
31
+ };
32
+ declare const __VLS_base: import("vue").DefineComponent<Props, SnackbarController, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
34
+ declare const _default: typeof __VLS_export;
35
+ type __VLS_WithSlots<T, S> = T & {
36
+ new (): {
37
+ $slots: S;
38
+ };
39
+ };
40
+ export { _default as default };
@@ -0,0 +1,110 @@
1
+ import { keepPresses } from "../overlay/presses.js";
2
+ import _sfc_main$1 from "./Snackbar.vue.js";
3
+ import { snackbarKey } from "./snackbar.js";
4
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, provide, ref, renderSlot, toDisplayString, toHandlers, unref, useTemplateRef, watch } from "vue";
5
+ import { attachSnackbarHost, createSnackbarHost, createSnackbarQueue, mergePartAttrs } from "@rio-m3e/core";
6
+ import "@rio-m3e/styles/base/reduced-motion.css";
7
+ import "@rio-m3e/styles/snackbar.css";
8
+ // src/snackbar/SnackbarHost.vue
9
+ const _sfc_main = /*@__PURE__*/ defineComponent({
10
+ inheritAttrs: false,
11
+ __name: "SnackbarHost",
12
+ props: {
13
+ anchor: {},
14
+ locale: {},
15
+ messages: {},
16
+ align: {},
17
+ offset: {},
18
+ shortcut: {}
19
+ },
20
+ setup(__props, { expose: __expose }) {
21
+ /** How far the snackbar is moved to clear what stays put on the screen, as core reports it */
22
+ const clearance = ref({
23
+ lift: 0,
24
+ start: 0,
25
+ end: 0
26
+ });
27
+ /** What the status region holds, as core gives it */
28
+ const announcement = ref("");
29
+ const host = createSnackbarHost({
30
+ props: () => ({
31
+ align: __props.align,
32
+ offset: __props.offset,
33
+ anchor: __props.anchor && typeof __props.anchor === "object" && "$el" in __props.anchor ? __props.anchor.$el : __props.anchor,
34
+ shortcut: __props.shortcut
35
+ }),
36
+ clearance: () => clearance.value
37
+ });
38
+ const changes = ref(0);
39
+ const queue = createSnackbarQueue({ onChange: () => changes.value++ });
40
+ const current = computed(() => {
41
+ changes.value;
42
+ return queue.current();
43
+ });
44
+ const action = () => queue.end("action");
45
+ const dismiss = () => queue.end("dismissed");
46
+ const controller = {
47
+ show: queue.show,
48
+ dismiss
49
+ };
50
+ provide(snackbarKey, controller);
51
+ __expose(controller);
52
+ const root = useTemplateRef("root");
53
+ let handle;
54
+ onMounted(() => {
55
+ handle = attachSnackbarHost(root.value, {
56
+ queue,
57
+ placement: host.placement,
58
+ onClearanceChange: (next) => clearance.value = next,
59
+ onAnnounce: (message) => announcement.value = message,
60
+ shortcut: () => __props.shortcut
61
+ });
62
+ handle.sync();
63
+ });
64
+ watch(changes, () => handle?.sync(), { flush: "post" });
65
+ onUpdated(() => handle?.update());
66
+ onBeforeUnmount(() => {
67
+ handle?.detach();
68
+ queue.clear();
69
+ });
70
+ return (_ctx, _cache) => {
71
+ return openBlock(), createElementBlock(Fragment, null, [
72
+ renderSlot(_ctx.$slots, "default"),
73
+ createElementVNode("div", normalizeProps(guardReactiveProps(unref(host).parts.live())), toDisplayString(announcement.value), 17),
74
+ createElementVNode("div", mergeProps({
75
+ ref_key: "root",
76
+ ref: root
77
+ }, unref(mergePartAttrs)({
78
+ ..._ctx.$attrs,
79
+ class: void 0,
80
+ style: void 0
81
+ }, unref(host).parts.root()), {
82
+ class: _ctx.$attrs.class,
83
+ style: _ctx.$attrs.style
84
+ }, toHandlers(unref(keepPresses), true)), [current.value ? renderSlot(_ctx.$slots, "snackbar", {
85
+ snackbar: current.value,
86
+ action,
87
+ dismiss
88
+ }, () => [(openBlock(), createBlock(_sfc_main$1, {
89
+ key: current.value.id,
90
+ message: current.value.message,
91
+ action: current.value.action,
92
+ dismissible: current.value.dismissible,
93
+ "action-on-new-line": current.value.actionOnNewLine,
94
+ locale: __props.locale,
95
+ messages: __props.messages,
96
+ onAction: action,
97
+ onDismiss: dismiss
98
+ }, null, 8, [
99
+ "message",
100
+ "action",
101
+ "dismissible",
102
+ "action-on-new-line",
103
+ "locale",
104
+ "messages"
105
+ ]))], void 0, 0) : createCommentVNode("v-if", true)], 16)
106
+ ], 64);
107
+ };
108
+ }
109
+ });
110
+ export { _sfc_main as default };
@@ -0,0 +1,16 @@
1
+ import { InjectionKey } from "vue";
2
+ import { SnackbarRequest, SnackbarResult } from "@rio-m3e/core";
3
+ /** Shows snackbars in the nearest `RioSnackbarHost` around the component. */
4
+ export interface SnackbarController {
5
+ /**
6
+ * Queues a snackbar: the host shows one at a time, in the order asked. The promise settles as it
7
+ * ends: `'action'` when its action was pressed, `'dismissed'` otherwise.
8
+ */
9
+ show(request: SnackbarRequest): Promise<SnackbarResult>;
10
+ /** Dismisses the snackbar on the screen, or the one about to show. */
11
+ dismiss(): void;
12
+ }
13
+ /** What `RioSnackbarHost` provides to the components inside it */
14
+ export declare const snackbarKey: InjectionKey<SnackbarController>;
15
+ /** The nearest `RioSnackbarHost`'s snackbars. Call it in `setup`, inside a host. */
16
+ export declare function useSnackbar(): SnackbarController;
@@ -0,0 +1,11 @@
1
+ import { inject } from "vue";
2
+ // src/snackbar/snackbar.ts
3
+ /** What `RioSnackbarHost` provides to the components inside it */
4
+ const snackbarKey = Symbol("RioSnackbar");
5
+ /** The nearest `RioSnackbarHost`'s snackbars. Call it in `setup`, inside a host. */
6
+ function useSnackbar() {
7
+ const controller = inject(snackbarKey, void 0);
8
+ if (!controller) throw new Error("useSnackbar() needs a RioSnackbarHost around the component.");
9
+ return controller;
10
+ }
11
+ export { snackbarKey, useSnackbar };
@@ -1,4 +1,5 @@
1
1
  import { SplitButtonProps } from "@rio-m3e/core";
2
+ import "@rio-m3e/styles/base/accent.css";
2
3
  import "@rio-m3e/styles/base/focus-ring.css";
3
4
  import "@rio-m3e/styles/base/reduced-motion.css";
4
5
  import "@rio-m3e/styles/base/state-layer.css";
@@ -22,11 +23,11 @@ declare const __VLS_base: import("vue").DefineComponent<SplitButtonProps, {
22
23
  leading: Readonly<import("vue").ShallowRef<HTMLButtonElement | null>>;
23
24
  trailing: Readonly<import("vue").ShallowRef<HTMLButtonElement | null>>;
24
25
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
- click: (event: MouseEvent) => any;
26
26
  "update:open": (open: boolean) => any;
27
+ click: (event: MouseEvent) => any;
27
28
  }, string, import("vue").PublicProps, Readonly<SplitButtonProps> & Readonly<{
28
- onClick?: ((event: MouseEvent) => any) | undefined;
29
29
  "onUpdate:open"?: ((open: boolean) => any) | undefined;
30
+ onClick?: ((event: MouseEvent) => any) | undefined;
30
31
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
32
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
32
33
  declare const _default: typeof __VLS_export;
@@ -3,6 +3,7 @@ import { vCornerMorph } from "../corner-morph/corner-morph.js";
3
3
  import _sfc_main$1 from "../icon/Icon.vue.js";
4
4
  import { createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, onBeforeUnmount, onMounted, openBlock, renderSlot, unref, useSlots, useTemplateRef, withDirectives } from "vue";
5
5
  import { attachSplitButtonMenuIcon, createSplitButton } from "@rio-m3e/core";
6
+ import "@rio-m3e/styles/base/accent.css";
6
7
  import "@rio-m3e/styles/base/focus-ring.css";
7
8
  import "@rio-m3e/styles/base/reduced-motion.css";
8
9
  import "@rio-m3e/styles/base/state-layer.css";
@@ -18,6 +19,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
18
19
  label: {},
19
20
  variant: {},
20
21
  size: {},
22
+ color: {},
21
23
  open: { type: Boolean },
22
24
  popup: {},
23
25
  disabled: { type: Boolean },
@@ -34,6 +36,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
34
36
  label: __props.label,
35
37
  variant: __props.variant,
36
38
  size: __props.size,
39
+ color: __props.color,
37
40
  open: __props.open,
38
41
  popup: __props.popup,
39
42
  disabled: __props.disabled,
@@ -1,4 +1,5 @@
1
1
  import { SwitchProps } from "@rio-m3e/core";
2
+ import "@rio-m3e/styles/base/accent.css";
2
3
  import "@rio-m3e/styles/base/focus-ring.css";
3
4
  import "@rio-m3e/styles/base/reduced-motion.css";
4
5
  import "@rio-m3e/styles/base/ripple.css";
@@ -1,6 +1,7 @@
1
1
  import { useRipple } from "../ripple/ripple.js";
2
2
  import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, renderSlot, unref, useSlots, useTemplateRef } from "vue";
3
3
  import { attachCheckable, attachSwitchHandle, createSwitch, mergePartAttrs } from "@rio-m3e/core";
4
+ import "@rio-m3e/styles/base/accent.css";
4
5
  import "@rio-m3e/styles/base/focus-ring.css";
5
6
  import "@rio-m3e/styles/base/reduced-motion.css";
6
7
  import "@rio-m3e/styles/base/ripple.css";
@@ -11,6 +12,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
11
12
  __name: "Switch",
12
13
  props: {
13
14
  selected: { type: Boolean },
15
+ color: {},
14
16
  disabled: { type: Boolean },
15
17
  softDisabled: { type: Boolean }
16
18
  },
@@ -25,6 +27,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
25
27
  const sw = createSwitch({
26
28
  props: () => ({
27
29
  selected: __props.selected,
30
+ color: __props.color,
28
31
  disabled: __props.disabled,
29
32
  softDisabled: __props.softDisabled
30
33
  }),
@@ -0,0 +1,19 @@
1
+ import { TabProps } from "@rio-m3e/core";
2
+ import "@rio-m3e/styles/base/focus-ring.css";
3
+ import "@rio-m3e/styles/base/reduced-motion.css";
4
+ import "@rio-m3e/styles/base/state-layer.css";
5
+ import "@rio-m3e/styles/tabs.css";
6
+ type __VLS_Props = Omit<TabProps, 'locale'>;
7
+ type __VLS_Slots = {
8
+ /** The icon: over the label in primary tabs, beside it in secondary ones, or alone */
9
+ default?: () => unknown;
10
+ };
11
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
+ declare const _default: typeof __VLS_export;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
19
+ export { _default as default };
@@ -0,0 +1,66 @@
1
+ import _sfc_main$1 from "../badge/Badge.vue.js";
2
+ import { useLocale, useMessages } from "../locale/locale.js";
3
+ import { vRipple } from "../ripple/ripple.js";
4
+ import { tabsKey } from "./context.js";
5
+ import { createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, inject, mergeProps, normalizeProps, onBeforeUnmount, openBlock, renderSlot, toDisplayString, unref, useSlots, useTemplateRef, withCtx, withDirectives } from "vue";
6
+ import { createTab } from "@rio-m3e/core";
7
+ import "@rio-m3e/styles/base/focus-ring.css";
8
+ import "@rio-m3e/styles/base/reduced-motion.css";
9
+ import "@rio-m3e/styles/base/state-layer.css";
10
+ import "@rio-m3e/styles/tabs.css";
11
+ // src/tabs/Tab.vue
12
+ const _sfc_main = /*@__PURE__*/ defineComponent({
13
+ __name: "Tab",
14
+ props: {
15
+ value: {},
16
+ label: {},
17
+ badge: { type: [
18
+ Boolean,
19
+ Number,
20
+ String
21
+ ] }
22
+ },
23
+ setup(__props) {
24
+ const props = __props;
25
+ const slots = useSlots();
26
+ const tabs = inject(tabsKey, void 0);
27
+ const locale = tabs?.locale ?? useLocale(() => void 0);
28
+ const messages = tabs?.messages ?? useMessages("tabs", locale, () => void 0);
29
+ const tab = createTab({
30
+ props: () => ({
31
+ value: props.value,
32
+ label: props.label,
33
+ badge: props.badge,
34
+ locale: locale.value
35
+ }),
36
+ tabs: () => tabs,
37
+ content: () => ({ icon: !!slots.default }),
38
+ messages: () => messages.value
39
+ });
40
+ const root = useTemplateRef("root");
41
+ const unregister = tabs?.register(() => props.value, () => root.value);
42
+ onBeforeUnmount(() => unregister?.());
43
+ return (_ctx, _cache) => {
44
+ return withDirectives((openBlock(), createElementBlock("button", mergeProps({
45
+ ref_key: "root",
46
+ ref: root
47
+ }, unref(tab).parts.root(), { onClick: _cache[0] || (_cache[0] = (...args) => unref(tab).handleClick && unref(tab).handleClick(...args)) }), [createElementVNode("span", normalizeProps(guardReactiveProps(unref(tab).parts.content())), [
48
+ unref(tab).showsIcon() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(tab).parts.icon())), [unref(tab).badgeOnIcon() ? (openBlock(), createBlock(_sfc_main$1, {
49
+ key: 0,
50
+ value: unref(tab).badgeValue(),
51
+ locale: unref(locale)
52
+ }, {
53
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
54
+ _: 3
55
+ }, 8, ["value", "locale"])) : renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 1)], 16)) : createCommentVNode("v-if", true),
56
+ createElementVNode("span", normalizeProps(guardReactiveProps(unref(tab).parts.label())), toDisplayString(__props.label), 17),
57
+ unref(tab).showsInlineBadge() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 1 }, unref(tab).parts.badge())), [createVNode(_sfc_main$1, {
58
+ value: unref(tab).badgeValue(),
59
+ locale: unref(locale)
60
+ }, null, 8, ["value", "locale"])], 16)) : createCommentVNode("v-if", true),
61
+ createElementVNode("span", normalizeProps(guardReactiveProps(unref(tab).parts.indicator())), null, 16)
62
+ ], 16)], 16)), [[unref(vRipple)]]);
63
+ };
64
+ }
65
+ });
66
+ export { _sfc_main as default };
@@ -0,0 +1,22 @@
1
+ import { TabValue } from "@rio-m3e/core";
2
+ type __VLS_Slots = {
3
+ /** A `RioTabs` and its `RioTabPanel`s, wherever they sit inside */
4
+ default?: () => unknown;
5
+ };
6
+ type __VLS_ModelProps = {
7
+ /** The selected tab's value, with `v-model`, for the tab list and the panels inside the group */
8
+ modelValue?: TabValue | undefined;
9
+ };
10
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ "update:modelValue": (value: TabValue | undefined) => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
13
+ "onUpdate:modelValue"?: ((value: TabValue | undefined) => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ type __VLS_WithSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
22
+ export { _default as default };
@@ -0,0 +1,25 @@
1
+ import { tabGroupKey } from "./context.js";
2
+ import { defineComponent, provide, renderSlot, useId, useModel } from "vue";
3
+ import { createTabGroup } from "@rio-m3e/core";
4
+ // src/tabs/TabGroup.vue
5
+ /** The selected tab's value, with `v-model`, for the tab list and the panels inside the group */
6
+ const _sfc_main = /*@__PURE__*/ defineComponent({
7
+ __name: "TabGroup",
8
+ props: {
9
+ "modelValue": {},
10
+ "modelModifiers": {}
11
+ },
12
+ emits: ["update:modelValue"],
13
+ setup(__props) {
14
+ const model = useModel(__props, "modelValue");
15
+ provide(tabGroupKey, createTabGroup({
16
+ props: () => ({ selected: model.value }),
17
+ onChange: (next) => model.value = next,
18
+ id: useId()
19
+ }));
20
+ return (_ctx, _cache) => {
21
+ return renderSlot(_ctx.$slots, "default");
22
+ };
23
+ }
24
+ });
25
+ export { _sfc_main as default };
@@ -0,0 +1,15 @@
1
+ import { TabPanelProps } from "@rio-m3e/core";
2
+ import "@rio-m3e/styles/base/focus-ring.css";
3
+ type __VLS_Slots = {
4
+ /** The content, shown while its tab is selected */
5
+ default?: () => unknown;
6
+ };
7
+ declare const __VLS_base: import("vue").DefineComponent<TabPanelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TabPanelProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
+ declare const _default: typeof __VLS_export;
10
+ type __VLS_WithSlots<T, S> = T & {
11
+ new (): {
12
+ $slots: S;
13
+ };
14
+ };
15
+ export { _default as default };
@@ -0,0 +1,20 @@
1
+ import { tabGroupKey } from "./context.js";
2
+ import { createElementBlock, defineComponent, guardReactiveProps, inject, normalizeProps, openBlock, renderSlot, unref } from "vue";
3
+ import { createTabPanel } from "@rio-m3e/core";
4
+ import "@rio-m3e/styles/base/focus-ring.css";
5
+ // src/tabs/TabPanel.vue
6
+ const _sfc_main = /*@__PURE__*/ defineComponent({
7
+ __name: "TabPanel",
8
+ props: { value: {} },
9
+ setup(__props) {
10
+ const group = inject(tabGroupKey, void 0);
11
+ const panel = createTabPanel({
12
+ props: () => ({ value: __props.value }),
13
+ group: () => group
14
+ });
15
+ return (_ctx, _cache) => {
16
+ return openBlock(), createElementBlock("div", normalizeProps(guardReactiveProps(unref(panel).parts.root())), [renderSlot(_ctx.$slots, "default")], 16);
17
+ };
18
+ }
19
+ });
20
+ export { _sfc_main as default };
@@ -0,0 +1,32 @@
1
+ import { TabValue, TabsMessages, TabsProps } from "@rio-m3e/core";
2
+ import "@rio-m3e/styles/base/reduced-motion.css";
3
+ import "@rio-m3e/styles/tabs.css";
4
+ interface Props extends Omit<TabsProps, 'selected'> {
5
+ /** A language tag, for badges' counts. Without it, the one provided, or the page's. */
6
+ locale?: string;
7
+ /** Replaces what a small badge says. */
8
+ messages?: Partial<TabsMessages>;
9
+ }
10
+ type __VLS_Props = Props;
11
+ type __VLS_Slots = {
12
+ /** The tabs (`RioTab`) */
13
+ default?: () => unknown;
14
+ };
15
+ type __VLS_ModelProps = {
16
+ /** The selected tab's value, with `v-model`, for a tab list outside a `RioTabGroup` */
17
+ modelValue?: TabValue | undefined;
18
+ };
19
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
20
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
+ "update:modelValue": (value: TabValue | undefined) => any;
22
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
23
+ "onUpdate:modelValue"?: ((value: TabValue | undefined) => any) | undefined;
24
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
26
+ declare const _default: typeof __VLS_export;
27
+ type __VLS_WithSlots<T, S> = T & {
28
+ new (): {
29
+ $slots: S;
30
+ };
31
+ };
32
+ export { _default as default };