@rio-m3e/vue 0.6.3 → 0.8.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 (147) 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 +93 -0
  4. package/dist/app-bar/context.js +3 -0
  5. package/dist/badge/Badge.vue.d.ts +15 -0
  6. package/dist/badge/Badge.vue.js +28 -0
  7. package/dist/bottom-sheet/BottomSheet.vue.d.ts +34 -0
  8. package/dist/bottom-sheet/BottomSheet.vue.js +82 -0
  9. package/dist/browser/rio-vue.css +9418 -0
  10. package/dist/browser/rio-vue.global.js +600 -0
  11. package/dist/browser/rio-vue.js +600 -0
  12. package/dist/button/Button.vue.d.ts +1 -0
  13. package/dist/button/Button.vue.js +23 -2
  14. package/dist/button-group/ButtonGroup.vue.d.ts +6 -1
  15. package/dist/button-group/ButtonGroup.vue.js +27 -4
  16. package/dist/button-group/context.js +4 -2
  17. package/dist/card/Card.vue.d.ts +24 -0
  18. package/dist/card/Card.vue.js +44 -0
  19. package/dist/card/CardActions.vue.d.ts +14 -0
  20. package/dist/card/CardActions.vue.js +14 -0
  21. package/dist/card/CardContent.vue.d.ts +14 -0
  22. package/dist/card/CardContent.vue.js +14 -0
  23. package/dist/card/CardHeader.vue.d.ts +27 -0
  24. package/dist/card/CardHeader.vue.js +34 -0
  25. package/dist/card/CardMedia.vue.d.ts +14 -0
  26. package/dist/card/CardMedia.vue.js +14 -0
  27. package/dist/checkbox/Checkbox.vue.d.ts +2 -0
  28. package/dist/checkbox/Checkbox.vue.js +6 -0
  29. package/dist/chip/AssistChip.vue.d.ts +2 -0
  30. package/dist/chip/AssistChip.vue.js +6 -0
  31. package/dist/chip/ChipSet.vue.d.ts +2 -0
  32. package/dist/chip/ChipSet.vue.js +7 -1
  33. package/dist/chip/FilterChip.vue.d.ts +22 -5
  34. package/dist/chip/FilterChip.vue.js +57 -8
  35. package/dist/chip/InputChip.vue.d.ts +2 -0
  36. package/dist/chip/InputChip.vue.js +6 -0
  37. package/dist/chip/SuggestionChip.vue.d.ts +2 -0
  38. package/dist/chip/SuggestionChip.vue.js +6 -0
  39. package/dist/date-picker/DatePicker.vue.d.ts +16 -3
  40. package/dist/date-picker/DatePicker.vue.js +13 -4
  41. package/dist/date-picker/DatePickerCalendar.vue.js +1 -4
  42. package/dist/date-picker/DatePickerDialog.vue.d.ts +17 -3
  43. package/dist/date-picker/DatePickerDialog.vue.js +66 -22
  44. package/dist/date-picker/DateRangeCalendar.vue.js +17 -8
  45. package/dist/date-picker/DateRangePickerDialog.vue.d.ts +17 -3
  46. package/dist/date-picker/DateRangePickerDialog.vue.js +29 -16
  47. package/dist/dialog/Dialog.vue.d.ts +11 -2
  48. package/dist/dialog/Dialog.vue.js +35 -5
  49. package/dist/divider/Divider.vue.d.ts +5 -0
  50. package/dist/divider/Divider.vue.js +21 -0
  51. package/dist/fab/Fab.vue.d.ts +27 -0
  52. package/dist/fab/Fab.vue.js +70 -0
  53. package/dist/fab-menu/FabMenu.vue.d.ts +34 -0
  54. package/dist/fab-menu/FabMenu.vue.js +76 -0
  55. package/dist/fab-menu/FabMenuItem.vue.d.ts +22 -0
  56. package/dist/fab-menu/FabMenuItem.vue.js +29 -0
  57. package/dist/fab-menu/context.js +4 -0
  58. package/dist/icon-button/IconButton.vue.d.ts +2 -0
  59. package/dist/icon-button/IconButton.vue.js +26 -2
  60. package/dist/ime/composing.js +24 -0
  61. package/dist/index.d.ts +70 -40
  62. package/dist/index.js +70 -40
  63. package/dist/list/List.vue.d.ts +1 -0
  64. package/dist/list/List.vue.js +4 -1
  65. package/dist/list/ListItem.vue.d.ts +13 -1
  66. package/dist/list/ListItem.vue.js +15 -3
  67. package/dist/loading-indicator/LoadingIndicator.vue.d.ts +1 -0
  68. package/dist/loading-indicator/LoadingIndicator.vue.js +4 -1
  69. package/dist/menu/Menu.vue.d.ts +2 -2
  70. package/dist/menu/Menu.vue.js +11 -2
  71. package/dist/navigation-bar/NavigationBar.vue.d.ts +31 -0
  72. package/dist/navigation-bar/NavigationBar.vue.js +63 -0
  73. package/dist/navigation-bar/NavigationBarItem.vue.d.ts +40 -0
  74. package/dist/navigation-bar/NavigationBarItem.vue.js +84 -0
  75. package/dist/navigation-bar/context.js +3 -0
  76. package/dist/navigation-rail/NavigationRail.vue.d.ts +46 -0
  77. package/dist/navigation-rail/NavigationRail.vue.js +112 -0
  78. package/dist/navigation-rail/NavigationRailItem.vue.d.ts +41 -0
  79. package/dist/navigation-rail/NavigationRailItem.vue.js +85 -0
  80. package/dist/navigation-rail/NavigationRailSection.vue.d.ts +17 -0
  81. package/dist/navigation-rail/NavigationRailSection.vue.js +20 -0
  82. package/dist/navigation-rail/context.js +3 -0
  83. package/dist/overflow/OverflowItem.vue.d.ts +16 -0
  84. package/dist/overflow/OverflowItem.vue.js +24 -0
  85. package/dist/overflow/OverflowMenu.vue.js +94 -0
  86. package/dist/overflow/overflow.js +79 -0
  87. package/dist/progress/CircularProgress.vue.d.ts +1 -0
  88. package/dist/progress/CircularProgress.vue.js +5 -2
  89. package/dist/progress/LinearProgress.vue.d.ts +1 -0
  90. package/dist/progress/LinearProgress.vue.js +5 -2
  91. package/dist/radio/Radio.vue.d.ts +2 -0
  92. package/dist/radio/Radio.vue.js +7 -1
  93. package/dist/radio/RadioGroup.vue.d.ts +2 -0
  94. package/dist/radio/RadioGroup.vue.js +13 -2
  95. package/dist/rio/rio.js +2 -0
  96. package/dist/scroll-field/ScrollField.vue.d.ts +1 -0
  97. package/dist/scroll-field/ScrollField.vue.js +3 -0
  98. package/dist/search/Search.vue.d.ts +58 -0
  99. package/dist/search/Search.vue.js +161 -0
  100. package/dist/select/AfterOptions.vue.js +11 -0
  101. package/dist/select/Select.vue.d.ts +6 -4
  102. package/dist/select/Select.vue.js +44 -31
  103. package/dist/select/SelectOption.vue.d.ts +4 -1
  104. package/dist/select/SelectOption.vue.js +8 -5
  105. package/dist/side-sheet/SideSheet.vue.d.ts +43 -0
  106. package/dist/side-sheet/SideSheet.vue.js +103 -0
  107. package/dist/slider/RangeSlider.vue.d.ts +1 -0
  108. package/dist/slider/RangeSlider.vue.js +3 -0
  109. package/dist/slider/Slider.vue.d.ts +1 -0
  110. package/dist/slider/Slider.vue.js +3 -0
  111. package/dist/snackbar/Snackbar.vue.d.ts +31 -0
  112. package/dist/snackbar/Snackbar.vue.js +48 -0
  113. package/dist/snackbar/SnackbarHost.vue.d.ts +40 -0
  114. package/dist/snackbar/SnackbarHost.vue.js +110 -0
  115. package/dist/snackbar/snackbar.d.ts +16 -0
  116. package/dist/snackbar/snackbar.js +11 -0
  117. package/dist/split-button/SplitButton.vue.d.ts +3 -2
  118. package/dist/split-button/SplitButton.vue.js +3 -0
  119. package/dist/switch/Switch.vue.d.ts +2 -0
  120. package/dist/switch/Switch.vue.js +6 -0
  121. package/dist/tabs/Tab.vue.d.ts +26 -0
  122. package/dist/tabs/Tab.vue.js +91 -0
  123. package/dist/tabs/TabGroup.vue.d.ts +22 -0
  124. package/dist/tabs/TabGroup.vue.js +25 -0
  125. package/dist/tabs/TabPanel.vue.d.ts +15 -0
  126. package/dist/tabs/TabPanel.vue.js +20 -0
  127. package/dist/tabs/Tabs.vue.d.ts +34 -0
  128. package/dist/tabs/Tabs.vue.js +109 -0
  129. package/dist/tabs/context.js +5 -0
  130. package/dist/text-field/TextField.vue.d.ts +9 -2
  131. package/dist/text-field/TextField.vue.js +94 -47
  132. package/dist/theme/ThemeProvider.vue.d.ts +22 -0
  133. package/dist/theme/ThemeProvider.vue.js +26 -0
  134. package/dist/theme/context.d.ts +7 -0
  135. package/dist/theme/context.js +7 -0
  136. package/dist/time-picker/TimeInput.vue.d.ts +7 -1
  137. package/dist/time-picker/TimeInput.vue.js +5 -2
  138. package/dist/time-picker/TimePickerDialog.vue.d.ts +9 -3
  139. package/dist/time-picker/TimePickerDialog.vue.js +5 -2
  140. package/dist/time-picker/TimeScroll.vue.d.ts +7 -1
  141. package/dist/time-picker/TimeScroll.vue.js +5 -2
  142. package/dist/toolbar/FabPlace.vue.js +14 -0
  143. package/dist/toolbar/Toolbar.vue.d.ts +34 -0
  144. package/dist/toolbar/Toolbar.vue.js +115 -0
  145. package/dist/toolbar/context.js +3 -0
  146. package/dist/tooltip/Tooltip.vue.js +10 -3
  147. package/package.json +6 -4
package/README.md CHANGED
@@ -1,13 +1,108 @@
1
1
  # @rio-m3e/vue
2
2
 
3
- Vue components for [Rio](https://github.com/LegenLee/rio), a Material 3 Expressive implementation: `RioButton`, `RioIconButton`, and `RioSwitch`, plus the `v-ripple` directive.
3
+ Vue components for [Rio](https://github.com/LegenLee/rio), a Material 3 Expressive implementation.
4
+
5
+ Rio is in early development. Before 1.0, any minor version may break the API.
6
+
7
+ ## Install
4
8
 
5
9
  ```sh
6
- pnpm add @rio-m3e/vue @rio-m3e/tokens
10
+ pnpm add @rio-m3e/vue
11
+ ```
12
+
13
+ It needs Vue 3.5 or later, and installs `@rio-m3e/core`, `@rio-m3e/styles`, and `@rio-m3e/tokens` for you. Rio loads no fonts: load Roboto yourself, as with `@fontsource/roboto`.
14
+
15
+ ## Set up
16
+
17
+ Install `createRio` before mounting the app. It writes the theme as `--rio-*` CSS variables and, with `locale`, sets the language for the whole app; without one, components follow the page's `<html lang>`, then the browser's language:
18
+
19
+ ```ts
20
+ // main.ts
21
+ import { createRio } from '@rio-m3e/vue';
22
+ import { createApp } from 'vue';
23
+ import App from './App.vue';
24
+
25
+ createApp(App)
26
+ .use(createRio({ theme: { sourceColor: '#6750a4' } }))
27
+ .mount('#app');
28
+ ```
29
+
30
+ Rio ships no icons. Give them in a component's slot, or once to `createRio`'s `icons` for the icons the components draw on their own, such as a select's arrow ([Icons](https://legenlee.github.io/rio/guide/icons)).
31
+
32
+ ## Use
33
+
34
+ Each component imports its own styles.
35
+
36
+ ```vue
37
+ <script setup lang="ts">
38
+ import { mdiHeart, mdiHeartOutline } from '@mdi/js';
39
+ import { RioButton, RioIcon, RioIconButton, RioSwitch } from '@rio-m3e/vue';
40
+ import { ref } from 'vue';
41
+
42
+ const favorite = ref(false);
43
+ const wifi = ref(true);
44
+ </script>
45
+
46
+ <template>
47
+ <RioButton variant="tonal">Save</RioButton>
48
+
49
+ <RioIconButton v-model:selected="favorite" label="Add to favorites" toggle variant="standard">
50
+ <RioIcon :icon="{ type: 'svg', path: mdiHeartOutline }" />
51
+ <template #selected-icon>
52
+ <RioIcon :icon="{ type: 'svg', path: mdiHeart }" />
53
+ </template>
54
+ </RioIconButton>
55
+
56
+ <label><RioSwitch v-model:selected="wifi" /> Wi-Fi</label>
57
+ </template>
7
58
  ```
8
59
 
9
- Apply the theme from `@rio-m3e/tokens` once, then use the components. Each component imports its own styles. See the [README](https://github.com/LegenLee/rio#usage) for setup and [docs/components](https://github.com/LegenLee/rio/tree/main/docs/components) for each component.
60
+ ## Components
61
+
62
+ Each page has live examples, the API, and how the component follows the spec.
63
+
64
+ - [App bar](https://legenlee.github.io/rio/components/app-bar): `RioAppBar`
65
+ - [Badge](https://legenlee.github.io/rio/components/badge): `RioBadge`
66
+ - [Bottom sheet](https://legenlee.github.io/rio/components/bottom-sheet): `RioBottomSheet`
67
+ - [Button](https://legenlee.github.io/rio/components/button): `RioButton`
68
+ - [Button group](https://legenlee.github.io/rio/components/button-group): `RioButtonGroup`
69
+ - [Card](https://legenlee.github.io/rio/components/card): `RioCard`, `RioCardMedia`, `RioCardHeader`, `RioCardContent`, `RioCardActions`
70
+ - [Checkbox](https://legenlee.github.io/rio/components/checkbox): `RioCheckbox`
71
+ - [Chips](https://legenlee.github.io/rio/components/chip): `RioChipSet`, `RioAssistChip`, `RioFilterChip`, `RioInputChip`, `RioSuggestionChip`
72
+ - [Date picker](https://legenlee.github.io/rio/components/date-picker): `RioDatePicker`, `RioDatePickerDialog`, `RioDateRangePickerDialog`
73
+ - [Dialog](https://legenlee.github.io/rio/components/dialog): `RioDialog`
74
+ - [Divider](https://legenlee.github.io/rio/components/divider): `RioDivider`
75
+ - [FAB](https://legenlee.github.io/rio/components/fab): `RioFab`
76
+ - [FAB menu](https://legenlee.github.io/rio/components/fab-menu): `RioFabMenu`, `RioFabMenuItem`
77
+ - [Icon](https://legenlee.github.io/rio/components/icon): `RioIcon`
78
+ - [Icon button](https://legenlee.github.io/rio/components/icon-button): `RioIconButton`
79
+ - [Lists](https://legenlee.github.io/rio/components/list): `RioList`, `RioListItem`
80
+ - [Loading indicator](https://legenlee.github.io/rio/components/loading-indicator): `RioLoadingIndicator`
81
+ - [Menu](https://legenlee.github.io/rio/components/menu): `RioMenu`, `RioMenuItem`, `RioMenuGroup`, `RioMenuDivider`, `RioSubMenu`
82
+ - [Navigation bar](https://legenlee.github.io/rio/components/navigation-bar): `RioNavigationBar`, `RioNavigationBarItem`
83
+ - [Navigation rail](https://legenlee.github.io/rio/components/navigation-rail): `RioNavigationRail`, `RioNavigationRailItem`, `RioNavigationRailSection`
84
+ - [Progress indicators](https://legenlee.github.io/rio/components/progress-indicator): `RioLinearProgress`, `RioCircularProgress`
85
+ - [Radio button](https://legenlee.github.io/rio/components/radio-button): `RioRadioGroup`, `RioRadio`
86
+ - [Scroll fields](https://legenlee.github.io/rio/components/scroll-field): `RioScrollField`
87
+ - [Search](https://legenlee.github.io/rio/components/search): `RioSearch`
88
+ - [Select](https://legenlee.github.io/rio/components/select): `RioSelect`, `RioSelectOption`
89
+ - [Side sheet](https://legenlee.github.io/rio/components/side-sheet): `RioSideSheet`
90
+ - [Slider](https://legenlee.github.io/rio/components/slider): `RioSlider`, `RioRangeSlider`
91
+ - [Snackbar](https://legenlee.github.io/rio/components/snackbar): `RioSnackbarHost`, `useSnackbar`, `RioSnackbar`
92
+ - [Split button](https://legenlee.github.io/rio/components/split-button): `RioSplitButton`
93
+ - [Switch](https://legenlee.github.io/rio/components/switch): `RioSwitch`
94
+ - [Tabs](https://legenlee.github.io/rio/components/tabs): `RioTabGroup`, `RioTabs`, `RioTab`, `RioTabPanel`
95
+ - [Text field](https://legenlee.github.io/rio/components/text-field): `RioTextField`
96
+ - [Time picker](https://legenlee.github.io/rio/components/time-picker): `RioTimePickerDialog`, `RioTimeInput`, `RioTimeScroll`
97
+ - [Toolbar](https://legenlee.github.io/rio/components/toolbar): `RioToolbar`
98
+ - [Tooltip](https://legenlee.github.io/rio/components/tooltip): `RioTooltip`
99
+
100
+ `RioOverflowItem` puts content of your own into an overflow menu: in an app bar's trailing buttons, a toolbar, or a button group ([Overflow menu](https://legenlee.github.io/rio/components/toolbar#overflow-menu)).
101
+
102
+ `RioLocaleProvider` sets the language for part of a page ([Languages](https://legenlee.github.io/rio/guide/languages)), and the `v-ripple` directive draws the press ripple on an element of your own.
103
+
104
+ The [docs](https://legenlee.github.io/rio/) start with [Getting started](https://legenlee.github.io/rio/guide/getting-started).
10
105
 
11
- You can see the document page in [here](https://legenlee.github.io/rio/).
106
+ ## License
12
107
 
13
108
  Licensed under the Apache License 2.0.
@@ -0,0 +1,42 @@
1
+ import { AppBarProps } from "@rio-m3e/core";
2
+ import "@rio-m3e/styles/app-bar.css";
3
+ interface Props extends AppBarProps {
4
+ /** The headline's text. The `headline` slot takes its place, as for a logo. */
5
+ headline?: string;
6
+ /** The subtitle's text. The `subtitle` slot takes its place. */
7
+ subtitle?: string;
8
+ /** The element whose scrolling fills the bar, and moves it. Defaults to the window. */
9
+ scrollTarget?: HTMLElement | null;
10
+ }
11
+ type __VLS_Slots = {
12
+ /** A leading button, such as Back or a menu */
13
+ leading?: () => unknown;
14
+ /**
15
+ * The headline, in place of `headline`, as an image or a logo. A collapsing bar renders it again
16
+ * beside the buttons, as a copy hidden from assistive technology and out of reach: `copy` tells
17
+ * the two apart, so the copy can leave out ids.
18
+ */
19
+ headline?: (props: {
20
+ copy: boolean;
21
+ }) => unknown;
22
+ /** The subtitle, in place of `subtitle` */
23
+ subtitle?: () => unknown;
24
+ /**
25
+ * Trailing buttons, up to two, or an avatar. With `overflow`, the buttons that don't fit go into
26
+ * a menu, last first.
27
+ */
28
+ trailing?: () => unknown;
29
+ /** A search app bar's search, a `RioSearch`, in place of the headline and subtitle */
30
+ search?: () => unknown;
31
+ /** The "More options" button's icon, in place of the one the app registered (`more`) */
32
+ 'more-icon'?: () => unknown;
33
+ };
34
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
36
+ declare const _default: typeof __VLS_export;
37
+ type __VLS_WithSlots<T, S> = T & {
38
+ new (): {
39
+ $slots: S;
40
+ };
41
+ };
42
+ export { _default as default };
@@ -0,0 +1,93 @@
1
+ import _sfc_main$1 from "../overflow/OverflowMenu.vue.js";
2
+ import { useOverflowHost } from "../overflow/overflow.js";
3
+ import { appBarKey } from "./context.js";
4
+ import { createBlock, createCommentVNode, createElementBlock, createSlots, createTextVNode, defineComponent, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, provide, ref, renderSlot, resolveDynamicComponent, toDisplayString, unref, useSlots, useTemplateRef, watch, withCtx } from "vue";
5
+ import { appBarTrailingRoom, attachAppBar, createAppBar } from "@rio-m3e/core";
6
+ import "@rio-m3e/styles/app-bar.css";
7
+ // src/app-bar/AppBar.vue
8
+ const _sfc_main = /*@__PURE__*/ defineComponent({
9
+ __name: "AppBar",
10
+ props: {
11
+ headline: {},
12
+ subtitle: {},
13
+ scrollTarget: {},
14
+ variant: {},
15
+ align: {},
16
+ headingLevel: {},
17
+ scrolled: {
18
+ type: Boolean,
19
+ default: () => void 0
20
+ },
21
+ scrollBehavior: {},
22
+ overflow: { type: Boolean },
23
+ maxItems: {}
24
+ },
25
+ setup(__props) {
26
+ const slots = useSlots();
27
+ const targetScrolled = ref(false);
28
+ provide(appBarKey, { inside: true });
29
+ const bar = createAppBar({
30
+ props: () => ({
31
+ variant: __props.variant,
32
+ align: __props.align,
33
+ headingLevel: __props.headingLevel,
34
+ scrolled: __props.scrolled,
35
+ scrollBehavior: __props.scrollBehavior,
36
+ overflow: __props.overflow,
37
+ maxItems: __props.maxItems
38
+ }),
39
+ content: () => ({
40
+ leading: !!slots.leading,
41
+ headline: !!slots.headline || !!__props.headline,
42
+ subtitle: !!slots.subtitle || !!__props.subtitle,
43
+ trailing: !!slots.trailing,
44
+ search: !!slots.search
45
+ }),
46
+ scrolled: () => targetScrolled.value,
47
+ overflowing: () => more.overflowing()
48
+ });
49
+ const root = useTemplateRef("root");
50
+ let handle;
51
+ onMounted(() => {
52
+ handle = attachAppBar(root.value, {
53
+ target: () => __props.scrollTarget ?? void 0,
54
+ onScrolledChange: (next) => targetScrolled.value = next,
55
+ scrollBehavior: bar.scrollBehavior
56
+ });
57
+ });
58
+ onUpdated(() => handle?.update());
59
+ watch(() => __props.scrollTarget, () => handle?.update());
60
+ const more = useOverflowHost({
61
+ overflow: bar.overflow,
62
+ container: useTemplateRef("trailing"),
63
+ room: () => root.value ? appBarTrailingRoom(root.value) : Infinity
64
+ });
65
+ onBeforeUnmount(() => handle?.detach());
66
+ return (_ctx, _cache) => {
67
+ return openBlock(), createElementBlock("header", mergeProps({
68
+ ref_key: "root",
69
+ ref: root
70
+ }, unref(bar).parts.root()), [
71
+ unref(bar).showsLeading() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(bar).parts.leading())), [renderSlot(_ctx.$slots, "leading")], 16)) : createCommentVNode("v-if", true),
72
+ unref(bar).showsCollapsedHeadline() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 1 }, unref(bar).parts.collapsedHeadline())), [renderSlot(_ctx.$slots, "headline", { copy: true }, () => [createTextVNode(toDisplayString(__props.headline), 1)])], 16)) : createCommentVNode("v-if", true),
73
+ unref(bar).showsText() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 2 }, unref(bar).parts.text())), [unref(bar).showsHeadline() ? (openBlock(), createBlock(resolveDynamicComponent(unref(bar).headingTag()), normalizeProps(mergeProps({ key: 0 }, unref(bar).parts.headline())), {
74
+ default: withCtx(() => [renderSlot(_ctx.$slots, "headline", { copy: false }, () => [createTextVNode(toDisplayString(__props.headline), 1)])]),
75
+ _: 3
76
+ }, 16)) : createCommentVNode("v-if", true), unref(bar).showsSubtitle() ? (openBlock(), createElementBlock("p", normalizeProps(mergeProps({ key: 1 }, unref(bar).parts.subtitle())), [renderSlot(_ctx.$slots, "subtitle", {}, () => [createTextVNode(toDisplayString(__props.subtitle), 1)])], 16)) : createCommentVNode("v-if", true)], 16)) : createCommentVNode("v-if", true),
77
+ unref(bar).showsSearch() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 3 }, unref(bar).parts.search())), [renderSlot(_ctx.$slots, "search")], 16)) : createCommentVNode("v-if", true),
78
+ unref(bar).showsTrailing() ? (openBlock(), createElementBlock("div", mergeProps({
79
+ key: 4,
80
+ ref: "trailing"
81
+ }, unref(bar).parts.trailing()), [renderSlot(_ctx.$slots, "trailing"), unref(more).enabled() ? (openBlock(), createBlock(_sfc_main$1, {
82
+ key: 0,
83
+ host: unref(more)
84
+ }, createSlots({ _: 2 }, [_ctx.$slots["more-icon"] ? {
85
+ name: "icon",
86
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "more-icon")]),
87
+ key: "0"
88
+ } : void 0]), 1032, ["host"])) : createCommentVNode("v-if", true)], 16)) : createCommentVNode("v-if", true)
89
+ ], 16);
90
+ };
91
+ }
92
+ });
93
+ export { _sfc_main as default };
@@ -0,0 +1,3 @@
1
+ // src/app-bar/context.ts
2
+ const appBarKey = Symbol("RioAppBar");
3
+ export { appBarKey };
@@ -0,0 +1,15 @@
1
+ import { BadgeProps } from "@rio-m3e/core";
2
+ import "@rio-m3e/styles/badge.css";
3
+ type __VLS_Slots = {
4
+ /** What the badge marks, as an icon: the badge sits at its upper trailing corner. */
5
+ default?: () => unknown;
6
+ };
7
+ declare const __VLS_base: import("vue").DefineComponent<BadgeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BadgeProps> & 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,28 @@
1
+ import { useLocale } from "../locale/locale.js";
2
+ import { createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderSlot, toDisplayString, unref, useSlots } from "vue";
3
+ import { createBadge } from "@rio-m3e/core";
4
+ import "@rio-m3e/styles/badge.css";
5
+ // src/badge/Badge.vue
6
+ const _sfc_main = /*@__PURE__*/ defineComponent({
7
+ __name: "Badge",
8
+ props: {
9
+ value: {},
10
+ max: {},
11
+ locale: {},
12
+ color: {}
13
+ },
14
+ setup(__props) {
15
+ const slots = useSlots();
16
+ const resolvedLocale = useLocale(() => __props.locale);
17
+ const badge = createBadge({ props: () => ({
18
+ value: __props.value,
19
+ max: __props.max,
20
+ locale: resolvedLocale.value,
21
+ color: __props.color
22
+ }) });
23
+ return (_ctx, _cache) => {
24
+ return slots.default ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(badge).parts.anchor())), [renderSlot(_ctx.$slots, "default"), createElementVNode("span", normalizeProps(guardReactiveProps(unref(badge).parts.root())), toDisplayString(unref(badge).label()), 17)], 16)) : (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 1 }, unref(badge).parts.root())), toDisplayString(unref(badge).label()), 17));
25
+ };
26
+ }
27
+ });
28
+ export { _sfc_main as default };
@@ -0,0 +1,34 @@
1
+ import { BottomSheetProps, SheetMessages } 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/direction.css";
5
+ import "@rio-m3e/styles/sheet.css";
6
+ interface Props extends Omit<BottomSheetProps, 'open'> {
7
+ /** A language tag, for the drag handle's name. Without it, the one provided, or the page's. */
8
+ locale?: string;
9
+ /** Replaces the sheet's own words: its name, and the drag handle's. */
10
+ messages?: Partial<SheetMessages>;
11
+ }
12
+ type __VLS_Props = Props;
13
+ type __VLS_Slots = {
14
+ /** The content: a list of actions, or anything else */
15
+ default?: () => unknown;
16
+ };
17
+ type __VLS_ModelProps = {
18
+ /** Whether the sheet is shown, with `v-model:open`. */
19
+ 'open'?: boolean;
20
+ };
21
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
22
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
+ "update:open": (value: boolean) => any;
24
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
25
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
26
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
28
+ declare const _default: typeof __VLS_export;
29
+ type __VLS_WithSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };
34
+ export { _default as default };
@@ -0,0 +1,82 @@
1
+ import { useLocale, useMessages } from "../locale/locale.js";
2
+ import { keepPresses } from "../overlay/presses.js";
3
+ import { Fragment, createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, ref, renderSlot, shallowRef, toHandlers, unref, useModel, useTemplateRef, watch } from "vue";
4
+ import { attachBottomSheet, createBottomSheet } from "@rio-m3e/core";
5
+ import "@rio-m3e/styles/base/focus-ring.css";
6
+ import "@rio-m3e/styles/base/reduced-motion.css";
7
+ import "@rio-m3e/styles/base/direction.css";
8
+ import "@rio-m3e/styles/sheet.css";
9
+ // src/bottom-sheet/BottomSheet.vue
10
+ const _sfc_main = /*@__PURE__*/ defineComponent({
11
+ __name: "BottomSheet",
12
+ props: /*@__PURE__*/ mergeModels({
13
+ locale: {},
14
+ messages: {},
15
+ label: {},
16
+ dragHandle: {
17
+ type: Boolean,
18
+ default: () => void 0
19
+ }
20
+ }, {
21
+ "open": {
22
+ type: Boolean,
23
+ default: false
24
+ },
25
+ "openModifiers": {}
26
+ }),
27
+ emits: ["update:open"],
28
+ setup(__props) {
29
+ /** Whether the sheet is shown, with `v-model:open`. */
30
+ const open = useModel(__props, "open");
31
+ const text = useMessages("sheet", useLocale(() => __props.locale), () => __props.messages);
32
+ /** The height it is at, as `attachBottomSheet` and the drag handle set it */
33
+ const detent = ref("expanded");
34
+ /** What `attachBottomSheet` measured */
35
+ const layout = shallowRef();
36
+ /** Whether the content is scrolled from its top */
37
+ const scrolled = ref(false);
38
+ const sheet = createBottomSheet({
39
+ props: () => ({
40
+ open: open.value,
41
+ label: __props.label,
42
+ dragHandle: __props.dragHandle
43
+ }),
44
+ messages: () => text.value,
45
+ detent: () => detent.value,
46
+ layout: () => layout.value,
47
+ scrolled: () => scrolled.value,
48
+ onDetentChange: (next) => detent.value = next,
49
+ onOpenChange: (next) => open.value = next
50
+ });
51
+ const rendered = ref(open.value);
52
+ watch(open, (next) => {
53
+ if (next) rendered.value = true;
54
+ });
55
+ const root = useTemplateRef("root");
56
+ let handle;
57
+ onMounted(() => {
58
+ handle = attachBottomSheet(root.value, {
59
+ onOpenChange: (next) => open.value = next,
60
+ onDetentChange: (next) => detent.value = next,
61
+ onLayoutChange: (next) => layout.value = next,
62
+ onScrolledChange: (next) => scrolled.value = next,
63
+ onClosed: () => {
64
+ if (!open.value) rendered.value = false;
65
+ },
66
+ detent: sheet.detent,
67
+ dragHandle: sheet.showsHandle
68
+ });
69
+ handle.sync(open.value);
70
+ });
71
+ watch(open, (next) => handle?.sync(next), { flush: "post" });
72
+ onUpdated(() => handle?.update());
73
+ onBeforeUnmount(() => handle?.detach());
74
+ return (_ctx, _cache) => {
75
+ return openBlock(), createElementBlock("dialog", mergeProps({
76
+ ref_key: "root",
77
+ ref: root
78
+ }, unref(sheet).parts.root(), toHandlers(unref(keepPresses), true)), [rendered.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [unref(sheet).showsHandle() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(sheet).parts.header())), [createElementVNode("button", mergeProps(unref(sheet).parts.handle(), { onClick: _cache[0] || (_cache[0] = (...args) => unref(sheet).handleHandleClick && unref(sheet).handleHandleClick(...args)) }), null, 16)], 16)) : createCommentVNode("v-if", true), createElementVNode("div", normalizeProps(guardReactiveProps(unref(sheet).parts.content())), [renderSlot(_ctx.$slots, "default")], 16)], 64)) : createCommentVNode("v-if", true)], 16);
79
+ };
80
+ }
81
+ });
82
+ export { _sfc_main as default };