@nubisco/ui 3.2.0 → 3.4.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 (89) hide show
  1. package/dist/components/Board.d.ts +23 -0
  2. package/dist/components/Board.vue.d.ts +16 -8
  3. package/dist/components/Board.vue.d.ts.map +1 -1
  4. package/dist/components/Button.vue.d.ts.map +1 -1
  5. package/dist/components/Charts/GanttChart.vue.d.ts.map +1 -1
  6. package/dist/components/Charts/InterpolationChart.vue.d.ts.map +1 -1
  7. package/dist/components/Charts/shared/palette.d.ts +76 -1
  8. package/dist/components/Charts/shared/palette.d.ts.map +1 -1
  9. package/dist/components/CommandPalette.vue.d.ts.map +1 -1
  10. package/dist/components/Confirm.d.ts +199 -0
  11. package/dist/components/Confirm.env.d.ts +52 -0
  12. package/dist/components/Confirm.env.d.ts.map +1 -0
  13. package/dist/components/Confirm.vue.d.ts +61 -0
  14. package/dist/components/Confirm.vue.d.ts.map +1 -0
  15. package/dist/components/DatePicker.vue.d.ts +1 -1
  16. package/dist/components/InlineEdit.d.ts +24 -0
  17. package/dist/components/InlineEdit.vue.d.ts +20 -0
  18. package/dist/components/InlineEdit.vue.d.ts.map +1 -0
  19. package/dist/components/InlineLoading.d.ts +37 -0
  20. package/dist/components/InlineLoading.vue.d.ts +30 -0
  21. package/dist/components/InlineLoading.vue.d.ts.map +1 -0
  22. package/dist/components/MenuItem.vue.d.ts +1 -1
  23. package/dist/components/Modal.d.ts +35 -1
  24. package/dist/components/Modal.vue.d.ts +10 -1
  25. package/dist/components/Modal.vue.d.ts.map +1 -1
  26. package/dist/components/NotificationCenter.d.ts +184 -0
  27. package/dist/components/NotificationCenter.vue.d.ts +130 -0
  28. package/dist/components/NotificationCenter.vue.d.ts.map +1 -0
  29. package/dist/components/NotificationCenterItem.d.ts +53 -0
  30. package/dist/components/NotificationCenterItem.vue.d.ts +36 -0
  31. package/dist/components/NotificationCenterItem.vue.d.ts.map +1 -0
  32. package/dist/components/ProgressBar.vue.d.ts.map +1 -1
  33. package/dist/components/Shell.d.ts +138 -8
  34. package/dist/components/Shell.vue.d.ts +30 -3
  35. package/dist/components/Shell.vue.d.ts.map +1 -1
  36. package/dist/components/ShellPanel.d.ts +16 -0
  37. package/dist/components/ShellPanel.vue.d.ts +1 -0
  38. package/dist/components/ShellPanel.vue.d.ts.map +1 -1
  39. package/dist/components/SidebarLink.d.ts +14 -1
  40. package/dist/components/Skeleton.d.ts +87 -0
  41. package/dist/components/Skeleton.vue.d.ts +17 -0
  42. package/dist/components/Skeleton.vue.d.ts.map +1 -0
  43. package/dist/components/Spinner.d.ts +80 -0
  44. package/dist/components/Spinner.overlay.d.ts +56 -0
  45. package/dist/components/Spinner.overlay.d.ts.map +1 -0
  46. package/dist/components/Spinner.vue.d.ts +25 -0
  47. package/dist/components/Spinner.vue.d.ts.map +1 -0
  48. package/dist/components/Stepper.context.d.ts +48 -0
  49. package/dist/components/Stepper.context.d.ts.map +1 -0
  50. package/dist/components/Stepper.d.ts +101 -0
  51. package/dist/components/Stepper.vue.d.ts +31 -0
  52. package/dist/components/Stepper.vue.d.ts.map +1 -0
  53. package/dist/components/StepperStep.vue.d.ts +24 -0
  54. package/dist/components/StepperStep.vue.d.ts.map +1 -0
  55. package/dist/components/TextInput.vue.d.ts +2 -2
  56. package/dist/components/TextInput.vue.d.ts.map +1 -1
  57. package/dist/components/Toast.vue.d.ts +43 -0
  58. package/dist/components/Toast.vue.d.ts.map +1 -1
  59. package/dist/components/Toaster.d.ts +93 -0
  60. package/dist/components/Toaster.vue.d.ts +30 -0
  61. package/dist/components/Toaster.vue.d.ts.map +1 -0
  62. package/dist/components/UserMenu.vue.d.ts.map +1 -1
  63. package/dist/components/index.d.ts.map +1 -1
  64. package/dist/composables/useConfirm.composable.d.ts +45 -0
  65. package/dist/composables/useConfirm.composable.d.ts.map +1 -0
  66. package/dist/composables/useInlineLoading.composable.d.ts +43 -0
  67. package/dist/composables/useInlineLoading.composable.d.ts.map +1 -0
  68. package/dist/composables/useLoadingAnnouncer.composable.d.ts +63 -0
  69. package/dist/composables/useLoadingAnnouncer.composable.d.ts.map +1 -0
  70. package/dist/composables/useScrollLock.composable.d.ts +47 -0
  71. package/dist/composables/useScrollLock.composable.d.ts.map +1 -0
  72. package/dist/composables/useShellSlot.composable.d.ts +193 -0
  73. package/dist/composables/useShellSlot.composable.d.ts.map +1 -0
  74. package/dist/composables/useToast.composable.d.ts +325 -0
  75. package/dist/composables/useToast.composable.d.ts.map +1 -0
  76. package/dist/directives/ToolTip.content.d.ts +20 -0
  77. package/dist/directives/ToolTip.content.d.ts.map +1 -0
  78. package/dist/directives/ToolTip.directive.d.ts +94 -8
  79. package/dist/directives/ToolTip.directive.d.ts.map +1 -1
  80. package/dist/global.d.ts +20 -0
  81. package/dist/index.cjs +8 -9
  82. package/dist/index.mjs +13970 -10511
  83. package/dist/main.d.ts +46 -3
  84. package/dist/main.d.ts.map +1 -1
  85. package/dist/ui.css +1 -1
  86. package/package.json +1 -1
  87. package/src/styles/_reset.scss +5 -0
  88. package/src/styles/_theme.scss +171 -0
  89. package/src/styles/directives/_tooltip.scss +143 -21
@@ -0,0 +1,30 @@
1
+ import { EInlineLoadingStatus, IInlineLoadingProps } from './InlineLoading.d';
2
+ declare var __VLS_11: {
3
+ status: "error" | "active" | "inactive" | "finished";
4
+ text: string;
5
+ };
6
+ type __VLS_Slots = {} & {
7
+ default?: (props: typeof __VLS_11) => any;
8
+ };
9
+ declare const __VLS_base: import("vue").DefineComponent<IInlineLoadingProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
10
+ success: () => any;
11
+ }, string, import("vue").PublicProps, Readonly<IInlineLoadingProps> & Readonly<{
12
+ onSuccess?: (() => any) | undefined;
13
+ }>, {
14
+ label: string;
15
+ id: string;
16
+ status: `${EInlineLoadingStatus}`;
17
+ finishedLabel: string;
18
+ errorLabel: string;
19
+ dwell: number;
20
+ reserveSpace: boolean;
21
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
23
+ declare const _default: typeof __VLS_export;
24
+ export default _default;
25
+ type __VLS_WithSlots<T, S> = T & {
26
+ new (): {
27
+ $slots: S;
28
+ };
29
+ };
30
+ //# sourceMappingURL=InlineLoading.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineLoading.vue.d.ts","sourceRoot":"","sources":["../../src/components/InlineLoading.vue"],"names":[],"mappings":"AA+KA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AA4L7E,QAAA,IAAI,QAAQ;;;CAAY,CAAE;AAC1B,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKhD,QAAA,MAAM,UAAU;;;;;;;;;;;;6EAId,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -16,8 +16,8 @@ declare const __VLS_base: import("vue").DefineComponent<IMenuItemProps, {
16
16
  icon: string;
17
17
  selected: boolean;
18
18
  shortcut: string;
19
- selectable: boolean;
20
19
  danger: boolean;
20
+ selectable: boolean;
21
21
  radioGroup: string;
22
22
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
23
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -15,11 +15,45 @@ import { ESizeShort } from '../types/Size.d'
15
15
  */
16
16
  type TModalSize = `${ESizeShort}` | 'xl' | 'immersive'
17
17
 
18
+ /** `dialog` for a place the user chose to go, `alertdialog` for an interruption. */
19
+ type TModalRole = 'dialog' | 'alertdialog'
20
+
18
21
  interface IModalProps {
19
22
  open?: boolean
20
23
  title?: string
21
24
  size?: TModalSize
22
25
  closeOnOverlay?: boolean
26
+ /**
27
+ * ARIA role for the dialog box. `alertdialog` is for a surface that
28
+ * interrupts to report a condition or ask for a decision that cannot wait
29
+ * (NbConfirm's destructive tone uses it); screen readers announce its
30
+ * description on entry rather than waiting to be asked.
31
+ */
32
+ role?: TModalRole
33
+ /**
34
+ * Id of the element that names the dialog. Defaults to the built-in title
35
+ * when `title` or the header slot is used, so the common case needs nothing.
36
+ * Pass your own when the accessible name lives inside the header slot.
37
+ */
38
+ labelledBy?: string
39
+ /** Id of the element that describes the dialog, usually its body. */
40
+ describedBy?: string
41
+ /**
42
+ * Marks the dialog `aria-busy` while work it started is in flight.
43
+ */
44
+ busy?: boolean
45
+ /**
46
+ * Disables the header close control. A dialog that has fired something
47
+ * irreversible must not offer a control that pretends to undo it, and a
48
+ * live button that does nothing is worse than a visibly unavailable one.
49
+ */
50
+ closeDisabled?: boolean
51
+ /**
52
+ * Whether Escape emits `close`. Escape is answered only by the topmost
53
+ * open dialog either way, so a modal underneath keeps its state; set this
54
+ * to `false` when a wrapper (NbConfirm) answers the key itself.
55
+ */
56
+ closeOnEscape?: boolean
23
57
  }
24
58
 
25
- export { IModalProps, TModalSize }
59
+ export { IModalProps, TModalSize, TModalRole }
@@ -7,15 +7,24 @@ type __VLS_Slots = {} & {
7
7
  } & {
8
8
  footer?: (props: typeof __VLS_28) => any;
9
9
  };
10
- declare const __VLS_base: import("vue").DefineComponent<IModalProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ declare const __VLS_base: import("vue").DefineComponent<IModalProps, {
11
+ dialogEl: () => HTMLElement | null;
12
+ bodyEl: () => HTMLElement | null;
13
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
14
  close: () => any;
12
15
  }, string, import("vue").PublicProps, Readonly<IModalProps> & Readonly<{
13
16
  onClose?: (() => any) | undefined;
14
17
  }>, {
15
18
  size: import("./Modal.d").TModalSize;
16
19
  title: string;
20
+ role: import("./Modal.d").TModalRole;
17
21
  open: boolean;
18
22
  closeOnOverlay: boolean;
23
+ labelledBy: string;
24
+ describedBy: string;
25
+ busy: boolean;
26
+ closeDisabled: boolean;
27
+ closeOnEscape: boolean;
19
28
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
29
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
21
30
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.vue.d.ts","sourceRoot":"","sources":["../../src/components/Modal.vue"],"names":[],"mappings":"AA0PA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAuM5C,QAAA,IAAI,QAAQ,IAAW,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AACpE,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAK/C,QAAA,MAAM,UAAU;;;;;;;;;6EAId,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"Modal.vue.d.ts","sourceRoot":"","sources":["../../src/components/Modal.vue"],"names":[],"mappings":"AAsZA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAkV5C,QAAA,IAAI,QAAQ,IAAW,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AACpE,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAQ/C,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;6EAKd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -0,0 +1,184 @@
1
+ import type { IAnchorSize } from '../utils/anchorPosition.helper'
2
+ import type { TNotificationVariant } from './NotificationCenterItem.d'
3
+
4
+ export interface INotificationItem {
5
+ /** Stable key. Reused across refetches so the list does not re-mount. */
6
+ id: string | number
7
+ title: string
8
+ body?: string
9
+ /** ISO string, epoch milliseconds or a Date. */
10
+ time?: string | number | Date
11
+ /** Pre-formatted time, when the host already has one it likes. */
12
+ timeLabel?: string
13
+ read?: boolean
14
+ /** Status word, from the same vocabulary as NbToast and NbMessage. */
15
+ variant?: TNotificationVariant
16
+ icon?: string | null
17
+ /** Renders the row as a link instead of a button. */
18
+ href?: string
19
+ /** Overrides the centre's `interactive` for this one row. `false` makes
20
+ * the row inert: read, not pressed. */
21
+ interactive?: boolean
22
+ }
23
+
24
+ /**
25
+ * Everything a replacement trigger has to carry for the panel to be
26
+ * announced correctly. Handed to the `#trigger` slot and meant to be spread
27
+ * onto whatever element the host renders:
28
+ *
29
+ * ```vue
30
+ * <template #trigger="{ triggerProps, setTriggerRef, toggle, unreadCount }">
31
+ * <NbButton :ref="setTriggerRef" v-bind="triggerProps" @click="toggle" />
32
+ * </template>
33
+ * ```
34
+ *
35
+ * The centre cannot generate these ids for a host it never sees, and a host
36
+ * cannot guess them, so they are passed rather than documented. `aria-label`
37
+ * is a default, not a mandate: bind it after the spread to replace it.
38
+ */
39
+ export interface INotificationTriggerProps {
40
+ id: string
41
+ 'aria-haspopup': 'dialog'
42
+ 'aria-expanded': 'true' | 'false'
43
+ 'aria-controls': string | undefined
44
+ 'aria-label': string
45
+ disabled: boolean | undefined
46
+ }
47
+
48
+ /**
49
+ * Everything the built-in mark-all control binds, as one object, handed to
50
+ * the `#header-actions` slot. A host that replaces the header still gets the
51
+ * pending-safe behaviour (aria-disabled rather than disabled so the in-flight
52
+ * button keeps focus, aria-busy, and a second click that is swallowed instead
53
+ * of firing a second request the host cannot cancel) by spreading this onto
54
+ * its own button rather than re-deriving it:
55
+ *
56
+ * ```vue
57
+ * <template #header-actions="{ markAllProps, markAllText }">
58
+ * <MyFilter v-model="filter" />
59
+ * <button v-bind="markAllProps">{{ markAllText }}</button>
60
+ * </template>
61
+ * ```
62
+ *
63
+ * `onClick` is included, so `v-bind` attaches the handler with it.
64
+ */
65
+ export interface INotificationMarkAllProps {
66
+ type: 'button'
67
+ disabled: boolean
68
+ 'aria-disabled': 'true' | undefined
69
+ 'aria-busy': 'true' | undefined
70
+ onClick: () => void
71
+ }
72
+
73
+ export interface INotificationCenterProps {
74
+ /** The rows. Omit it and use the default slot when the shape of a
75
+ * notification is more than a title, a body and a time. */
76
+ items?: INotificationItem[]
77
+ /** Authoritative unread total, for products that page the list and know a
78
+ * server-side count larger than what is loaded. Defaults to counting
79
+ * `items` where `read` is not true. */
80
+ unreadCount?: number
81
+ /**
82
+ * How many rows are on screen. Required alongside `unreadCount` whenever
83
+ * you fill the default slot, optional otherwise (with `items` the centre
84
+ * counts the array).
85
+ *
86
+ * The centre renders your slot, it does not read it, so it cannot tell an
87
+ * empty feed from a slot you chose not to fill. Without this number the
88
+ * `#empty` state cannot render at all, and `error` resolves to the full
89
+ * error region rather than the stale-data strip, because a failure that
90
+ * might be hiding behind rows is the one thing this component exists to
91
+ * prevent. A dev-mode warning is printed the first time a panel opens in
92
+ * that configuration.
93
+ */
94
+ itemCount?: number
95
+ /** Optional `v-model:open`. Left undefined the centre owns its own state. */
96
+ open?: boolean
97
+ /** Names the trigger and titles the panel. */
98
+ label?: string
99
+ markAllLabel?: string
100
+ /** Shown, and announced, while `markAllPending` is true. Present tense. */
101
+ markAllPendingLabel?: string
102
+ /** The host's mark-all request is in flight. The control keeps focus and
103
+ * stops accepting clicks rather than firing the request again. */
104
+ markAllPending?: boolean
105
+ emptyTitle?: string
106
+ emptyDescription?: string
107
+ /** Announced while `loading` is true. */
108
+ loadingLabel?: string
109
+ /** Renders placeholder rows instead of the list, the empty state or the
110
+ * error state. A request that has not finished is not a result. */
111
+ loading?: boolean
112
+ /**
113
+ * The fetch failed. This is a state of its own and not a flavour of empty:
114
+ * the audit that motivated this component found an app whose single
115
+ * `.empty-text` rendered both, so a failed request read as "no contacts
116
+ * yet". With no rows to show, the panel renders the error state; with rows
117
+ * already on screen it keeps them and says the refresh failed, because
118
+ * stale notifications beat no notifications.
119
+ */
120
+ error?: boolean
121
+ errorTitle?: string
122
+ errorDescription?: string
123
+ /** Shown on the stale strip when a refresh fails over rows already loaded. */
124
+ errorStaleLabel?: string
125
+ retryLabel?: string
126
+ /** Offer a retry control with the error state. Turn it off when the host
127
+ * retries on its own and a button would be a lie. */
128
+ showRetry?: boolean
129
+ /** Counts above this render as "n+" on the badge. */
130
+ maxCount?: number
131
+ /** Panel width in px. */
132
+ width?: number
133
+ /** Tallest the scrolling list may get, in px. Clamped further when the
134
+ * viewport is shorter than that. */
135
+ maxHeight?: number
136
+ /** Which trigger edge the panel lines up with. */
137
+ align?: 'start' | 'end'
138
+ showMarkAll?: boolean
139
+ /**
140
+ * Whether rows are activatable. `false` renders genuinely inert rows: no
141
+ * tabindex, no place in the roving focus, no `select`. Right for a feed
142
+ * with nowhere to go, and when every row is inert the scrolling list
143
+ * becomes the tab stop so a keyboard can still reach the bottom of it.
144
+ */
145
+ interactive?: boolean
146
+ closeOnSelect?: boolean
147
+ /** Close when the page navigates (history back/forward, a hash change, or
148
+ * any navigation the browser reports through the Navigation API). */
149
+ closeOnNavigate?: boolean
150
+ disabled?: boolean
151
+ /** Phosphor icon for the trigger and the empty state. */
152
+ icon?: string
153
+ /** BCP 47 tag for relative times. */
154
+ locale?: string
155
+ unreadLabel?: string
156
+ readLabel?: string
157
+ /** Builds the unread half of the trigger's accessible name. Replace it to
158
+ * translate or to pluralise the way your language actually does. */
159
+ formatUnread?: (count: number) => string
160
+ }
161
+
162
+ export interface IPanelPlacementOptions {
163
+ align: 'start' | 'end'
164
+ /** Panel width in px. */
165
+ width: number
166
+ /** Tallest the scrolling list may get. */
167
+ maxHeight: number
168
+ viewport: IAnchorSize
169
+ }
170
+
171
+ export interface IPanelPlacement {
172
+ /** Viewport (`position: fixed`) coordinates. */
173
+ top: number
174
+ left: number
175
+ /** The side actually used, after any flip. */
176
+ side: 'top' | 'bottom'
177
+ /** What the list may scroll to before it clips, after the viewport clamp. */
178
+ maxListHeight: number
179
+ }
180
+
181
+ /* The placement arithmetic itself (`placeNotificationPanel`,
182
+ * `isAnchorInViewport`) is runtime code and therefore lives in
183
+ * NotificationCenter.vue, which is where it is imported from. Only its
184
+ * argument and result shapes are declared here. */
@@ -0,0 +1,130 @@
1
+ import type { INotificationCenterProps, INotificationItem, INotificationMarkAllProps, INotificationTriggerProps } from './NotificationCenter.d';
2
+ import type { IAnchorRect, IAnchorSize } from '../utils/anchorPosition.helper';
3
+ import type { IPanelPlacement, IPanelPlacementOptions } from './NotificationCenter.d';
4
+ export type { INotificationItem, INotificationTriggerProps, INotificationMarkAllProps, INotificationCenterProps, } from './NotificationCenter.d';
5
+ export type { IPanelPlacement, IPanelPlacementOptions };
6
+ export declare function placeNotificationPanel(anchor: IAnchorRect, { align, width, maxHeight, viewport }: IPanelPlacementOptions): IPanelPlacement;
7
+ /**
8
+ * Whether any part of the trigger is still on screen. A panel is fixed to the
9
+ * viewport, so once the bell it belongs to has scrolled away the panel is
10
+ * floating over content it has nothing to do with, and the honest thing is to
11
+ * let go of it.
12
+ */
13
+ export declare function isAnchorInViewport(anchor: IAnchorRect, viewport: IAnchorSize): boolean;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
16
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<INotificationCenterProps, {
17
+ show: () => void;
18
+ close: (options?: {
19
+ restoreFocus?: boolean;
20
+ }) => void;
21
+ toggle: () => void;
22
+ isOpen: import("vue").ComputedRef<boolean>;
23
+ unreadCount: import("vue").ComputedRef<number>;
24
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
+ select: (item: INotificationItem | null, event: Event) => any;
26
+ close: () => any;
27
+ open: () => any;
28
+ "update:open": (value: boolean) => any;
29
+ "mark-all-read": () => any;
30
+ retry: () => any;
31
+ }, string, import("vue").PublicProps, Readonly<INotificationCenterProps> & Readonly<{
32
+ onSelect?: ((item: INotificationItem | null, event: Event) => any) | undefined;
33
+ onClose?: (() => any) | undefined;
34
+ onOpen?: (() => any) | undefined;
35
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
36
+ "onMark-all-read"?: (() => any) | undefined;
37
+ onRetry?: (() => any) | undefined;
38
+ }>, {
39
+ align: "start" | "end";
40
+ disabled: boolean;
41
+ label: string;
42
+ icon: string;
43
+ maxHeight: number;
44
+ width: number;
45
+ error: boolean;
46
+ items: INotificationItem[];
47
+ loading: boolean;
48
+ locale: string;
49
+ open: boolean;
50
+ interactive: boolean;
51
+ unreadLabel: string;
52
+ readLabel: string;
53
+ unreadCount: number;
54
+ itemCount: number;
55
+ markAllLabel: string;
56
+ markAllPendingLabel: string;
57
+ markAllPending: boolean;
58
+ emptyTitle: string;
59
+ emptyDescription: string;
60
+ loadingLabel: string;
61
+ errorTitle: string;
62
+ errorDescription: string;
63
+ errorStaleLabel: string;
64
+ retryLabel: string;
65
+ showRetry: boolean;
66
+ maxCount: number;
67
+ showMarkAll: boolean;
68
+ closeOnSelect: boolean;
69
+ closeOnNavigate: boolean;
70
+ formatUnread: (count: number) => string;
71
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
72
+ trigger?: (props: {
73
+ open: boolean;
74
+ toggle: () => void;
75
+ show: () => void;
76
+ close: (options?: {
77
+ restoreFocus?: boolean;
78
+ }) => void;
79
+ unreadCount: number;
80
+ badge: string;
81
+ panelId: string;
82
+ triggerProps: INotificationTriggerProps;
83
+ setTriggerRef: (value: Element | {
84
+ $el?: unknown;
85
+ } | null) => void;
86
+ }) => any;
87
+ } & {
88
+ 'header-start'?: (props: {
89
+ close: (options?: {
90
+ restoreFocus?: boolean;
91
+ }) => void;
92
+ unreadCount: number;
93
+ }) => any;
94
+ } & {
95
+ 'header-actions'?: (props: {
96
+ close: (options?: {
97
+ restoreFocus?: boolean;
98
+ }) => void;
99
+ unreadCount: number;
100
+ markAllRead: () => void;
101
+ markAllPending: boolean;
102
+ markAllProps: INotificationMarkAllProps;
103
+ markAllText: string;
104
+ }) => any;
105
+ } & {
106
+ error?: (props: {
107
+ retry: () => void;
108
+ }) => any;
109
+ } & {
110
+ default?: (props: {
111
+ close: (options?: {
112
+ restoreFocus?: boolean;
113
+ }) => void;
114
+ items: INotificationItem[];
115
+ }) => any;
116
+ } & {
117
+ empty?: (props: {}) => any;
118
+ } & {
119
+ footer?: (props: {
120
+ close: (options?: {
121
+ restoreFocus?: boolean;
122
+ }) => void;
123
+ }) => any;
124
+ }>;
125
+ type __VLS_WithSlots<T, S> = T & {
126
+ new (): {
127
+ $slots: S;
128
+ };
129
+ };
130
+ //# sourceMappingURL=NotificationCenter.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationCenter.vue.d.ts","sourceRoot":"","sources":["../../src/components/NotificationCenter.vue"],"names":[],"mappings":"AAk5CA,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EACjB,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAA;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC7E,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACvB,MAAM,wBAAwB,CAAA;AAK/B,YAAY,EACV,iBAAiB,EACjB,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,wBAAwB,CAAA;AAC/B,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,CAAA;AAuCvD,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,WAAW,EACnB,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,sBAAsB,GAC5D,eAAe,CA4BjB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,WAAW,GACpB,OAAO,CAOT;wBACoB,OAAO,YAAY;AAAxC,wBAAyC;AACzC,QAAA,MAAM,YAAY;;sBAgSM;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAo6BpC,CAAC,KAAK;;;;0BAp6BI;YAAE,YAAY,CAAC,EAAE,OAAO,CAAA;SAAE;;;;;+BAvEpB,OAAO,GAAG;YAAE,GAAG,CAAC,EAAE,OAAO,CAAA;SAAE,GAAG,IAAI,KAAG,IAAI;KA2+BnC,KAAK,GAAG;;qBACvB,CAAC,KAAK;0BAr6BH;YAAE,YAAY,CAAC,EAAE,OAAO,CAAA;SAAE;;KAq6BN,KAAK,GAAG;;uBAC7B,CAAC,KAAK;0BAt6BL;YAAE,YAAY,CAAC,EAAE,OAAO,CAAA;SAAE;;;;;;KAs6BJ,KAAK,GAAG;;YAC1C,CAAC,KAAK;;KAAiB,KAAK,GAAG;;cAC7B,CAAC,KAAK;0BAx6BI;YAAE,YAAY,CAAC,EAAE,OAAO,CAAA;SAAE;;KAw6Bb,KAAK,GAAG;;YACjC,CAAC,KAAK,IAAiB,KAAK,GAAG;;aAC9B,CAAC,KAAK;0BA16BK;YAAE,YAAY,CAAC,EAAE,OAAO,CAAA;SAAE;KA06Bd,KAAK,GAAG;EAgBxC,CAAC;AAWL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * The fleet's status vocabulary, the same five words NbToast, NbMessage and
3
+ * NbBanner use. `error`, not `danger`: `danger` is the word for a destructive
4
+ * ACTION (NbButton, NbConfirm), and the audit found an app passing
5
+ * variant="danger" to NbMessage, which does not accept it, precisely because
6
+ * the two vocabularies had drifted. `danger` is accepted here and treated as
7
+ * `error` so that app's habit does not silently render an unstyled row, but it
8
+ * is deprecated and not the documented value.
9
+ */
10
+ export type TNotificationStatus =
11
+ | 'neutral'
12
+ | 'info'
13
+ | 'success'
14
+ | 'warning'
15
+ | 'error'
16
+
17
+ /** @deprecated Use TNotificationStatus. */
18
+ export type TNotificationVariant = TNotificationStatus | 'danger'
19
+
20
+ export interface INotificationCenterItemProps {
21
+ /** Headline of the notification. One line, no trailing punctuation. */
22
+ title?: string
23
+ /** Supporting sentence. Wraps to at most three lines before it is clipped. */
24
+ body?: string
25
+ /** When the event happened. Rendered as a `<time>` with a machine-readable
26
+ * `datetime`, and formatted relative to now unless `timeLabel` is given. */
27
+ time?: string | number | Date
28
+ /** A ready-made time string. Use it when the host app already formats
29
+ * timestamps its own way, and this component should not second-guess it. */
30
+ timeLabel?: string
31
+ /** Read notifications lose the dot, the tint and the heavier title. */
32
+ read?: boolean
33
+ /** Colours the leading icon. It does not change the unread affordance,
34
+ * which stays one shape everywhere so it can be learned once. Values are
35
+ * the library's status words: neutral, info, success, warning, error. */
36
+ variant?: TNotificationVariant
37
+ /** Phosphor icon name. `null` renders no icon and no icon gutter. */
38
+ icon?: string | null
39
+ /** Renders the row as a link. Takes priority over `interactive`. */
40
+ href?: string
41
+ /**
42
+ * A row that leads somewhere is a `<button>` (or an `<a>`, with `href`).
43
+ * A row that leads nowhere is `false` here, and then it is genuinely inert:
44
+ * a plain element with no tabindex, outside the panel's roving focus, and
45
+ * it never emits `select`. Not "a button that looks quieter".
46
+ */
47
+ interactive?: boolean
48
+ /** BCP 47 tag for the relative time. Defaults to the runtime locale. */
49
+ locale?: string
50
+ /** Visually hidden state words, translated by the host. */
51
+ unreadLabel?: string
52
+ readLabel?: string
53
+ }
@@ -0,0 +1,36 @@
1
+ import type { INotificationCenterItemProps } from './NotificationCenterItem.d';
2
+ export type { TNotificationStatus, TNotificationVariant, INotificationCenterItemProps, } from './NotificationCenterItem.d';
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
5
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<INotificationCenterItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ select: (event: Event) => any;
7
+ }, string, import("vue").PublicProps, Readonly<INotificationCenterItemProps> & Readonly<{
8
+ onSelect?: ((event: Event) => any) | undefined;
9
+ }>, {
10
+ body: string;
11
+ time: string | number | Date;
12
+ title: string;
13
+ icon: string | null;
14
+ variant: import("./NotificationCenterItem.d").TNotificationVariant;
15
+ href: string;
16
+ locale: string;
17
+ timeLabel: string;
18
+ read: boolean;
19
+ interactive: boolean;
20
+ unreadLabel: string;
21
+ readLabel: string;
22
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
23
+ media?: (props: {}) => any;
24
+ } & {
25
+ title?: (props: {}) => any;
26
+ } & {
27
+ default?: (props: {}) => any;
28
+ } & {
29
+ actions?: (props: {}) => any;
30
+ }>;
31
+ type __VLS_WithSlots<T, S> = T & {
32
+ new (): {
33
+ $slots: S;
34
+ };
35
+ };
36
+ //# sourceMappingURL=NotificationCenterItem.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationCenterItem.vue.d.ts","sourceRoot":"","sources":["../../src/components/NotificationCenterItem.vue"],"names":[],"mappings":"AA+aA,OAAO,KAAK,EACV,4BAA4B,EAE7B,MAAM,4BAA4B,CAAA;AAOnC,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,4BAA4B,CAAA;wBACd,OAAO,YAAY;AAAxC,wBAAyC;AACzC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;YA0SN,CAAC,KAAK,IAAgB,KAAK,GAAG;;YAC9B,CAAC,KAAK,IAAiB,KAAK,GAAG;;cAC7B,CAAC,KAAK,IAAiB,KAAK,GAAG;;cAC/B,CAAC,KAAK,IAAiB,KAAK,GAAG;EAWzC,CAAC;AAWL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.vue.d.ts","sourceRoot":"","sources":["../../src/components/ProgressBar.vue"],"names":[],"mappings":"AAkMA,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,iBAAiB,CAAA;AAgKxB,QAAA,MAAM,YAAY;;;;;;;6EAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"ProgressBar.vue.d.ts","sourceRoot":"","sources":["../../src/components/ProgressBar.vue"],"names":[],"mappings":"AAyNA,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,iBAAiB,CAAA;AAgKxB,QAAA,MAAM,YAAY;;;;;;;6EAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}