@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
@@ -0,0 +1,95 @@
1
+ import { useLocale, useMessages } from "../locale/locale.js";
2
+ import { tabGroupKey, tabsKey } from "./context.js";
3
+ import { createElementBlock, createElementVNode, defineComponent, inject, mergeModels, mergeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, provide, renderSlot, shallowRef, unref, useModel, useTemplateRef, watch } from "vue";
4
+ import { attachTabs, createTabs, inDocumentOrder, mergePartAttrs } from "@rio-m3e/core";
5
+ import "@rio-m3e/styles/base/reduced-motion.css";
6
+ import "@rio-m3e/styles/tabs.css";
7
+ // src/tabs/Tabs.vue
8
+ /** The tabs, as they register */
9
+ const _sfc_main = /*@__PURE__*/ defineComponent({
10
+ inheritAttrs: false,
11
+ __name: "Tabs",
12
+ props: /*@__PURE__*/ mergeModels({
13
+ locale: {},
14
+ messages: {},
15
+ variant: {},
16
+ scrollable: { type: Boolean },
17
+ align: {},
18
+ iconOnly: { type: Boolean },
19
+ label: {}
20
+ }, {
21
+ "modelValue": {},
22
+ "modelModifiers": {}
23
+ }),
24
+ emits: ["update:modelValue"],
25
+ setup(__props) {
26
+ /** The selected tab's value, with `v-model`, for a tab list outside a `RioTabGroup` */
27
+ const model = useModel(__props, "modelValue");
28
+ const group = inject(tabGroupKey, void 0);
29
+ const registered = shallowRef([]);
30
+ /**
31
+ * The tabs' values in the page's order, once each has its element; until then, as they registered,
32
+ * as on a server
33
+ */
34
+ const values = () => inDocumentOrder(registered.value, (tab) => tab.element()).map((tab) => tab.value());
35
+ const tabs = createTabs({
36
+ props: () => ({
37
+ selected: model.value,
38
+ variant: __props.variant,
39
+ scrollable: __props.scrollable,
40
+ align: __props.align,
41
+ iconOnly: __props.iconOnly,
42
+ label: __props.label
43
+ }),
44
+ onChange: (next) => model.value = next,
45
+ group: () => group,
46
+ values
47
+ });
48
+ const resolvedLocale = useLocale(() => __props.locale);
49
+ const text = useMessages("tabs", resolvedLocale, () => __props.messages);
50
+ provide(tabsKey, {
51
+ isSelected: tabs.isSelected,
52
+ choose: tabs.choose,
53
+ tabStop: tabs.tabStop,
54
+ ids: tabs.ids,
55
+ variant: tabs.variant,
56
+ iconOnly: tabs.iconOnly,
57
+ locale: resolvedLocale,
58
+ messages: text,
59
+ register(value, element) {
60
+ const tab = {
61
+ value,
62
+ element
63
+ };
64
+ registered.value = [...registered.value, tab];
65
+ return () => registered.value = registered.value.filter((other) => other !== tab);
66
+ }
67
+ });
68
+ const root = useTemplateRef("root");
69
+ const list = useTemplateRef("list");
70
+ let handle;
71
+ onMounted(() => {
72
+ handle = attachTabs(root.value, list.value, { scrollable: tabs.scrollable });
73
+ });
74
+ watch(tabs.selected, () => handle?.sync(), { flush: "post" });
75
+ onUpdated(() => handle?.sync());
76
+ onBeforeUnmount(() => handle?.detach());
77
+ return (_ctx, _cache) => {
78
+ return openBlock(), createElementBlock("div", mergeProps({
79
+ ref_key: "root",
80
+ ref: root
81
+ }, unref(tabs).parts.root(), {
82
+ class: _ctx.$attrs.class,
83
+ style: _ctx.$attrs.style
84
+ }), [createElementVNode("div", mergeProps({
85
+ ref_key: "list",
86
+ ref: list
87
+ }, unref(mergePartAttrs)({
88
+ ..._ctx.$attrs,
89
+ class: void 0,
90
+ style: void 0
91
+ }, unref(tabs).parts.list())), [renderSlot(_ctx.$slots, "default")], 16)], 16);
92
+ };
93
+ }
94
+ });
95
+ export { _sfc_main as default };
@@ -0,0 +1,5 @@
1
+ // src/tabs/context.ts
2
+ /** What `RioTabGroup` provides to the tab list and the panels inside it */
3
+ const tabGroupKey = Symbol("RioTabGroup");
4
+ const tabsKey = Symbol("RioTabs");
5
+ export { tabGroupKey, tabsKey };
@@ -1,7 +1,13 @@
1
- import { TextFieldProps } from "@rio-m3e/core";
1
+ import { TextFieldMessages, TextFieldProps } from "@rio-m3e/core";
2
+ import "@rio-m3e/styles/base/accent.css";
2
3
  import "@rio-m3e/styles/base/reduced-motion.css";
3
4
  import "@rio-m3e/styles/text-field.css";
4
- type Props = Omit<TextFieldProps, 'value'>;
5
+ interface Props extends Omit<TextFieldProps, 'value'> {
6
+ /** A language tag for what the field says to assistive technology, as the counter's label */
7
+ locale?: string;
8
+ /** Replaces any of what the field says to assistive technology. */
9
+ messages?: Partial<TextFieldMessages>;
10
+ }
5
11
  type __VLS_Props = Props;
6
12
  type __VLS_Slots = {
7
13
  /** An icon before the text, such as a search icon */
@@ -1,5 +1,8 @@
1
- import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, openBlock, renderSlot, toDisplayString, unref, useAttrs, useId, useModel, useSlots, useTemplateRef, vModelDynamic, vModelText, withDirectives } from "vue";
1
+ import { useComposingInput } from "../ime/composing.js";
2
+ import { useLocale, useMessages } from "../locale/locale.js";
3
+ import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, onUpdated, openBlock, renderSlot, shallowRef, toDisplayString, unref, useAttrs, useId, useModel, useSlots, useTemplateRef, vModelDynamic, vModelText, withDirectives } from "vue";
2
4
  import { attachTextField, createTextField, mergePartAttrs } from "@rio-m3e/core";
5
+ import "@rio-m3e/styles/base/accent.css";
3
6
  import "@rio-m3e/styles/base/reduced-motion.css";
4
7
  import "@rio-m3e/styles/text-field.css";
5
8
  // src/text-field/TextField.vue
@@ -7,19 +10,28 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
7
10
  inheritAttrs: false,
8
11
  __name: "TextField",
9
12
  props: /*@__PURE__*/ mergeModels({
13
+ locale: {},
14
+ messages: {},
10
15
  variant: {},
11
16
  label: {},
12
17
  multiline: { type: Boolean },
13
18
  rows: {},
19
+ grow: { type: Boolean },
20
+ maxRows: {},
14
21
  prefix: {},
15
22
  suffix: {},
16
23
  supportingText: {},
17
24
  error: { type: Boolean },
18
25
  errorText: {},
26
+ color: {},
19
27
  maxlength: {},
20
28
  required: { type: Boolean },
21
29
  disabled: { type: Boolean },
22
- readonly: { type: Boolean }
30
+ readonly: { type: Boolean },
31
+ validationMessages: {
32
+ type: Boolean,
33
+ default: () => void 0
34
+ }
23
35
  }, {
24
36
  "modelValue": { default: "" },
25
37
  "modelModifiers": {}
@@ -34,6 +46,11 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
34
46
  const slots = useSlots();
35
47
  const id = useId();
36
48
  const attrs = useAttrs();
49
+ const text = useMessages("textField", useLocale(() => __props.locale), () => __props.messages);
50
+ /** A growing field's text area, fitted to its text, as `attachTextField` reports it */
51
+ const fit = shallowRef();
52
+ /** The browser's validation message, as `attachTextField` reports it */
53
+ const validation = shallowRef();
37
54
  const field = createTextField({
38
55
  props: () => ({
39
56
  variant: __props.variant,
@@ -41,15 +58,19 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
41
58
  value: String(model.value),
42
59
  multiline: __props.multiline,
43
60
  rows: __props.rows,
61
+ grow: __props.grow,
62
+ maxRows: __props.maxRows,
44
63
  prefix: __props.prefix,
45
64
  suffix: __props.suffix,
46
65
  supportingText: __props.supportingText,
47
66
  error: __props.error,
48
67
  errorText: __props.errorText,
68
+ color: __props.color,
49
69
  maxlength: __props.maxlength,
50
70
  required: __props.required,
51
71
  disabled: __props.disabled,
52
- readonly: __props.readonly
72
+ readonly: __props.readonly,
73
+ validationMessages: __props.validationMessages
53
74
  }),
54
75
  content: () => ({
55
76
  leadingIcon: !!slots["leading-icon"],
@@ -63,60 +84,83 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
63
84
  suffix: `${id}-suffix`,
64
85
  supportingText: `${id}-supporting`,
65
86
  counter: `${id}-counter`
66
- }
87
+ },
88
+ fit: () => fit.value,
89
+ validation: () => validation.value,
90
+ messages: () => text.value
67
91
  });
92
+ const { onComposition, onInput } = useComposingInput((next) => model.value = next);
68
93
  const container = useTemplateRef("container");
69
94
  const input = useTemplateRef("input");
70
95
  let handle;
71
- onMounted(() => handle = attachTextField(container.value, () => input.value));
96
+ onMounted(() => {
97
+ handle = attachTextField(container.value, () => input.value, {
98
+ growth: field.growth,
99
+ onFitChange: (next) => fit.value = next,
100
+ validates: field.validates,
101
+ onValidationChange: (next) => validation.value = next
102
+ });
103
+ });
104
+ onUpdated(() => handle?.update());
72
105
  onBeforeUnmount(() => handle?.detach());
73
106
  return (_ctx, _cache) => {
74
107
  return openBlock(), createElementBlock("div", mergeProps(unref(field).parts.root(), {
75
108
  class: _ctx.$attrs.class,
76
109
  style: _ctx.$attrs.style
77
- }), [createElementVNode("div", normalizeProps(guardReactiveProps(unref(field).parts.frame())), [
78
- unref(field).showsOutline() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(field).parts.outline())), [
79
- createElementVNode("span", normalizeProps(guardReactiveProps(unref(field).parts.outlineStart())), null, 16),
80
- createElementVNode("span", normalizeProps(guardReactiveProps(unref(field).parts.outlineNotch())), toDisplayString(unref(field).labelText()), 17),
81
- createElementVNode("span", normalizeProps(guardReactiveProps(unref(field).parts.outlineEnd())), null, 16)
110
+ }), [
111
+ createElementVNode("div", normalizeProps(guardReactiveProps(unref(field).parts.frame())), [
112
+ unref(field).showsOutline() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(field).parts.outline())), [
113
+ createElementVNode("span", normalizeProps(guardReactiveProps(unref(field).parts.outlineStart())), null, 16),
114
+ createElementVNode("span", normalizeProps(guardReactiveProps(unref(field).parts.outlineNotch())), toDisplayString(unref(field).labelText()), 17),
115
+ createElementVNode("span", normalizeProps(guardReactiveProps(unref(field).parts.outlineEnd())), null, 16)
116
+ ], 16)) : createCommentVNode("v-if", true),
117
+ unref(field).showsLabel() ? (openBlock(), createElementBlock("label", normalizeProps(mergeProps({ key: 1 }, unref(field).parts.label())), toDisplayString(unref(field).labelText()), 17)) : createCommentVNode("v-if", true),
118
+ createElementVNode("div", mergeProps({
119
+ ref_key: "container",
120
+ ref: container
121
+ }, unref(field).parts.container()), [
122
+ unref(field).showsLeadingIcon() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(field).parts.leadingIcon())), [renderSlot(_ctx.$slots, "leading-icon")], 16)) : createCommentVNode("v-if", true),
123
+ createElementVNode("div", normalizeProps(guardReactiveProps(unref(field).parts.content())), [
124
+ unref(field).showsPrefix() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(field).parts.prefix())), toDisplayString(__props.prefix), 17)) : createCommentVNode("v-if", true),
125
+ createCommentVNode(" v-model, which keeps the input as it is while an IME composes, and onInput "),
126
+ unref(field).singleLine() ? withDirectives((openBlock(), createElementBlock("input", mergeProps({
127
+ key: 1,
128
+ ref_key: "input",
129
+ ref: input,
130
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
131
+ onCompositionstart: _cache[1] || (_cache[1] = (...args) => unref(onComposition) && unref(onComposition)(...args)),
132
+ onCompositionend: _cache[2] || (_cache[2] = (...args) => unref(onComposition) && unref(onComposition)(...args)),
133
+ onInput: _cache[3] || (_cache[3] = (...args) => unref(onInput) && unref(onInput)(...args))
134
+ }, unref(mergePartAttrs)({
135
+ ..._ctx.$attrs,
136
+ class: void 0,
137
+ style: void 0
138
+ }, unref(field).parts.input())), null, 16)), [[vModelDynamic, model.value]]) : withDirectives((openBlock(), createElementBlock("textarea", mergeProps({
139
+ key: 2,
140
+ ref_key: "input",
141
+ ref: input,
142
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => model.value = $event),
143
+ onCompositionstart: _cache[5] || (_cache[5] = (...args) => unref(onComposition) && unref(onComposition)(...args)),
144
+ onCompositionend: _cache[6] || (_cache[6] = (...args) => unref(onComposition) && unref(onComposition)(...args)),
145
+ onInput: _cache[7] || (_cache[7] = (...args) => unref(onInput) && unref(onInput)(...args))
146
+ }, unref(mergePartAttrs)({
147
+ ..._ctx.$attrs,
148
+ class: void 0,
149
+ style: void 0
150
+ }, unref(field).parts.textarea())), null, 16)), [[vModelText, model.value]]),
151
+ unref(field).showsSuffix() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 3 }, unref(field).parts.suffix())), toDisplayString(__props.suffix), 17)) : createCommentVNode("v-if", true)
152
+ ], 16),
153
+ unref(field).showsTrailingIcon() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 1 }, unref(field).parts.trailingIcon())), [renderSlot(_ctx.$slots, "trailing-icon")], 16)) : createCommentVNode("v-if", true)
154
+ ], 16)
155
+ ], 16),
156
+ unref(field).showsSupporting() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(field).parts.supporting())), [
157
+ createCommentVNode(" A new element for the error text, so it arrives with its alert role. "),
158
+ unref(field).showsSupportingText() ? (openBlock(), createElementBlock("span", mergeProps({ key: unref(field).showsErrorText() ? "error" : "supporting" }, unref(field).parts.supportingText()), toDisplayString(unref(field).supportingTextNow()), 17)) : createCommentVNode("v-if", true),
159
+ unref(field).showsCounter() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 1 }, unref(field).parts.counter())), [createElementVNode("span", normalizeProps(guardReactiveProps(unref(field).parts.counterText())), toDisplayString(unref(field).counterText()), 17), createElementVNode("span", normalizeProps(guardReactiveProps(unref(field).parts.counterLabel())), toDisplayString(unref(field).counterLabel()), 17)], 16)) : createCommentVNode("v-if", true)
82
160
  ], 16)) : createCommentVNode("v-if", true),
83
- unref(field).showsLabel() ? (openBlock(), createElementBlock("label", normalizeProps(mergeProps({ key: 1 }, unref(field).parts.label())), toDisplayString(unref(field).labelText()), 17)) : createCommentVNode("v-if", true),
84
- createElementVNode("div", mergeProps({
85
- ref_key: "container",
86
- ref: container
87
- }, unref(field).parts.container()), [
88
- unref(field).showsLeadingIcon() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(field).parts.leadingIcon())), [renderSlot(_ctx.$slots, "leading-icon")], 16)) : createCommentVNode("v-if", true),
89
- createElementVNode("div", normalizeProps(guardReactiveProps(unref(field).parts.content())), [
90
- unref(field).showsPrefix() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 0 }, unref(field).parts.prefix())), toDisplayString(__props.prefix), 17)) : createCommentVNode("v-if", true),
91
- createCommentVNode(" v-model, not :value and @input: it waits for an IME to finish composing. "),
92
- unref(field).singleLine() ? withDirectives((openBlock(), createElementBlock("input", mergeProps({
93
- key: 1,
94
- ref_key: "input",
95
- ref: input,
96
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event)
97
- }, unref(mergePartAttrs)({
98
- ..._ctx.$attrs,
99
- class: void 0,
100
- style: void 0
101
- }, unref(field).parts.input())), null, 16)), [[vModelDynamic, model.value]]) : withDirectives((openBlock(), createElementBlock("textarea", mergeProps({
102
- key: 2,
103
- ref_key: "input",
104
- ref: input,
105
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => model.value = $event)
106
- }, unref(mergePartAttrs)({
107
- ..._ctx.$attrs,
108
- class: void 0,
109
- style: void 0
110
- }, unref(field).parts.textarea())), null, 16)), [[vModelText, model.value]]),
111
- unref(field).showsSuffix() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 3 }, unref(field).parts.suffix())), toDisplayString(__props.suffix), 17)) : createCommentVNode("v-if", true)
112
- ], 16),
113
- unref(field).showsTrailingIcon() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 1 }, unref(field).parts.trailingIcon())), [renderSlot(_ctx.$slots, "trailing-icon")], 16)) : createCommentVNode("v-if", true)
114
- ], 16)
115
- ], 16), unref(field).showsSupporting() ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, unref(field).parts.supporting())), [
116
- createCommentVNode(" A new element for the error text, so it arrives with its alert role. "),
117
- unref(field).showsSupportingText() ? (openBlock(), createElementBlock("span", mergeProps({ key: unref(field).showsErrorText() ? "error" : "supporting" }, unref(field).parts.supportingText()), toDisplayString(unref(field).supportingTextNow()), 17)) : createCommentVNode("v-if", true),
118
- unref(field).showsCounter() ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ key: 1 }, unref(field).parts.counter())), toDisplayString(unref(field).counterText()), 17)) : createCommentVNode("v-if", true)
119
- ], 16)) : createCommentVNode("v-if", true)], 16);
161
+ createCommentVNode(" A new element for each announcement, so it arrives as an alert. "),
162
+ unref(field).announces() ? (openBlock(), createElementBlock("span", mergeProps({ key: unref(field).announcementKey() }, unref(field).parts.announcer()), toDisplayString(unref(field).announcementText()), 17)) : createCommentVNode("v-if", true)
163
+ ], 16);
120
164
  };
121
165
  }
122
166
  });
@@ -1,4 +1,5 @@
1
- import { HourCycle, TimePickerMessages } from "@rio-m3e/core";
1
+ import { AccentColor, HourCycle, TimePickerMessages } 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";
@@ -12,6 +13,11 @@ type __VLS_Props = {
12
13
  hourCycle?: HourCycle;
13
14
  /** Replaces any of the text the picker shows. */
14
15
  messages?: Partial<TimePickerMessages>;
16
+ /**
17
+ * The theme color it takes in place of the spec's accents: `'secondary'`, `'tertiary'`,
18
+ * `'error'`, or a static color of the theme. Its buttons take it too.
19
+ */
20
+ color?: AccentColor;
15
21
  };
16
22
  type __VLS_ModelProps = {
17
23
  /** The time, `HH:MM` on a 24-hour clock, with `v-model`. */
@@ -2,6 +2,7 @@ import { useLocale, useMessages } from "../locale/locale.js";
2
2
  import _sfc_main$1 from "./TimePickerBody.vue.js";
3
3
  import { createCommentVNode, createElementBlock, createVNode, defineComponent, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, openBlock, reactive, toDisplayString, unref, useId, useModel, useTemplateRef, watch } from "vue";
4
4
  import { attachTimePicker, createTimePicker, initialTimePickerState } from "@rio-m3e/core";
5
+ import "@rio-m3e/styles/base/accent.css";
5
6
  import "@rio-m3e/styles/base/focus-ring.css";
6
7
  import "@rio-m3e/styles/base/reduced-motion.css";
7
8
  import "@rio-m3e/styles/base/state-layer.css";
@@ -14,7 +15,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
14
15
  props: /*@__PURE__*/ mergeModels({
15
16
  locale: {},
16
17
  hourCycle: {},
17
- messages: {}
18
+ messages: {},
19
+ color: {}
18
20
  }, {
19
21
  "modelValue": {},
20
22
  "modelModifiers": {}
@@ -36,7 +38,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
36
38
  props: () => ({
37
39
  value: model.value,
38
40
  locale: locale.value,
39
- hourCycle: props.hourCycle
41
+ hourCycle: props.hourCycle,
42
+ color: props.color
40
43
  }),
41
44
  messages: () => messages.value,
42
45
  state: () => state,
@@ -1,4 +1,5 @@
1
- import { HourCycle, TimePickerKind, TimePickerLayout, TimePickerMessages, TimePickerMode } from "@rio-m3e/core";
1
+ import { AccentColor, HourCycle, TimePickerKind, TimePickerLayout, TimePickerMessages, TimePickerMode } 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";
@@ -19,6 +20,11 @@ type __VLS_Props = {
19
20
  initialMode?: TimePickerMode;
20
21
  /** Replaces any of the text the dialog shows. */
21
22
  messages?: Partial<TimePickerMessages>;
23
+ /**
24
+ * The theme color it takes in place of the spec's accents: `'secondary'`, `'tertiary'`,
25
+ * `'error'`, or a static color of the theme. Its buttons take it too.
26
+ */
27
+ color?: AccentColor;
22
28
  };
23
29
  type __VLS_Slots = {
24
30
  /**
@@ -45,11 +51,11 @@ type __VLS_ModelProps = {
45
51
  };
46
52
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
47
53
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
48
- "update:modelValue": (value: string | undefined) => any;
49
54
  "update:open": (value: boolean) => any;
55
+ "update:modelValue": (value: string | undefined) => any;
50
56
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
51
- "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
52
57
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
58
+ "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
53
59
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
54
60
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
55
61
  declare const _default: typeof __VLS_export;
@@ -6,6 +6,7 @@ import _sfc_main$3 from "./TimePickerBody.vue.js";
6
6
  import _sfc_main$4 from "../icon/Icon.vue.js";
7
7
  import { Fragment, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, openBlock, reactive, ref, renderSlot, toDisplayString, toHandlers, unref, useId, useModel, useTemplateRef, watch, withCtx } from "vue";
8
8
  import { attachDialog, attachTimePicker, createTimePicker, initialTimePickerState } from "@rio-m3e/core";
9
+ import "@rio-m3e/styles/base/accent.css";
9
10
  import "@rio-m3e/styles/base/focus-ring.css";
10
11
  import "@rio-m3e/styles/base/reduced-motion.css";
11
12
  import "@rio-m3e/styles/base/state-layer.css";
@@ -22,7 +23,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
22
23
  layout: {},
23
24
  picker: {},
24
25
  initialMode: {},
25
- messages: {}
26
+ messages: {},
27
+ color: {}
26
28
  }, {
27
29
  "modelValue": {},
28
30
  "modelModifiers": {},
@@ -54,7 +56,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
54
56
  layout: props.layout,
55
57
  picker: props.picker,
56
58
  initialMode: props.initialMode,
57
- rendered: rendered.value
59
+ rendered: rendered.value,
60
+ color: props.color
58
61
  }),
59
62
  messages: () => messages.value,
60
63
  state: () => state,
@@ -1,4 +1,5 @@
1
- import { HourCycle, TimePickerMessages } from "@rio-m3e/core";
1
+ import { AccentColor, HourCycle, TimePickerMessages } 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";
@@ -12,6 +13,11 @@ type __VLS_Props = {
12
13
  hourCycle?: HourCycle;
13
14
  /** Replaces any of the text the picker shows. */
14
15
  messages?: Partial<TimePickerMessages>;
16
+ /**
17
+ * The theme color it takes in place of the spec's accents: `'secondary'`, `'tertiary'`,
18
+ * `'error'`, or a static color of the theme. Its buttons take it too.
19
+ */
20
+ color?: AccentColor;
15
21
  };
16
22
  type __VLS_Slots = {
17
23
  /**
@@ -4,6 +4,7 @@ import _sfc_main$2 from "./TimePickerBody.vue.js";
4
4
  import _sfc_main$3 from "../icon/Icon.vue.js";
5
5
  import { createCommentVNode, createElementBlock, createVNode, defineComponent, mergeModels, mergeProps, normalizeProps, onBeforeUnmount, onMounted, openBlock, reactive, renderSlot, toDisplayString, unref, useId, useModel, useTemplateRef, watch, withCtx } from "vue";
6
6
  import { attachTimePicker, createTimePicker, initialTimePickerState } from "@rio-m3e/core";
7
+ import "@rio-m3e/styles/base/accent.css";
7
8
  import "@rio-m3e/styles/base/focus-ring.css";
8
9
  import "@rio-m3e/styles/base/reduced-motion.css";
9
10
  import "@rio-m3e/styles/base/state-layer.css";
@@ -16,7 +17,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
16
17
  props: /*@__PURE__*/ mergeModels({
17
18
  locale: {},
18
19
  hourCycle: {},
19
- messages: {}
20
+ messages: {},
21
+ color: {}
20
22
  }, {
21
23
  "modelValue": {},
22
24
  "modelModifiers": {}
@@ -35,7 +37,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
35
37
  props: () => ({
36
38
  value: model.value,
37
39
  locale: locale.value,
38
- hourCycle: props.hourCycle
40
+ hourCycle: props.hourCycle,
41
+ color: props.color
39
42
  }),
40
43
  messages: () => messages.value,
41
44
  state: () => state,
@@ -0,0 +1,14 @@
1
+ import { toolbarFabKey } from "./context.js";
2
+ import { defineComponent, provide, renderSlot } from "vue";
3
+ // src/toolbar/FabPlace.vue
4
+ const _sfc_main = /*@__PURE__*/ defineComponent({
5
+ __name: "FabPlace",
6
+ props: { context: {} },
7
+ setup(__props) {
8
+ provide(toolbarFabKey, __props.context);
9
+ return (_ctx, _cache) => {
10
+ return renderSlot(_ctx.$slots, "default");
11
+ };
12
+ }
13
+ });
14
+ export { _sfc_main as default };
@@ -0,0 +1,34 @@
1
+ import { ToolbarProps } from "@rio-m3e/core";
2
+ import "@rio-m3e/styles/base/reduced-motion.css";
3
+ import "@rio-m3e/styles/base/direction.css";
4
+ import "@rio-m3e/styles/toolbar.css";
5
+ interface Props extends ToolbarProps {
6
+ /**
7
+ * The element whose scrolling hides the toolbar, with `hideOnScroll`, or collapses it, with
8
+ * `collapseOnScroll`. Defaults to the window.
9
+ */
10
+ scrollTarget?: HTMLElement | null;
11
+ }
12
+ type __VLS_Slots = {
13
+ /**
14
+ * The items: buttons, icon buttons, text fields, or anything else. With `overflow`, the buttons
15
+ * that don't fit go into the menu, last first; `RioOverflowItem` takes content of the app's own.
16
+ */
17
+ default?: () => unknown;
18
+ /** The "More options" button's icon, in place of the one the app registered (`more`) */
19
+ 'more-icon'?: () => unknown;
20
+ /**
21
+ * A `RioFab` beside a floating toolbar, at its end, or under a vertical one: it takes its size,
22
+ * variant, and color from the toolbar unless it sets its own. A docked toolbar shows none.
23
+ */
24
+ fab?: () => unknown;
25
+ };
26
+ 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>;
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,115 @@
1
+ import _sfc_main$1 from "../overflow/OverflowMenu.vue.js";
2
+ import { useOverflowHost } from "../overflow/overflow.js";
3
+ import _sfc_main$2 from "./FabPlace.vue.js";
4
+ import { createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, onBeforeUnmount, onUpdated, openBlock, ref, renderSlot, shallowRef, unref, useSlots, useTemplateRef, watch, withCtx } from "vue";
5
+ import { attachToolbar, createToolbar, mergePartAttrs } from "@rio-m3e/core";
6
+ import "@rio-m3e/styles/base/reduced-motion.css";
7
+ import "@rio-m3e/styles/base/direction.css";
8
+ import "@rio-m3e/styles/toolbar.css";
9
+ // src/toolbar/Toolbar.vue
10
+ const _sfc_main = /*@__PURE__*/ defineComponent({
11
+ inheritAttrs: false,
12
+ __name: "Toolbar",
13
+ props: {
14
+ scrollTarget: {},
15
+ type: {},
16
+ variant: {},
17
+ orientation: {},
18
+ flat: { type: Boolean },
19
+ hideOnScroll: { type: Boolean },
20
+ expanded: {
21
+ type: Boolean,
22
+ default: () => void 0
23
+ },
24
+ collapseOnScroll: { type: Boolean },
25
+ overflow: { type: Boolean },
26
+ maxItems: {}
27
+ },
28
+ setup(__props) {
29
+ const slots = useSlots();
30
+ /** Whether the content has scrolled the toolbar into its FAB, as `attachToolbar` reports it */
31
+ const collapsedByScroll = ref(false);
32
+ /** The lengths it holds as it collapses into its FAB or expands, as `attachToolbar` reports them */
33
+ const lengths = shallowRef();
34
+ const toolbar = createToolbar({
35
+ props: () => ({
36
+ type: __props.type,
37
+ variant: __props.variant,
38
+ orientation: __props.orientation,
39
+ flat: __props.flat,
40
+ hideOnScroll: __props.hideOnScroll,
41
+ overflow: __props.overflow,
42
+ maxItems: __props.maxItems,
43
+ expanded: __props.expanded,
44
+ collapseOnScroll: __props.collapseOnScroll
45
+ }),
46
+ content: () => ({ fab: !!slots.fab }),
47
+ collapsedByScroll: () => collapsedByScroll.value,
48
+ overflowing: () => more.overflowing(),
49
+ lengths: () => lengths.value
50
+ });
51
+ /** What the FAB in the `fab` slot takes from the toolbar */
52
+ const fabContext = { fab: () => toolbar.showsFab() ? toolbar.fab() : void 0 };
53
+ const root = useTemplateRef("root");
54
+ const more = useOverflowHost({
55
+ overflow: toolbar.overflow,
56
+ container: root,
57
+ axis: toolbar.orientation
58
+ });
59
+ const group = useTemplateRef("group");
60
+ let handle;
61
+ watch([root, group], ([element, around]) => {
62
+ handle?.detach();
63
+ handle = element ? attachToolbar(element, {
64
+ hidesToward: toolbar.hidesToward,
65
+ target: () => __props.scrollTarget ?? void 0,
66
+ group: around,
67
+ collapsesOnScroll: toolbar.collapsesOnScroll,
68
+ onCollapsedByScrollChange: (next) => collapsedByScroll.value = next,
69
+ collapsed: toolbar.collapsed,
70
+ onLengthsChange: (next) => lengths.value = next
71
+ }) : void 0;
72
+ }, { flush: "post" });
73
+ onUpdated(() => handle?.update());
74
+ onBeforeUnmount(() => handle?.detach());
75
+ return (_ctx, _cache) => {
76
+ return unref(toolbar).showsFab() ? (openBlock(), createElementBlock("div", mergeProps({
77
+ key: 0,
78
+ ref_key: "group",
79
+ ref: group
80
+ }, unref(toolbar).parts.group(), {
81
+ class: _ctx.$attrs.class,
82
+ style: _ctx.$attrs.style
83
+ }), [createElementVNode("div", mergeProps({
84
+ ref_key: "root",
85
+ ref: root
86
+ }, unref(mergePartAttrs)({
87
+ ..._ctx.$attrs,
88
+ class: void 0,
89
+ style: void 0
90
+ }, unref(toolbar).parts.root())), [renderSlot(_ctx.$slots, "default"), unref(more).enabled() ? (openBlock(), createBlock(_sfc_main$1, {
91
+ key: 0,
92
+ host: unref(more)
93
+ }, createSlots({ _: 2 }, [_ctx.$slots["more-icon"] ? {
94
+ name: "icon",
95
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "more-icon")]),
96
+ key: "0"
97
+ } : void 0]), 1032, ["host"])) : createCommentVNode("v-if", true)], 16), createElementVNode("div", normalizeProps(guardReactiveProps(unref(toolbar).parts.fab())), [createVNode(_sfc_main$2, { context: fabContext }, {
98
+ default: withCtx(() => [renderSlot(_ctx.$slots, "fab")]),
99
+ _: 3
100
+ })], 16)], 16)) : (openBlock(), createElementBlock("div", mergeProps({
101
+ key: 1,
102
+ ref_key: "root",
103
+ ref: root
104
+ }, mergeProps(unref(toolbar).parts.root(), _ctx.$attrs)), [renderSlot(_ctx.$slots, "default"), unref(more).enabled() ? (openBlock(), createBlock(_sfc_main$1, {
105
+ key: 0,
106
+ host: unref(more)
107
+ }, createSlots({ _: 2 }, [_ctx.$slots["more-icon"] ? {
108
+ name: "icon",
109
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "more-icon")]),
110
+ key: "0"
111
+ } : void 0]), 1032, ["host"])) : createCommentVNode("v-if", true)], 16));
112
+ };
113
+ }
114
+ });
115
+ export { _sfc_main as default };
@@ -0,0 +1,3 @@
1
+ // src/toolbar/context.ts
2
+ const toolbarFabKey = Symbol("RioToolbarFab");
3
+ export { toolbarFabKey };