@octans/ui 1.0.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 (283) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +226 -0
  3. package/bin/octans-icons.mjs +208 -0
  4. package/dist/components/ActionList/ActionList.vue.d.ts +77 -0
  5. package/dist/components/ActionList/ActionListButton.vue.d.ts +85 -0
  6. package/dist/components/ActionList/ActionListMenu.vue.d.ts +18 -0
  7. package/dist/components/ActionList/index.d.ts +1 -0
  8. package/dist/components/AppFrame/AppFrame.vue.d.ts +26 -0
  9. package/dist/components/AppFrame/context.d.ts +40 -0
  10. package/dist/components/AppFrame/index.d.ts +3 -0
  11. package/dist/components/AppFrame/types.d.ts +52 -0
  12. package/dist/components/Badge/Badge.vue.d.ts +125 -0
  13. package/dist/components/Badge/index.d.ts +1 -0
  14. package/dist/components/Banner/Banner.vue.d.ts +239 -0
  15. package/dist/components/Banner/index.d.ts +1 -0
  16. package/dist/components/Button/Button.vue.d.ts +284 -0
  17. package/dist/components/Button/ButtonGroup.vue.d.ts +44 -0
  18. package/dist/components/Button/ButtonGroupItem.vue.d.ts +5 -0
  19. package/dist/components/Button/index.d.ts +3 -0
  20. package/dist/components/Calendar/Calendar.vue.d.ts +15 -0
  21. package/dist/components/Calendar/index.d.ts +2 -0
  22. package/dist/components/Calendar/types.d.ts +39 -0
  23. package/dist/components/CalendarHeatmap/CalendarHeatmap.vue.d.ts +21 -0
  24. package/dist/components/CalendarHeatmap/index.d.ts +2 -0
  25. package/dist/components/CalendarHeatmap/types.d.ts +168 -0
  26. package/dist/components/Caption/Caption.vue.d.ts +5 -0
  27. package/dist/components/Caption/index.d.ts +1 -0
  28. package/dist/components/Card/Card.vue.d.ts +82 -0
  29. package/dist/components/Card/CardSection.vue.d.ts +89 -0
  30. package/dist/components/Card/index.d.ts +2 -0
  31. package/dist/components/Card/utils.d.ts +4 -0
  32. package/dist/components/Checkbox/Checkbox.vue.d.ts +171 -0
  33. package/dist/components/Checkbox/CheckboxControl.vue.d.ts +59 -0
  34. package/dist/components/Checkbox/index.d.ts +2 -0
  35. package/dist/components/Choice/Choice.vue.d.ts +102 -0
  36. package/dist/components/Choice/index.d.ts +1 -0
  37. package/dist/components/ChoiceList/ChoiceList.vue.d.ts +199 -0
  38. package/dist/components/ChoiceList/index.d.ts +2 -0
  39. package/dist/components/ChoiceList/types.d.ts +31 -0
  40. package/dist/components/ColorPicker/ColorPicker.vue.d.ts +18 -0
  41. package/dist/components/ColorPicker/index.d.ts +2 -0
  42. package/dist/components/ColorPicker/types.d.ts +62 -0
  43. package/dist/components/ColorSelector/ColorSelector.vue.d.ts +34 -0
  44. package/dist/components/ColorSelector/index.d.ts +2 -0
  45. package/dist/components/ColorSelector/types.d.ts +143 -0
  46. package/dist/components/DataTable/BulkActions.vue.d.ts +282 -0
  47. package/dist/components/DataTable/DataTable.vue.d.ts +40 -0
  48. package/dist/components/DataTable/DataTableFooter.vue.d.ts +22 -0
  49. package/dist/components/DataTable/index.d.ts +2 -0
  50. package/dist/components/DataTable/types.d.ts +249 -0
  51. package/dist/components/DatePicker/DatePicker.vue.d.ts +17 -0
  52. package/dist/components/DatePicker/index.d.ts +4 -0
  53. package/dist/components/DatePicker/types.d.ts +57 -0
  54. package/dist/components/Divider/Divider.vue.d.ts +20 -0
  55. package/dist/components/Divider/index.d.ts +2 -0
  56. package/dist/components/Divider/types.d.ts +76 -0
  57. package/dist/components/EventDelegator/EventDelegator.vue.d.ts +18 -0
  58. package/dist/components/EventDelegator/index.d.ts +1 -0
  59. package/dist/components/EventDelegator/utils.d.ts +25 -0
  60. package/dist/components/FileInput/DropZone.vue.d.ts +67 -0
  61. package/dist/components/FileInput/FileInput.vue.d.ts +422 -0
  62. package/dist/components/FileInput/ItemList.vue.d.ts +109 -0
  63. package/dist/components/FileInput/index.d.ts +1 -0
  64. package/dist/components/FileInput/utils.d.ts +15 -0
  65. package/dist/components/Filters/FilterActions.vue.d.ts +236 -0
  66. package/dist/components/Filters/FilterItem.vue.d.ts +813 -0
  67. package/dist/components/Filters/Filters.vue.d.ts +1627 -0
  68. package/dist/components/Filters/index.d.ts +1 -0
  69. package/dist/components/Filters/utils.d.ts +1 -0
  70. package/dist/components/FooterHelp/FooterHelp.vue.d.ts +16 -0
  71. package/dist/components/FooterHelp/index.d.ts +1 -0
  72. package/dist/components/FormLayout/FormLayout.vue.d.ts +5 -0
  73. package/dist/components/FormLayout/FormLayoutGroup.vue.d.ts +17 -0
  74. package/dist/components/FormLayout/index.d.ts +2 -0
  75. package/dist/components/Formatter/Formatter.vue.d.ts +42 -0
  76. package/dist/components/Formatter/index.d.ts +1 -0
  77. package/dist/components/GlobalNav/GlobalNav.vue.d.ts +33 -0
  78. package/dist/components/GlobalNav/index.d.ts +2 -0
  79. package/dist/components/GlobalNav/types.d.ts +64 -0
  80. package/dist/components/GradientPicker/GradientPicker.vue.d.ts +20 -0
  81. package/dist/components/GradientPicker/index.d.ts +2 -0
  82. package/dist/components/GradientPicker/types.d.ts +74 -0
  83. package/dist/components/Heading/Heading.vue.d.ts +18 -0
  84. package/dist/components/Heading/index.d.ts +1 -0
  85. package/dist/components/Icon/Icon.vue.d.ts +112 -0
  86. package/dist/components/Icon/iconBundle.d.ts +1 -0
  87. package/dist/components/Icon/index.d.ts +1 -0
  88. package/dist/components/InlineError/InlineError.vue.d.ts +6 -0
  89. package/dist/components/InlineError/index.d.ts +1 -0
  90. package/dist/components/Labelled/Labelled.vue.d.ts +110 -0
  91. package/dist/components/Labelled/index.d.ts +1 -0
  92. package/dist/components/Layout/Layout.vue.d.ts +13 -0
  93. package/dist/components/Layout/LayoutSection.vue.d.ts +16 -0
  94. package/dist/components/Layout/LayoutSectionAnnotated.vue.d.ts +34 -0
  95. package/dist/components/Layout/index.d.ts +3 -0
  96. package/dist/components/LineClamper/LineClamper.vue.d.ts +16 -0
  97. package/dist/components/LineClamper/index.d.ts +2 -0
  98. package/dist/components/LineClamper/types.d.ts +7 -0
  99. package/dist/components/Link/Link.vue.d.ts +19 -0
  100. package/dist/components/Link/index.d.ts +1 -0
  101. package/dist/components/List/List.vue.d.ts +15 -0
  102. package/dist/components/List/ListItem.vue.d.ts +16 -0
  103. package/dist/components/List/index.d.ts +3 -0
  104. package/dist/components/List/types.d.ts +51 -0
  105. package/dist/components/LoaderOverlay/LoaderOverlay.vue.d.ts +18 -0
  106. package/dist/components/LoaderOverlay/host.d.ts +6 -0
  107. package/dist/components/LoaderOverlay/index.d.ts +26 -0
  108. package/dist/components/LoaderOverlay/store.d.ts +7 -0
  109. package/dist/components/LoaderOverlay/types.d.ts +24 -0
  110. package/dist/components/LoadingBar/LoadingBar.vue.d.ts +7 -0
  111. package/dist/components/LoadingBar/host.d.ts +6 -0
  112. package/dist/components/LoadingBar/index.d.ts +28 -0
  113. package/dist/components/LoadingBar/store.d.ts +6 -0
  114. package/dist/components/LoadingBar/types.d.ts +16 -0
  115. package/dist/components/MaybeMountingPortal/MaybeMountingPortal.vue.d.ts +53 -0
  116. package/dist/components/MaybeMountingPortal/index.d.ts +1 -0
  117. package/dist/components/MaybeRouterLink/MaybeRouterLink.vue.d.ts +34 -0
  118. package/dist/components/MaybeRouterLink/index.d.ts +2 -0
  119. package/dist/components/MaybeRouterLink/types.d.ts +49 -0
  120. package/dist/components/Modal/Modal.vue.d.ts +28 -0
  121. package/dist/components/Modal/ModalBackdrop.vue.d.ts +12 -0
  122. package/dist/components/Modal/ModalHost.vue.d.ts +3 -0
  123. package/dist/components/Modal/ModalStackItem.vue.d.ts +14 -0
  124. package/dist/components/Modal/api/AlertModal.vue.d.ts +10 -0
  125. package/dist/components/Modal/api/Base.d.ts +12 -0
  126. package/dist/components/Modal/api/ConfirmModal.vue.d.ts +10 -0
  127. package/dist/components/Modal/api/GenericModal.vue.d.ts +10 -0
  128. package/dist/components/Modal/api/PromptModal.vue.d.ts +10 -0
  129. package/dist/components/Modal/api/types.d.ts +110 -0
  130. package/dist/components/Modal/host.d.ts +2 -0
  131. package/dist/components/Modal/index.d.ts +10 -0
  132. package/dist/components/Modal/manager.d.ts +80 -0
  133. package/dist/components/Modal/types.d.ts +49 -0
  134. package/dist/components/NavField/NavField.vue.d.ts +223 -0
  135. package/dist/components/NavField/index.d.ts +1 -0
  136. package/dist/components/Navigation/Navigation.vue.d.ts +47 -0
  137. package/dist/components/Navigation/components/Item.vue.d.ts +10 -0
  138. package/dist/components/Navigation/components/Section.vue.d.ts +13 -0
  139. package/dist/components/Navigation/index.d.ts +2 -0
  140. package/dist/components/Navigation/types.d.ts +117 -0
  141. package/dist/components/OtpInput/OtpInput.vue.d.ts +21 -0
  142. package/dist/components/OtpInput/index.d.ts +2 -0
  143. package/dist/components/OtpInput/types.d.ts +87 -0
  144. package/dist/components/Page/Page.vue.d.ts +34 -0
  145. package/dist/components/Page/index.d.ts +2 -0
  146. package/dist/components/Page/types.d.ts +75 -0
  147. package/dist/components/PageActions/PageActions.vue.d.ts +6 -0
  148. package/dist/components/PageActions/index.d.ts +2 -0
  149. package/dist/components/PageActions/types.d.ts +17 -0
  150. package/dist/components/Pagination/Pagination.vue.d.ts +22 -0
  151. package/dist/components/Pagination/index.d.ts +1 -0
  152. package/dist/components/Popper/Popper.vue.d.ts +45 -0
  153. package/dist/components/Popper/index.d.ts +2 -0
  154. package/dist/components/Popper/types.d.ts +29 -0
  155. package/dist/components/PreventAutoComplete/PreventAutoComplete.vue.d.ts +24 -0
  156. package/dist/components/PreventAutoComplete/index.d.ts +1 -0
  157. package/dist/components/ProgressBar/ProgressBar.vue.d.ts +48 -0
  158. package/dist/components/ProgressBar/index.d.ts +2 -0
  159. package/dist/components/RadioButton/RadioButton.vue.d.ts +143 -0
  160. package/dist/components/RadioButton/RadioButtonControl.vue.d.ts +50 -0
  161. package/dist/components/RadioButton/index.d.ts +2 -0
  162. package/dist/components/RangeSlider/RangeSlider.vue.d.ts +303 -0
  163. package/dist/components/RangeSlider/index.d.ts +1 -0
  164. package/dist/components/Rating/Rating.vue.d.ts +20 -0
  165. package/dist/components/Rating/index.d.ts +2 -0
  166. package/dist/components/Rating/types.d.ts +78 -0
  167. package/dist/components/ResourceList/ResourceItem.vue.d.ts +17 -0
  168. package/dist/components/ResourceList/ResourceList.vue.d.ts +19 -0
  169. package/dist/components/ResourceList/index.d.ts +3 -0
  170. package/dist/components/ResourceList/types.d.ts +19 -0
  171. package/dist/components/SaveBar/SaveBar.vue.d.ts +15 -0
  172. package/dist/components/SaveBar/index.d.ts +4 -0
  173. package/dist/components/SaveBar/store.d.ts +56 -0
  174. package/dist/components/SaveBar/types.d.ts +42 -0
  175. package/dist/components/SaveBarController/SaveBarController.vue.d.ts +40 -0
  176. package/dist/components/SaveBarController/index.d.ts +1 -0
  177. package/dist/components/ScrollPane/ScrollPane.vue.d.ts +24 -0
  178. package/dist/components/ScrollPane/index.d.ts +2 -0
  179. package/dist/components/ScrollPane/types.d.ts +64 -0
  180. package/dist/components/SegmentedControl/SegmentedControl.vue.d.ts +39 -0
  181. package/dist/components/SegmentedControl/index.d.ts +2 -0
  182. package/dist/components/SegmentedControl/types.d.ts +119 -0
  183. package/dist/components/Select/Select.vue.d.ts +901 -0
  184. package/dist/components/Select/index.d.ts +3 -0
  185. package/dist/components/Sheet/Sheet.vue.d.ts +41 -0
  186. package/dist/components/Sheet/index.d.ts +2 -0
  187. package/dist/components/Sheet/manager.d.ts +34 -0
  188. package/dist/components/Sheet/types.d.ts +92 -0
  189. package/dist/components/SkeletonBodyText/SkeletonBodyText.vue.d.ts +17 -0
  190. package/dist/components/SkeletonBodyText/index.d.ts +1 -0
  191. package/dist/components/SkeletonCard/SkeletonCard.vue.d.ts +34 -0
  192. package/dist/components/SkeletonCard/index.d.ts +1 -0
  193. package/dist/components/SkeletonDisplayText/SkeletonDisplayText.vue.d.ts +17 -0
  194. package/dist/components/SkeletonDisplayText/index.d.ts +1 -0
  195. package/dist/components/Spinner/Spinner.vue.d.ts +52 -0
  196. package/dist/components/Spinner/index.d.ts +1 -0
  197. package/dist/components/Splitter/Splitter.vue.d.ts +60 -0
  198. package/dist/components/Splitter/index.d.ts +2 -0
  199. package/dist/components/Splitter/types.d.ts +177 -0
  200. package/dist/components/Stack/Stack.vue.d.ts +130 -0
  201. package/dist/components/Stack/StackItem.vue.d.ts +23 -0
  202. package/dist/components/Stack/index.d.ts +2 -0
  203. package/dist/components/StatGroup/Stat.vue.d.ts +16 -0
  204. package/dist/components/StatGroup/StatGroup.vue.d.ts +17 -0
  205. package/dist/components/StatGroup/index.d.ts +3 -0
  206. package/dist/components/StatGroup/types.d.ts +42 -0
  207. package/dist/components/Sticky/Sticky.vue.d.ts +27 -0
  208. package/dist/components/Sticky/index.d.ts +2 -0
  209. package/dist/components/Sticky/types.d.ts +24 -0
  210. package/dist/components/SyntaxHighlighter/SyntaxHighlighter.vue.d.ts +12 -0
  211. package/dist/components/SyntaxHighlighter/index.d.ts +2 -0
  212. package/dist/components/SyntaxHighlighter/types.d.ts +10 -0
  213. package/dist/components/Tabs/Tabs.vue.d.ts +23 -0
  214. package/dist/components/Tabs/index.d.ts +2 -0
  215. package/dist/components/Tabs/types.d.ts +19 -0
  216. package/dist/components/Tag/Tag.vue.d.ts +29 -0
  217. package/dist/components/Tag/index.d.ts +1 -0
  218. package/dist/components/TextContainer/TextContainer.vue.d.ts +13 -0
  219. package/dist/components/TextContainer/index.d.ts +1 -0
  220. package/dist/components/TextField/TextField.vue.d.ts +38 -0
  221. package/dist/components/TextField/index.d.ts +2 -0
  222. package/dist/components/TextField/types.d.ts +130 -0
  223. package/dist/components/TextStyle/TextStyle.vue.d.ts +15 -0
  224. package/dist/components/TextStyle/index.d.ts +1 -0
  225. package/dist/components/Thumbnail/Thumbnail.vue.d.ts +17 -0
  226. package/dist/components/Thumbnail/index.d.ts +2 -0
  227. package/dist/components/Thumbnail/types.d.ts +32 -0
  228. package/dist/components/TimePicker/TimePicker.vue.d.ts +25 -0
  229. package/dist/components/TimePicker/index.d.ts +2 -0
  230. package/dist/components/TimePicker/types.d.ts +90 -0
  231. package/dist/components/TimezonePicker/TimezonePicker.vue.d.ts +15 -0
  232. package/dist/components/TimezonePicker/index.d.ts +2 -0
  233. package/dist/components/TimezonePicker/types.d.ts +50 -0
  234. package/dist/components/TimezonePicker/zoneCountries.d.ts +2 -0
  235. package/dist/components/ToastManager/ProgressBar.vue.d.ts +8 -0
  236. package/dist/components/ToastManager/Toast.vue.d.ts +14 -0
  237. package/dist/components/ToastManager/ToastManager.vue.d.ts +19 -0
  238. package/dist/components/ToastManager/host.d.ts +14 -0
  239. package/dist/components/ToastManager/index.d.ts +24 -0
  240. package/dist/components/ToastManager/manager.d.ts +45 -0
  241. package/dist/components/ToastManager/types.d.ts +44 -0
  242. package/dist/components/ToggleSwitch/ToggleSwitch.vue.d.ts +35 -0
  243. package/dist/components/ToggleSwitch/index.d.ts +2 -0
  244. package/dist/components/ToggleSwitch/types.d.ts +84 -0
  245. package/dist/components/Tooltip/Tooltip.vue.d.ts +20 -0
  246. package/dist/components/Tooltip/index.d.ts +1 -0
  247. package/dist/components/UiProvider/UiProvider.vue.d.ts +16 -0
  248. package/dist/components/UiProvider/index.d.ts +2 -0
  249. package/dist/components/UiProvider/types.d.ts +2 -0
  250. package/dist/components/UiProvider/utils.d.ts +5 -0
  251. package/dist/components/UnstyledLink/UnstyledLink.vue.d.ts +5 -0
  252. package/dist/components/UnstyledLink/index.d.ts +1 -0
  253. package/dist/components/all.d.ts +92 -0
  254. package/dist/components/types.d.ts +74 -0
  255. package/dist/globalExtensions.d.ts +7 -0
  256. package/dist/i18n/en.json.d.ts +60 -0
  257. package/dist/lib.d.ts +67 -0
  258. package/dist/lib.umd.d.ts +1 -0
  259. package/dist/style.css +2 -0
  260. package/dist/test/setup.d.ts +1 -0
  261. package/dist/ui.js +20051 -0
  262. package/dist/ui.umd.js +10 -0
  263. package/dist/utils/autoHost.d.ts +27 -0
  264. package/dist/utils/color.d.ts +112 -0
  265. package/dist/utils/colorRamp.d.ts +51 -0
  266. package/dist/utils/createTheme.d.ts +52 -0
  267. package/dist/utils/customTheme.d.ts +73 -0
  268. package/dist/utils/date.d.ts +4 -0
  269. package/dist/utils/debounce.d.ts +3 -0
  270. package/dist/utils/deferredPromise.d.ts +6 -0
  271. package/dist/utils/format.d.ts +9 -0
  272. package/dist/utils/fuzzy.d.ts +33 -0
  273. package/dist/utils/gradient.d.ts +83 -0
  274. package/dist/utils/index.d.ts +31 -0
  275. package/dist/utils/loader.d.ts +1 -0
  276. package/dist/utils/positionPanel.d.ts +32 -0
  277. package/dist/utils/radix.d.ts +6 -0
  278. package/dist/utils/theme.d.ts +42 -0
  279. package/dist/utils/timezone.d.ts +66 -0
  280. package/dist/utils/tokens.d.ts +62 -0
  281. package/dist/utils/translate.d.ts +27 -0
  282. package/dist/zoneCountries-CWZGMHyp.js +353 -0
  283. package/package.json +120 -0
@@ -0,0 +1,110 @@
1
+ import { VNode } from 'vue';
2
+ import { ActionType, ActionTypeType } from '../../types';
3
+ /**
4
+ * Types for the imperative modal API — `alertModal()`, `confirmModal()`,
5
+ * `promptModal()` and `genericModal()` — as opposed to `ModalProps`, which
6
+ * describes the `<Modal>` component.
7
+ *
8
+ * These lived in a `namespace Api` inside `../types.ts`. The file is the
9
+ * namespace now, and which spelling a caller uses depends on where it sits:
10
+ *
11
+ * - Outside this folder, `import type * as Api from './api/types'` and write
12
+ * `Api.AlertModalOptions`. The prefix is what tells them apart from
13
+ * `ModalProps`, which belongs to the `<Modal>` component rather than to any
14
+ * of this.
15
+ * - Inside this folder, import the names directly — you are already here, and
16
+ * the `.vue` files have no choice: `defineProps<T>()` is resolved by
17
+ * `@vue/compiler-sfc` rather than by TypeScript, and it cannot follow a
18
+ * namespace-import alias. `defineProps<Api.AlertModalProps>()` compiles
19
+ * under `vue-tsc` and then fails at build time with "Unresolvable type
20
+ * reference".
21
+ */
22
+ export interface BaseProps {
23
+ visible: boolean;
24
+ }
25
+ export interface GenericModalProps extends BaseProps {
26
+ opts: GenericModalOptions;
27
+ }
28
+ export interface ConfirmModalProps extends BaseProps {
29
+ opts: ConfirmModalOptions;
30
+ }
31
+ export interface AlertModalProps extends BaseProps {
32
+ opts: AlertModalOptions;
33
+ }
34
+ export interface PromptModalProps extends BaseProps {
35
+ opts: PromptModalOptions;
36
+ }
37
+ export interface ModalOptions {
38
+ title?: string;
39
+ onAction?(value?: string): void;
40
+ }
41
+ export interface AlertModalOptions extends ModalOptions {
42
+ primaryActionLabel?: string;
43
+ primaryActionType?: ActionTypeType;
44
+ content?: string | VNode;
45
+ }
46
+ export interface ConfirmModalOptions extends ModalOptions {
47
+ primaryActionLabel?: string;
48
+ primaryActionType?: ActionTypeType;
49
+ secondaryActionLabel?: string;
50
+ content?: string | VNode;
51
+ onConfirm?(): void;
52
+ onCancel?(): void;
53
+ }
54
+ export interface GenericModalOptions extends ModalOptions {
55
+ content?: string | VNode;
56
+ primaryAction?: ModalActionType;
57
+ secondaryActions?: ModalActionType[];
58
+ }
59
+ export interface PromptModalOptions extends ModalOptions {
60
+ content?: string | VNode;
61
+ /**
62
+ * @default "Submit"
63
+ */
64
+ primaryActionLabel?: string;
65
+ /**
66
+ * @default "Cancel"
67
+ */
68
+ secondaryActionLabel?: string;
69
+ /**
70
+ * The default value of the input.
71
+ */
72
+ inputValue?: string;
73
+ /**
74
+ * If set to `true` the input will be a textarea instead of a single line. Pressing enter will create a new line instead of submitting. If you press Command+Enter (MacOS) or Control+Enter (Windows) the prompt will submit.
75
+ */
76
+ multiline?: boolean;
77
+ /**
78
+ * Help text below the input.
79
+ */
80
+ inputHelpText?: string;
81
+ /**
82
+ * The placeholder text for the input.
83
+ */
84
+ inputPlaceholder?: string;
85
+ /**
86
+ * Error message to show below input when `inputValidator` returns `false`
87
+ * (to signify an error but without any specific error message).
88
+ *
89
+ * @default "Invalid value."
90
+ */
91
+ invalidValueText?: string;
92
+ /**
93
+ * Return `true` if the input is valid.
94
+ * Return `false` if invalid.
95
+ * Return a string to use as invalid error message.
96
+ *
97
+ * @default Defaults to a function that prevents empty strings or input
98
+ * that is pure whitespace.
99
+ */
100
+ inputValidator?(input: string): boolean | string;
101
+ onSubmit?(value: string): void;
102
+ onCancel?(): void;
103
+ }
104
+ export interface ModalActionType extends ActionType {
105
+ id?: string;
106
+ }
107
+ export interface ModalEmits {
108
+ (e: 'action', result?: string | boolean): void;
109
+ (e: 'afterLeave'): void;
110
+ }
@@ -0,0 +1,2 @@
1
+ export declare function teardownHost(): void;
2
+ export declare function ensureHost(): void;
@@ -0,0 +1,10 @@
1
+ import { default as Modal } from './Modal.vue';
2
+ import { default as ModalHost } from './ModalHost.vue';
3
+ import type * as Api from './api/types';
4
+ export declare const genericModal: <Result = unknown>(opts: Api.GenericModalOptions) => Promise<Result | undefined>;
5
+ export declare const alertModal: <Result = unknown>(opts: Api.AlertModalOptions) => Promise<Result | undefined>;
6
+ export declare const confirmModal: <Result = boolean>(opts: Api.ConfirmModalOptions) => Promise<Result | undefined>;
7
+ export declare const promptModal: <Result = string>(opts: Api.PromptModalOptions) => Promise<Result | undefined>;
8
+ export { Modal, ModalHost };
9
+ export type { ModalProps } from './types';
10
+ export type { ModalOptions, ModalActionType, AlertModalOptions, ConfirmModalOptions, GenericModalOptions, PromptModalOptions } from './api/types';
@@ -0,0 +1,80 @@
1
+ import { Component, ComputedRef } from 'vue';
2
+ import type * as Api from './api/types';
3
+ /**
4
+ * One open modal. `alertModal()` and friends push one of these and hand back a
5
+ * promise; `<ModalHost>` renders whatever is in the array.
6
+ */
7
+ export interface ModalEntry {
8
+ id: number;
9
+ /** `AlertModal`, `ConfirmModal`, … — always `markRaw`d. */
10
+ component: Component;
11
+ opts: Api.ModalOptions;
12
+ /** Drives the enter/leave transition. Setting it false starts the close. */
13
+ visible: boolean;
14
+ /**
15
+ * Closes this modal the way its own "X" button would — so a confirm resolves
16
+ * `false` rather than `undefined`. Registered by the `<Modal>` inside, since
17
+ * only it knows what closing means for that flavour.
18
+ */
19
+ requestClose?: () => void;
20
+ /** Focuses this modal's dialog. Registered by the `<Modal>` inside. */
21
+ focus?: () => void;
22
+ }
23
+ export interface ModalStackContext {
24
+ /** 0 for the first modal open, 1 for one opened on top of it, and so on. */
25
+ depth: ComputedRef<number>;
26
+ register: (handlers: {
27
+ requestClose: () => void;
28
+ focus: () => void;
29
+ }) => void;
30
+ }
31
+ /** Present when a `<Modal>` is being rendered by a `<ModalHost>`. */
32
+ export declare const MODAL_STACK: unique symbol;
33
+ export declare class ModalManager {
34
+ nextId: number;
35
+ entries: ModalEntry[];
36
+ /** How many `<ModalHost>`s are currently rendering these entries. */
37
+ hosts: number;
38
+ private settled;
39
+ private resolvers;
40
+ private hostWatchers;
41
+ constructor();
42
+ add(component: Component, opts: Api.ModalOptions, resolve: (result?: any) => void): ModalEntry;
43
+ /** Starts the enter transition. Entries are added hidden. */
44
+ show(id: number): void;
45
+ /** Starts the leave transition. The entry goes when the transition ends. */
46
+ hide(id: number): void;
47
+ /**
48
+ * How a `<Modal>` hands back the two things the host cannot work out for
49
+ * itself: what closing means for this flavour of modal, and how to focus it.
50
+ */
51
+ register(id: number, handlers: {
52
+ requestClose: () => void;
53
+ focus: () => void;
54
+ }): void;
55
+ /**
56
+ * Resolves the promise the API handed back. Called on the action, and again
57
+ * as a backstop when the modal leaves — a modal that goes away without an
58
+ * action still has to settle rather than leave its caller awaiting forever.
59
+ */
60
+ settle(id: number, result?: any): void;
61
+ remove(id: number): void;
62
+ /**
63
+ * The modal ESC should close and focus should return to — the last one that
64
+ * is not already on its way out.
65
+ */
66
+ get top(): ModalEntry | undefined;
67
+ addHost(): void;
68
+ removeHost(): void;
69
+ watchHosts(fn: () => void): () => void;
70
+ }
71
+ /**
72
+ * The open modals, shared by every `<ModalHost>`.
73
+ *
74
+ * Each imperative modal used to be its own `createApp` in its own container,
75
+ * which made them independent but left them unable to coordinate: N modals drew
76
+ * N backdrops that compounded into a darker and darker page, stacked at exactly
77
+ * the same coordinates, and each added its own window-level ESC listener, so one
78
+ * Escape closed all of them at once.
79
+ */
80
+ export declare const modals: ModalManager;
@@ -0,0 +1,49 @@
1
+ import type * as Api from './api/types';
2
+ export interface ModalProps {
3
+ visible: boolean;
4
+ title?: string;
5
+ /**
6
+ * Options for the primary action button.
7
+ */
8
+ primaryAction?: Api.ModalActionType;
9
+ /**
10
+ * An array of options for the secondary actions.
11
+ */
12
+ secondaryActions?: Api.ModalActionType[];
13
+ /**
14
+ * An array of options for the tertiary actions. These will show on the left side of the footer.
15
+ */
16
+ tertiaryActions?: Api.ModalActionType[];
17
+ /**
18
+ * Shows a spinner over the whole modal dialog and prevents closing.
19
+ */
20
+ loading?: boolean;
21
+ /**
22
+ * Does not render header section
23
+ */
24
+ noHeader?: boolean;
25
+ /**
26
+ * Style to add to the dialog element, e.g. to set a width, height
27
+ */
28
+ dialogStyle?: Record<string, any>;
29
+ /**
30
+ * Styles for the pre-body slot.
31
+ */
32
+ preBodyStyle?: Record<string, any>;
33
+ /**
34
+ * Styles for the body slot.
35
+ */
36
+ bodyStyle?: Record<string, any>;
37
+ /**
38
+ * Workaround to allow modal body overflow to be visible.
39
+ * Used to prevent popper items that do not use teleport within the modal from being clipped.
40
+ */
41
+ overflowVisible?: boolean;
42
+ /**
43
+ * Invoked when the modal's "X" button is clicked or ESC is pressed. The "X"
44
+ * button and the ESC handler are only rendered when this is defined.
45
+ * NOTE: `@close` compiles down to this same prop, which is why there is no
46
+ * matching entry in the component's `defineEmits` — see Modal.vue.
47
+ */
48
+ onClose?(): void;
49
+ }
@@ -0,0 +1,223 @@
1
+ import { PropType } from 'vue';
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
4
+ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
5
+ label: {
6
+ type: PropType<string | false | null>;
7
+ };
8
+ error: {
9
+ type: PropType<string | false | null>;
10
+ };
11
+ /**
12
+ * Additional help text to display.
13
+ */
14
+ helpText: {
15
+ type: PropType<string | false | null>;
16
+ };
17
+ /**
18
+ * Renders help text as raw HTML. Use with caution.
19
+ */
20
+ helpTextHtml: {
21
+ type: PropType<string | false | null>;
22
+ };
23
+ /**
24
+ * Renders a help icon next to the label which links to an external page.
25
+ */
26
+ helpLink: {
27
+ type: PropType<string | false | null>;
28
+ };
29
+ placeholder: {
30
+ type: StringConstructor;
31
+ };
32
+ title: {
33
+ type: () => string | null;
34
+ };
35
+ description: {
36
+ type: () => string | null;
37
+ };
38
+ disabled: {
39
+ type: BooleanConstructor;
40
+ default: boolean;
41
+ };
42
+ loading: {
43
+ type: BooleanConstructor;
44
+ default: boolean;
45
+ };
46
+ readonly: {
47
+ type: BooleanConstructor;
48
+ default: boolean;
49
+ };
50
+ }>, {}, {}, {
51
+ canFocus(): boolean;
52
+ }, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
53
+ label: {
54
+ type: PropType<string | false | null>;
55
+ };
56
+ error: {
57
+ type: PropType<string | false | null>;
58
+ };
59
+ /**
60
+ * Additional help text to display.
61
+ */
62
+ helpText: {
63
+ type: PropType<string | false | null>;
64
+ };
65
+ /**
66
+ * Renders help text as raw HTML. Use with caution.
67
+ */
68
+ helpTextHtml: {
69
+ type: PropType<string | false | null>;
70
+ };
71
+ /**
72
+ * Renders a help icon next to the label which links to an external page.
73
+ */
74
+ helpLink: {
75
+ type: PropType<string | false | null>;
76
+ };
77
+ placeholder: {
78
+ type: StringConstructor;
79
+ };
80
+ title: {
81
+ type: () => string | null;
82
+ };
83
+ description: {
84
+ type: () => string | null;
85
+ };
86
+ disabled: {
87
+ type: BooleanConstructor;
88
+ default: boolean;
89
+ };
90
+ loading: {
91
+ type: BooleanConstructor;
92
+ default: boolean;
93
+ };
94
+ readonly: {
95
+ type: BooleanConstructor;
96
+ default: boolean;
97
+ };
98
+ }>> & Readonly<{}>, {
99
+ disabled: boolean;
100
+ loading: boolean;
101
+ readonly: boolean;
102
+ }, {}, {
103
+ Icon: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
104
+ icon: {
105
+ type: StringConstructor;
106
+ };
107
+ size: {
108
+ type: StringConstructor;
109
+ };
110
+ contained: {
111
+ type: BooleanConstructor;
112
+ };
113
+ badge: {
114
+ type: PropType<import('../types').IconBadgeStatusType>;
115
+ };
116
+ badgeIcon: {
117
+ type: StringConstructor;
118
+ };
119
+ badgeColor: {
120
+ type: StringConstructor;
121
+ };
122
+ }>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
123
+ [key: string]: any;
124
+ }> | null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
125
+ icon: {
126
+ type: StringConstructor;
127
+ };
128
+ size: {
129
+ type: StringConstructor;
130
+ };
131
+ contained: {
132
+ type: BooleanConstructor;
133
+ };
134
+ badge: {
135
+ type: PropType<import('../types').IconBadgeStatusType>;
136
+ };
137
+ badgeIcon: {
138
+ type: StringConstructor;
139
+ };
140
+ badgeColor: {
141
+ type: StringConstructor;
142
+ };
143
+ }>> & Readonly<{}>, {
144
+ contained: boolean;
145
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
146
+ Labelled: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
147
+ label: {
148
+ type: PropType<string | false | null>;
149
+ required: false;
150
+ };
151
+ error: {
152
+ type: PropType<string | false | null>;
153
+ required: false;
154
+ };
155
+ helpText: {
156
+ type: PropType<string | false | null>;
157
+ required: false;
158
+ };
159
+ helpTextHtml: {
160
+ type: PropType<string | false | null>;
161
+ required: false;
162
+ };
163
+ helpLink: {
164
+ type: PropType<string | false | null>;
165
+ required: false;
166
+ };
167
+ required: {
168
+ type: BooleanConstructor;
169
+ required: false;
170
+ };
171
+ }>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
172
+ [key: string]: any;
173
+ }>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
174
+ label: {
175
+ type: PropType<string | false | null>;
176
+ required: false;
177
+ };
178
+ error: {
179
+ type: PropType<string | false | null>;
180
+ required: false;
181
+ };
182
+ helpText: {
183
+ type: PropType<string | false | null>;
184
+ required: false;
185
+ };
186
+ helpTextHtml: {
187
+ type: PropType<string | false | null>;
188
+ required: false;
189
+ };
190
+ helpLink: {
191
+ type: PropType<string | false | null>;
192
+ required: false;
193
+ };
194
+ required: {
195
+ type: BooleanConstructor;
196
+ required: false;
197
+ };
198
+ }>> & Readonly<{}>, {
199
+ required: boolean;
200
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
201
+ Spinner: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
202
+ color: {
203
+ type: StringConstructor;
204
+ default: string;
205
+ };
206
+ size: {
207
+ type: StringConstructor;
208
+ default: string;
209
+ };
210
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
211
+ color: {
212
+ type: StringConstructor;
213
+ default: string;
214
+ };
215
+ size: {
216
+ type: StringConstructor;
217
+ default: string;
218
+ };
219
+ }>> & Readonly<{}>, {
220
+ size: string;
221
+ color: string;
222
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
223
+ }, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1 @@
1
+ export { default as NavField } from './NavField.vue';
@@ -0,0 +1,47 @@
1
+ import { NavigationProps, NavigationPrimaryItemType } from './types';
2
+ declare var __VLS_6: {
3
+ theme: import('./types').NavigationThemeType;
4
+ }, __VLS_8: {
5
+ theme: import('./types').NavigationThemeType;
6
+ }, __VLS_33: {
7
+ min: boolean;
8
+ };
9
+ type __VLS_Slots = {} & {
10
+ logo?: (props: typeof __VLS_6) => any;
11
+ } & {
12
+ logoMin?: (props: typeof __VLS_8) => any;
13
+ } & {
14
+ footer?: (props: typeof __VLS_33) => any;
15
+ };
16
+ declare const __VLS_base: import('vue').DefineComponent<NavigationProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
17
+ "click-item": (item: NavigationPrimaryItemType, event: MouseEvent) => any;
18
+ "toggle-min": (v: boolean) => any;
19
+ "update:location": (id: string) => any;
20
+ clickLogo: () => any;
21
+ "open-menu": (item: NavigationPrimaryItemType) => any;
22
+ back: () => any;
23
+ }, string, import('vue').PublicProps, Readonly<NavigationProps> & Readonly<{
24
+ "onClick-item"?: ((item: NavigationPrimaryItemType, event: MouseEvent) => any) | undefined;
25
+ "onToggle-min"?: ((v: boolean) => any) | undefined;
26
+ "onUpdate:location"?: ((id: string) => any) | undefined;
27
+ onClickLogo?: (() => any) | undefined;
28
+ "onOpen-menu"?: ((item: NavigationPrimaryItemType) => any) | undefined;
29
+ onBack?: (() => any) | undefined;
30
+ }>, {
31
+ logo: boolean;
32
+ theme: import('./types').NavigationThemeType;
33
+ highlight: boolean | string;
34
+ allowMinimize: boolean;
35
+ preventDefault: boolean;
36
+ backLabel: string;
37
+ minimizePosition: import('./types').NavigationMinimizePositionType;
38
+ accentStripe: boolean | string;
39
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
40
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
41
+ declare const _default: typeof __VLS_export;
42
+ export default _default;
43
+ type __VLS_WithSlots<T, S> = T & {
44
+ new (): {
45
+ $slots: S;
46
+ };
47
+ };
@@ -0,0 +1,10 @@
1
+ import { NavigationItemProps } from '../types';
2
+ declare const __VLS_export: import('vue').DefineComponent<NavigationItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<NavigationItemProps> & Readonly<{}>, {
3
+ min: boolean;
4
+ theme: import('..').NavigationThemeType;
5
+ isSubItem: boolean;
6
+ hasPrimaryIcons: boolean;
7
+ highlight: boolean;
8
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import { NavigationPrimaryItemType, NavigationSectionProps } from '../types';
2
+ declare const __VLS_export: import('vue').DefineComponent<NavigationSectionProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
3
+ "click-item": (item: NavigationPrimaryItemType, event: MouseEvent) => any;
4
+ }, string, import('vue').PublicProps, Readonly<NavigationSectionProps> & Readonly<{
5
+ "onClick-item"?: ((item: NavigationPrimaryItemType, event: MouseEvent) => any) | undefined;
6
+ }>, {
7
+ min: boolean;
8
+ theme: import('..').NavigationThemeType;
9
+ hasPrimaryIcons: boolean;
10
+ highlight: boolean;
11
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export { default as Navigation } from './Navigation.vue';
2
+ export * from './types';
@@ -0,0 +1,117 @@
1
+ export type NavigationThemeType = 'dark' | 'light';
2
+ /**
3
+ * A whole menu an item drills down into — the settings-area pattern, where a
4
+ * click replaces the menu and a Back control returns to the one before.
5
+ */
6
+ export interface NavigationSubMenuType {
7
+ /** Heading shown above the sub-menu's sections, under the Back control. */
8
+ title?: string;
9
+ sections: NavigationSectionType[];
10
+ }
11
+ /**
12
+ * Where the min/max control sits when `allowMinimize` is on.
13
+ *
14
+ * - `edge` — a floating chevron button hugging the sidebar's right edge, and
15
+ * the default: reachable in both states, out of the content's way.
16
+ * - `top` — inline in the title row, beside the logo or title.
17
+ * - `bottom` — a full-width row at the very bottom, below the footer.
18
+ */
19
+ export type NavigationMinimizePositionType = 'edge' | 'top' | 'bottom';
20
+ export interface NavigationProps {
21
+ theme?: NavigationThemeType;
22
+ allowMinimize?: boolean;
23
+ title?: string;
24
+ location?: string;
25
+ sections?: NavigationSectionType[];
26
+ /**
27
+ * Use to stop navigation of links by automatically calling
28
+ * `event.preventDefault` on clicks. Useful programmattic navigation while
29
+ * without needing to remove URLs from item defintiions.
30
+ */
31
+ preventDefault?: boolean;
32
+ /**
33
+ * Reserves the top of the menu for the `logo` slot — and, when minimized,
34
+ * the `logoMin` slot, for a square mark that fits the icon rail.
35
+ */
36
+ logo?: boolean;
37
+ /**
38
+ * Label on the control that leaves a drilled-into sub-menu.
39
+ *
40
+ * @default 'Back'
41
+ */
42
+ backLabel?: string;
43
+ /**
44
+ * Marks the active item with an accent treatment: accent-coloured text and
45
+ * icon, a soft tinted fill, and a bar on the row's left edge. `true` draws
46
+ * it in the primary colour; a CSS colour
47
+ * string (`'#e07a30'`, `'var(--octans-tertiary)'`) draws it in that colour.
48
+ * Also themeable per-container via `--ui-nav-highlightColor`.
49
+ *
50
+ * @default false
51
+ */
52
+ highlight?: boolean | string;
53
+ /**
54
+ * Where the min/max control sits — see `NavigationMinimizePositionType`.
55
+ *
56
+ * @default 'edge'
57
+ */
58
+ minimizePosition?: NavigationMinimizePositionType;
59
+ /**
60
+ * A full-height brand stripe down the menu's far-left edge, so the
61
+ * organisation's colour runs the whole window edge.
62
+ * `true` draws it in the primary colour; a CSS colour string in that colour.
63
+ * Also themeable per-container via `--ui-nav-accentStripeColor`.
64
+ *
65
+ * @default false
66
+ */
67
+ accentStripe?: boolean | string;
68
+ }
69
+ export interface NavigationSectionType {
70
+ id: string;
71
+ title?: string;
72
+ /**
73
+ * An Iconify name shown before the section title. Also what represents the
74
+ * section while the menu is minimized, so sections stay tellable-apart on
75
+ * the icon rail.
76
+ */
77
+ icon?: string;
78
+ action?: {
79
+ icon: string;
80
+ };
81
+ items?: NavigationPrimaryItemType[];
82
+ }
83
+ export interface NavigationSecondaryItemType {
84
+ id: string;
85
+ label: string;
86
+ url?: string;
87
+ badge?: string;
88
+ active?: boolean;
89
+ onAction?: (item: NavigationSecondaryItemType) => void;
90
+ }
91
+ export interface NavigationPrimaryItemType extends NavigationSecondaryItemType {
92
+ icon?: string;
93
+ items?: NavigationSecondaryItemType[];
94
+ /**
95
+ * A whole menu this item drills down into, replacing the current one with a
96
+ * Back control at the top. Clicking the item opens the menu instead of
97
+ * navigating — `url` and `onAction` are ignored when this is set.
98
+ */
99
+ subMenu?: NavigationSubMenuType;
100
+ }
101
+ export interface NavigationSectionProps {
102
+ theme?: NavigationThemeType;
103
+ section: NavigationSectionType;
104
+ location?: string;
105
+ hasPrimaryIcons?: boolean;
106
+ min?: boolean;
107
+ highlight?: boolean;
108
+ }
109
+ export interface NavigationItemProps {
110
+ theme?: NavigationThemeType;
111
+ item: NavigationPrimaryItemType;
112
+ isSubItem?: boolean;
113
+ location?: string;
114
+ hasPrimaryIcons?: boolean;
115
+ min?: boolean;
116
+ highlight?: boolean;
117
+ }