frontile 0.18.0-alpha.3 → 0.18.0-alpha.5

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 (288) hide show
  1. package/declarations/-private/dom.d.ts +3 -0
  2. package/declarations/-private/get-config.d.ts +2 -0
  3. package/declarations/-private/manager.d.ts +13 -0
  4. package/declarations/-private/notification.d.ts +15 -0
  5. package/declarations/-private/timer.d.ts +12 -0
  6. package/declarations/-private/types.d.ts +60 -0
  7. package/declarations/buttons.d.ts +1 -0
  8. package/declarations/collections.d.ts +1 -0
  9. package/declarations/components/buttons/button-group.d.ts +24 -0
  10. package/declarations/components/buttons/button.d.ts +59 -0
  11. package/declarations/components/buttons/chip.d.ts +54 -0
  12. package/declarations/components/buttons/close-button.d.ts +55 -0
  13. package/declarations/components/buttons/index.d.ts +5 -0
  14. package/declarations/components/buttons/toggle-button.d.ts +28 -0
  15. package/declarations/components/collections/dropdown.d.ts +99 -0
  16. package/declarations/components/collections/index.d.ts +3 -0
  17. package/declarations/components/collections/listbox/item.d.ts +51 -0
  18. package/declarations/components/collections/listbox/listbox.d.ts +75 -0
  19. package/declarations/components/collections/listbox.d.ts +2 -0
  20. package/declarations/components/collections/simple-table/body.d.ts +428 -0
  21. package/declarations/components/collections/simple-table/cell.d.ts +427 -0
  22. package/declarations/components/collections/simple-table/column.d.ts +419 -0
  23. package/declarations/components/collections/simple-table/footer.d.ts +430 -0
  24. package/declarations/components/collections/simple-table/header.d.ts +430 -0
  25. package/declarations/components/collections/simple-table/index.d.ts +446 -0
  26. package/declarations/components/collections/simple-table/row.d.ts +430 -0
  27. package/declarations/components/collections/table/cell-default.d.ts +43 -0
  28. package/declarations/components/collections/table/cell-for.d.ts +38 -0
  29. package/declarations/components/collections/table/cell-rendering-context.d.ts +24 -0
  30. package/declarations/components/collections/table/checkbox.d.ts +50 -0
  31. package/declarations/components/collections/table/column-visibility.d.ts +416 -0
  32. package/declarations/components/collections/table/icons.d.ts +11 -0
  33. package/declarations/components/collections/table/index.d.ts +4 -0
  34. package/declarations/components/collections/table/sort-button.d.ts +413 -0
  35. package/declarations/components/collections/table/table.d.ts +555 -0
  36. package/declarations/components/collections/table/types.d.ts +46 -0
  37. package/declarations/components/collections/table/utils.d.ts +6 -0
  38. package/declarations/components/collections/table.d.ts +2 -0
  39. package/declarations/components/forms/checkbox-group.d.ts +42 -0
  40. package/declarations/components/forms/checkbox.d.ts +40 -0
  41. package/declarations/components/forms/field-types.d.ts +14 -0
  42. package/declarations/components/forms/field.d.ts +85 -0
  43. package/declarations/components/forms/form-control.d.ts +47 -0
  44. package/declarations/components/forms/form-description.d.ts +18 -0
  45. package/declarations/components/forms/form-feedback.d.ts +22 -0
  46. package/declarations/components/forms/form.d.ts +254 -0
  47. package/declarations/components/forms/icons.d.ts +7 -0
  48. package/declarations/components/forms/index.d.ts +18 -0
  49. package/declarations/components/forms/input.d.ts +145 -0
  50. package/declarations/components/forms/label.d.ts +40 -0
  51. package/declarations/components/forms/native-select.d.ts +154 -0
  52. package/declarations/components/forms/radio-group.d.ts +43 -0
  53. package/declarations/components/forms/radio.d.ts +41 -0
  54. package/declarations/components/forms/select.d.ts +531 -0
  55. package/declarations/components/forms/switch.d.ts +152 -0
  56. package/declarations/components/forms/textarea.d.ts +69 -0
  57. package/declarations/components/notifications/index.d.ts +9 -0
  58. package/declarations/components/notifications/notification-card.d.ts +49 -0
  59. package/declarations/components/notifications/notifications-container.d.ts +46 -0
  60. package/declarations/components/overlays/backdrop.d.ts +39 -0
  61. package/declarations/components/overlays/drawer/body.d.ts +17 -0
  62. package/declarations/components/overlays/drawer/footer.d.ts +17 -0
  63. package/declarations/components/overlays/drawer/header.d.ts +21 -0
  64. package/declarations/components/overlays/drawer.d.ts +125 -0
  65. package/declarations/components/overlays/index.d.ts +12 -0
  66. package/declarations/components/overlays/modal/body.d.ts +17 -0
  67. package/declarations/components/overlays/modal/footer.d.ts +17 -0
  68. package/declarations/components/overlays/modal/header.d.ts +21 -0
  69. package/declarations/components/overlays/modal.d.ts +124 -0
  70. package/declarations/components/overlays/overlay.d.ts +161 -0
  71. package/declarations/components/overlays/popover.d.ts +165 -0
  72. package/declarations/components/overlays/portal-target.d.ts +15 -0
  73. package/declarations/components/overlays/portal.d.ts +38 -0
  74. package/declarations/components/status/index.d.ts +1 -0
  75. package/declarations/components/status/progress-bar.d.ts +90 -0
  76. package/declarations/components/utilities/avatar.d.ts +90 -0
  77. package/declarations/components/utilities/collapsible.d.ts +45 -0
  78. package/declarations/components/utilities/divider.d.ts +11 -0
  79. package/declarations/components/utilities/index.d.ts +9 -0
  80. package/declarations/components/utilities/spinner.d.ts +18 -0
  81. package/declarations/components/utilities/visually-hidden.d.ts +9 -0
  82. package/declarations/forms.d.ts +1 -0
  83. package/declarations/index.d.ts +7 -7
  84. package/declarations/modifiers/press.d.ts +55 -0
  85. package/declarations/notifications.d.ts +1 -0
  86. package/declarations/overlays.d.ts +1 -0
  87. package/declarations/services/notifications.d.ts +19 -0
  88. package/declarations/status.d.ts +1 -0
  89. package/declarations/template-registry.d.ts +40 -2
  90. package/declarations/test-support.d.ts +2 -0
  91. package/declarations/utilities.d.ts +1 -0
  92. package/declarations/utils/forms-utils-index.d.ts +3 -0
  93. package/declarations/utils/listManager.d.ts +74 -0
  94. package/declarations/utils/nested-data.d.ts +44 -0
  95. package/declarations/utils/ref.d.ts +14 -0
  96. package/declarations/utils/safe-styles.d.ts +2 -0
  97. package/declarations/utils/standard-validator.d.ts +151 -0
  98. package/declarations/utils/toggle.d.ts +9 -0
  99. package/dist/_app_/services/notifications.js +1 -0
  100. package/dist/buttons.js +6 -0
  101. package/dist/buttons.js.map +1 -0
  102. package/dist/collections.js +6 -0
  103. package/dist/collections.js.map +1 -0
  104. package/dist/components/buttons/button-group.js +31 -0
  105. package/dist/components/buttons/button-group.js.map +1 -0
  106. package/dist/components/buttons/button.js +55 -0
  107. package/dist/components/buttons/button.js.map +1 -0
  108. package/dist/components/buttons/chip.js +44 -0
  109. package/dist/components/buttons/chip.js.map +1 -0
  110. package/dist/components/buttons/close-button.js +84 -0
  111. package/dist/components/buttons/close-button.js.map +1 -0
  112. package/dist/components/buttons/index.js +6 -0
  113. package/dist/components/buttons/index.js.map +1 -0
  114. package/dist/components/buttons/toggle-button.js +40 -0
  115. package/dist/components/buttons/toggle-button.js.map +1 -0
  116. package/dist/components/collections/dropdown.js +94 -0
  117. package/dist/components/collections/dropdown.js.map +1 -0
  118. package/dist/components/collections/index.js +6 -0
  119. package/dist/components/collections/index.js.map +1 -0
  120. package/dist/components/collections/listbox/item.js +104 -0
  121. package/dist/components/collections/listbox/item.js.map +1 -0
  122. package/dist/components/collections/listbox/listbox.js +109 -0
  123. package/dist/components/collections/listbox/listbox.js.map +1 -0
  124. package/dist/components/collections/listbox.js +3 -0
  125. package/dist/components/collections/listbox.js.map +1 -0
  126. package/dist/components/collections/simple-table/body.js +32 -0
  127. package/dist/components/collections/simple-table/body.js.map +1 -0
  128. package/dist/components/collections/simple-table/cell.js +27 -0
  129. package/dist/components/collections/simple-table/cell.js.map +1 -0
  130. package/dist/components/collections/simple-table/column.js +26 -0
  131. package/dist/components/collections/simple-table/column.js.map +1 -0
  132. package/dist/components/collections/simple-table/footer.js +44 -0
  133. package/dist/components/collections/simple-table/footer.js.map +1 -0
  134. package/dist/components/collections/simple-table/header.js +44 -0
  135. package/dist/components/collections/simple-table/header.js.map +1 -0
  136. package/dist/components/collections/simple-table/index.js +60 -0
  137. package/dist/components/collections/simple-table/index.js.map +1 -0
  138. package/dist/components/collections/simple-table/row.js +33 -0
  139. package/dist/components/collections/simple-table/row.js.map +1 -0
  140. package/dist/components/collections/table/cell-default.js +39 -0
  141. package/dist/components/collections/table/cell-default.js.map +1 -0
  142. package/dist/components/collections/table/cell-for.js +34 -0
  143. package/dist/components/collections/table/cell-for.js.map +1 -0
  144. package/dist/components/collections/table/cell-rendering-context.js +39 -0
  145. package/dist/components/collections/table/cell-rendering-context.js.map +1 -0
  146. package/dist/components/collections/table/checkbox.js +53 -0
  147. package/dist/components/collections/table/checkbox.js.map +1 -0
  148. package/dist/components/collections/table/column-visibility.js +58 -0
  149. package/dist/components/collections/table/column-visibility.js.map +1 -0
  150. package/dist/components/collections/table/icons.js +19 -0
  151. package/dist/components/collections/table/icons.js.map +1 -0
  152. package/dist/components/collections/table/index.js +3 -0
  153. package/dist/components/collections/table/index.js.map +1 -0
  154. package/dist/components/collections/table/sort-button.js +32 -0
  155. package/dist/components/collections/table/sort-button.js.map +1 -0
  156. package/dist/components/collections/table/table.js +442 -0
  157. package/dist/components/collections/table/table.js.map +1 -0
  158. package/dist/components/collections/table/types.js +2 -0
  159. package/dist/components/collections/table/types.js.map +1 -0
  160. package/dist/components/collections/table/utils.js +19 -0
  161. package/dist/components/collections/table/utils.js.map +1 -0
  162. package/dist/components/collections/table.js +3 -0
  163. package/dist/components/collections/table.js.map +1 -0
  164. package/dist/components/forms/checkbox-group.js +29 -0
  165. package/dist/components/forms/checkbox-group.js.map +1 -0
  166. package/dist/components/forms/checkbox.js +50 -0
  167. package/dist/components/forms/checkbox.js.map +1 -0
  168. package/dist/components/forms/field-types.js +2 -0
  169. package/dist/components/forms/field-types.js.map +1 -0
  170. package/dist/components/forms/field.js +103 -0
  171. package/dist/components/forms/field.js.map +1 -0
  172. package/dist/components/forms/form-control.js +61 -0
  173. package/dist/components/forms/form-control.js.map +1 -0
  174. package/dist/components/forms/form-description.js +24 -0
  175. package/dist/components/forms/form-description.js.map +1 -0
  176. package/dist/components/forms/form-feedback.js +36 -0
  177. package/dist/components/forms/form-feedback.js.map +1 -0
  178. package/dist/components/forms/form.js +393 -0
  179. package/dist/components/forms/form.js.map +1 -0
  180. package/dist/components/forms/icons.js +13 -0
  181. package/dist/components/forms/icons.js.map +1 -0
  182. package/dist/components/forms/index.js +18 -0
  183. package/dist/components/forms/index.js.map +1 -0
  184. package/dist/components/forms/input.js +106 -0
  185. package/dist/components/forms/input.js.map +1 -0
  186. package/dist/components/forms/label.js +23 -0
  187. package/dist/components/forms/label.js.map +1 -0
  188. package/dist/components/forms/native-select.js +134 -0
  189. package/dist/components/forms/native-select.js.map +1 -0
  190. package/dist/components/forms/radio-group.js +29 -0
  191. package/dist/components/forms/radio-group.js.map +1 -0
  192. package/dist/components/forms/radio.js +49 -0
  193. package/dist/components/forms/radio.js.map +1 -0
  194. package/dist/components/forms/select.js +388 -0
  195. package/dist/components/forms/select.js.map +1 -0
  196. package/dist/components/forms/switch.js +63 -0
  197. package/dist/components/forms/switch.js.map +1 -0
  198. package/dist/components/forms/textarea.js +53 -0
  199. package/dist/components/forms/textarea.js.map +1 -0
  200. package/dist/components/notifications/index.js +5 -0
  201. package/dist/components/notifications/index.js.map +1 -0
  202. package/dist/components/notifications/notification-card.js +109 -0
  203. package/dist/components/notifications/notification-card.js.map +1 -0
  204. package/dist/components/notifications/notifications-container.js +61 -0
  205. package/dist/components/notifications/notifications-container.js.map +1 -0
  206. package/dist/components/overlays/backdrop.js +44 -0
  207. package/dist/components/overlays/backdrop.js.map +1 -0
  208. package/dist/components/overlays/drawer/body.js +18 -0
  209. package/dist/components/overlays/drawer/body.js.map +1 -0
  210. package/dist/components/overlays/drawer/footer.js +18 -0
  211. package/dist/components/overlays/drawer/footer.js.map +1 -0
  212. package/dist/components/overlays/drawer/header.js +18 -0
  213. package/dist/components/overlays/drawer/header.js.map +1 -0
  214. package/dist/components/overlays/drawer.js +61 -0
  215. package/dist/components/overlays/drawer.js.map +1 -0
  216. package/dist/components/overlays/index.js +13 -0
  217. package/dist/components/overlays/index.js.map +1 -0
  218. package/dist/components/overlays/modal/body.js +18 -0
  219. package/dist/components/overlays/modal/body.js.map +1 -0
  220. package/dist/components/overlays/modal/footer.js +18 -0
  221. package/dist/components/overlays/modal/footer.js.map +1 -0
  222. package/dist/components/overlays/modal/header.js +18 -0
  223. package/dist/components/overlays/modal/header.js.map +1 -0
  224. package/dist/components/overlays/modal.js +61 -0
  225. package/dist/components/overlays/modal.js.map +1 -0
  226. package/dist/components/overlays/overlay.js +206 -0
  227. package/dist/components/overlays/overlay.js.map +1 -0
  228. package/dist/components/overlays/popover.js +232 -0
  229. package/dist/components/overlays/popover.js.map +1 -0
  230. package/dist/components/overlays/portal-target.js +10 -0
  231. package/dist/components/overlays/portal-target.js.map +1 -0
  232. package/dist/components/overlays/portal.js +9 -0
  233. package/dist/components/overlays/portal.js.map +1 -0
  234. package/dist/components/status/index.js +2 -0
  235. package/dist/components/status/index.js.map +1 -0
  236. package/dist/components/status/progress-bar.js +85 -0
  237. package/dist/components/status/progress-bar.js.map +1 -0
  238. package/dist/components/utilities/avatar.js +48 -0
  239. package/dist/components/utilities/avatar.js.map +1 -0
  240. package/dist/components/utilities/collapsible.js +112 -0
  241. package/dist/components/utilities/collapsible.js.map +1 -0
  242. package/dist/components/utilities/divider.js +31 -0
  243. package/dist/components/utilities/divider.js.map +1 -0
  244. package/dist/components/utilities/index.js +10 -0
  245. package/dist/components/utilities/index.js.map +1 -0
  246. package/dist/components/utilities/spinner.js +14 -0
  247. package/dist/components/utilities/spinner.js.map +1 -0
  248. package/dist/components/utilities/visually-hidden.js +10 -0
  249. package/dist/components/utilities/visually-hidden.js.map +1 -0
  250. package/dist/forms.js +18 -0
  251. package/dist/forms.js.map +1 -0
  252. package/dist/index.js +53 -7
  253. package/dist/index.js.map +1 -1
  254. package/dist/manager-C1Vyhk-A.js +175 -0
  255. package/dist/manager-C1Vyhk-A.js.map +1 -0
  256. package/dist/modifiers/press.js +286 -0
  257. package/dist/modifiers/press.js.map +1 -0
  258. package/dist/notifications.js +5 -0
  259. package/dist/notifications.js.map +1 -0
  260. package/dist/overlays.js +13 -0
  261. package/dist/overlays.js.map +1 -0
  262. package/dist/portal-BTKv9EEY.js +168 -0
  263. package/dist/portal-BTKv9EEY.js.map +1 -0
  264. package/dist/runtime-BPCpkOf1-B5Lbloj7.js +67 -0
  265. package/dist/runtime-BPCpkOf1-B5Lbloj7.js.map +1 -0
  266. package/dist/services/notifications.js +35 -0
  267. package/dist/services/notifications.js.map +1 -0
  268. package/dist/status.js +2 -0
  269. package/dist/status.js.map +1 -0
  270. package/dist/test-support.js +1337 -0
  271. package/dist/test-support.js.map +1 -0
  272. package/dist/utilities.js +10 -0
  273. package/dist/utilities.js.map +1 -0
  274. package/dist/utils/forms-utils-index.js +24 -0
  275. package/dist/utils/forms-utils-index.js.map +1 -0
  276. package/dist/utils/listManager.js +374 -0
  277. package/dist/utils/listManager.js.map +1 -0
  278. package/dist/utils/nested-data.js +137 -0
  279. package/dist/utils/nested-data.js.map +1 -0
  280. package/dist/utils/ref.js +32 -0
  281. package/dist/utils/ref.js.map +1 -0
  282. package/dist/utils/safe-styles.js +15 -0
  283. package/dist/utils/safe-styles.js.map +1 -0
  284. package/dist/utils/standard-validator.js +202 -0
  285. package/dist/utils/standard-validator.js.map +1 -0
  286. package/dist/utils/toggle.js +46 -0
  287. package/dist/utils/toggle.js.map +1 -0
  288. package/package.json +59 -14
@@ -0,0 +1,3 @@
1
+ export declare function getDOM(context: object): Document | null;
2
+ export declare function getElementById(doc: Document | Element, id: string): null | Element;
3
+ export declare function getElementByAttribute(doc: Document | Element, attribute: string, value?: string | undefined): null | Element;
@@ -0,0 +1,2 @@
1
+ import type { DefaultConfig } from './types';
2
+ export declare function getConfigOption<T extends keyof DefaultConfig>(config: DefaultConfig, key: T, defaultValue: NonNullable<DefaultConfig[T]>): NonNullable<DefaultConfig[T]>;
@@ -0,0 +1,13 @@
1
+ import Notification from './notification';
2
+ import type { DefaultConfig } from './types';
3
+ import type { NotificationOptions } from './types';
4
+ export default class NotificationsManager {
5
+ notifications: Notification<Record<string, unknown>>[];
6
+ config: DefaultConfig;
7
+ onRemove?: (notification: Notification<Record<string, unknown>>) => void;
8
+ constructor(context: object, onRemove?: (notification: Notification<Record<string, unknown>>) => void);
9
+ add<TMetadata extends Record<string, unknown> = Record<string, unknown>>(message: string, options?: NotificationOptions<TMetadata>): Notification<TMetadata>;
10
+ remove(notification?: Notification<Record<string, unknown>>): void;
11
+ removeAll(): void;
12
+ private setupAutoRemoval;
13
+ }
@@ -0,0 +1,15 @@
1
+ import Timer from './timer';
2
+ import type { NotificationOptions, CustomAction, DefaultConfig } from './types';
3
+ export default class Notification<TMetadata extends Record<string, unknown> = Record<string, unknown>> {
4
+ readonly message: string;
5
+ readonly transitionDuration: number;
6
+ readonly appearance: NonNullable<NotificationOptions['appearance']>;
7
+ readonly customActions?: CustomAction[];
8
+ readonly allowClosing: boolean;
9
+ readonly duration: number;
10
+ readonly metadata?: TMetadata;
11
+ timer?: Timer;
12
+ isRemoving: boolean;
13
+ constructor(config: DefaultConfig, message: string, options?: NotificationOptions<TMetadata>);
14
+ remove(): void;
15
+ }
@@ -0,0 +1,12 @@
1
+ export default class Timer {
2
+ remaining: number;
3
+ isRunning: boolean;
4
+ readonly onFinish: () => void;
5
+ private timer?;
6
+ private start;
7
+ constructor(duration: number, onFinish: () => void);
8
+ clear(): void;
9
+ pause(): void;
10
+ resume(): void;
11
+ private setup;
12
+ }
@@ -0,0 +1,60 @@
1
+ export type containerPlacement = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
2
+ export interface CustomAction {
3
+ /**
4
+ * The label of the action
5
+ */
6
+ label: string;
7
+ /**
8
+ * The function to be called when clicked
9
+ */
10
+ onClick: () => void;
11
+ }
12
+ export interface NotificationOptions<TMetadata extends Record<string, unknown> = Record<string, unknown>> {
13
+ /**
14
+ * If set to false, the close button will not be displayed.
15
+ *
16
+ * @defaultValue true
17
+ */
18
+ allowClosing?: boolean;
19
+ /**
20
+ * Preserve the notification open, no auto-dismiss.
21
+ *
22
+ * @defaultValue false
23
+ */
24
+ preserve?: boolean;
25
+ /**
26
+ * Duration before the notification is auto-dismissed, in milliseconds.
27
+ *
28
+ * @defaultValue 5000
29
+ */
30
+ duration?: number;
31
+ transitionDuration?: number;
32
+ /**
33
+ * The appearance of the notification
34
+ *
35
+ * @defaultValue 'info'
36
+ */
37
+ appearance?: 'info' | 'success' | 'warning' | 'error';
38
+ /**
39
+ * A list of custom actions
40
+ *
41
+ * @defaultValue undefined
42
+ */
43
+ customActions?: CustomAction[];
44
+ /**
45
+ * Additional metadata to attach to the notification
46
+ *
47
+ * @defaultValue undefined
48
+ */
49
+ metadata?: TMetadata;
50
+ }
51
+ export interface DefaultConfig extends NotificationOptions {
52
+ /**
53
+ * If set to true, we will preserve the notification, therefore skiping the timer.
54
+ * This is useful in tests because Ember will wait for any runloop to
55
+ * finish before proceeding.
56
+ *
57
+ * @defaultValue false
58
+ */
59
+ skipTimer?: boolean;
60
+ }
@@ -0,0 +1 @@
1
+ export * from './components/buttons';
@@ -0,0 +1 @@
1
+ export * from './components/collections';
@@ -0,0 +1,24 @@
1
+ import Component from '@glimmer/component';
2
+ import { type ButtonSignature } from './button';
3
+ import type { ButtonArgs } from './button';
4
+ import { type ToggleButtonSignature } from './toggle-button';
5
+ import type { ComponentLike, WithBoundArgs } from '@glint/template';
6
+ interface ButtonGroupArgs extends Pick<ButtonArgs, 'appearance' | 'intent' | 'size' | 'class'> {
7
+ }
8
+ interface ButtonGroupSignature {
9
+ Args: ButtonGroupArgs;
10
+ Blocks: {
11
+ default: [
12
+ {
13
+ Button: WithBoundArgs<ComponentLike<ButtonSignature>, 'isInGroup'>;
14
+ ToggleButton: WithBoundArgs<ComponentLike<ToggleButtonSignature>, 'isInGroup'>;
15
+ }
16
+ ];
17
+ };
18
+ Element: HTMLDivElement;
19
+ }
20
+ declare class ButtonGroup extends Component<ButtonGroupSignature> {
21
+ get classNames(): string;
22
+ }
23
+ export { ButtonGroup, type ButtonGroupSignature };
24
+ export default ButtonGroup;
@@ -0,0 +1,59 @@
1
+ import Component from '@glimmer/component';
2
+ import { type PressEvent } from '../../modifiers/press';
3
+ export interface ButtonArgs {
4
+ /**
5
+ * The HTML type of the button
6
+ *
7
+ * @defaultValue 'button'
8
+ */
9
+ type?: 'button' | 'submit' | 'reset';
10
+ /**
11
+ * The button appearance
12
+ *
13
+ * @defaultValue 'default'
14
+ */
15
+ appearance?: 'default' | 'outlined' | 'minimal' | 'tonal' | 'custom';
16
+ /**
17
+ * The intent of the button
18
+ */
19
+ intent?: 'default' | 'primary' | 'accent' | 'success' | 'warning' | 'danger';
20
+ /**
21
+ * The size of the button
22
+ */
23
+ size?: 'xs' | 'sm' | 'lg' | 'xl';
24
+ /**
25
+ * Disable rendering the button element. It yields an object with classNames instead.
26
+ */
27
+ isRenderless?: boolean;
28
+ /**
29
+ * Custom class name, it will override the default ones using Tailwind Merge library.
30
+ */
31
+ class?: string;
32
+ /**
33
+ * If button is part of a group. Most of the time, this is automatically set
34
+ * when using the ButtonGroup component.
35
+ */
36
+ isInGroup?: boolean;
37
+ /**
38
+ * Callback for when the button is pressed.
39
+ */
40
+ onPress?: (event: PressEvent) => void;
41
+ }
42
+ interface ButtonSignature {
43
+ Args: ButtonArgs;
44
+ Blocks: {
45
+ default: [{
46
+ classNames: string;
47
+ }];
48
+ };
49
+ Element: HTMLButtonElement;
50
+ }
51
+ declare class Button extends Component<ButtonSignature> {
52
+ isPressed: boolean;
53
+ get type(): string;
54
+ get classNames(): string;
55
+ handlePressChange: (isPressed: boolean) => void;
56
+ onPress: (event: PressEvent) => void;
57
+ }
58
+ export { Button, type ButtonSignature };
59
+ export default Button;
@@ -0,0 +1,54 @@
1
+ import Component from '@glimmer/component';
2
+ interface ChipSignature {
3
+ Args: {
4
+ /**
5
+ * The chip appearance
6
+ *
7
+ * @defaultValue 'default'
8
+ */
9
+ appearance?: 'default' | 'outlined' | 'faded';
10
+ /**
11
+ * The intent of the chip
12
+ */
13
+ intent?: 'default' | 'primary' | 'accent' | 'success' | 'warning' | 'danger';
14
+ /**
15
+ * The size of the chip
16
+ */
17
+ size?: 'sm' | 'md' | 'lg';
18
+ /**
19
+ * The radius the chip
20
+ */
21
+ radius?: 'none' | 'sm' | 'lg' | 'full';
22
+ /**
23
+ * Option to add dot to the chip
24
+ */
25
+ withDot?: boolean;
26
+ /**
27
+ * Function to be called when clicking on the close button.
28
+ * If you pass this argument, the close button will be visible.
29
+ */
30
+ onClose?: () => void;
31
+ /**
32
+ * Disables the clip and disables the close button if any.
33
+ */
34
+ isDisabled?: boolean;
35
+ /**
36
+ * Custom class name, it will override the default ones using Tailwind Merge library.
37
+ */
38
+ class?: string;
39
+ };
40
+ Blocks: {
41
+ default: [];
42
+ };
43
+ Element: HTMLDivElement;
44
+ }
45
+ declare class Chip extends Component<ChipSignature> {
46
+ get classNames(): {
47
+ base: string;
48
+ content: string;
49
+ dot: string;
50
+ closeButton: string;
51
+ };
52
+ }
53
+ export { Chip, type ChipSignature };
54
+ export default Chip;
@@ -0,0 +1,55 @@
1
+ import Component from '@glimmer/component';
2
+ import { type PressEvent } from '../../modifiers/press';
3
+ import { type CloseButtonVariants } from '@frontile/theme';
4
+ import type Owner from '@ember/owner';
5
+ interface CloseButtonSignature {
6
+ Args: {
7
+ /**
8
+ * The title of the close button
9
+ *
10
+ * @defaultValue 'Close'
11
+ */
12
+ title?: string;
13
+ /**
14
+ * The icon size
15
+ *
16
+ * @defaultValue 'lg'
17
+ */
18
+ size?: CloseButtonVariants['size'];
19
+ /**
20
+ * @defaultValue 'transparent'
21
+ */
22
+ variant?: CloseButtonVariants['variant'];
23
+ /**
24
+ * The function to call when button is pressed
25
+ */
26
+ onPress?: (event: PressEvent) => void;
27
+ /**
28
+ * Deprecated: The function to call when button is clicked
29
+ *
30
+ * @deprecated Use onPress instead for better cross-platform support
31
+ */
32
+ onClick?: (event: Event) => void;
33
+ /**
34
+ * Additional class for close button element
35
+ */
36
+ class?: string;
37
+ };
38
+ Blocks: {
39
+ default: [string | null];
40
+ };
41
+ Element: HTMLButtonElement;
42
+ }
43
+ declare class CloseButton extends Component<CloseButtonSignature> {
44
+ isPressed: boolean;
45
+ constructor(owner: Owner, args: CloseButtonSignature['Args']);
46
+ get classes(): {
47
+ base: string;
48
+ icon: string;
49
+ };
50
+ handlePressChange: (isPressed: boolean) => void;
51
+ handlePress(event: PressEvent): void;
52
+ handleClick(event: Event): void;
53
+ }
54
+ export { CloseButton, type CloseButtonSignature };
55
+ export default CloseButton;
@@ -0,0 +1,5 @@
1
+ export * from './button';
2
+ export * from './close-button';
3
+ export * from './toggle-button';
4
+ export * from './button-group';
5
+ export * from './chip';
@@ -0,0 +1,28 @@
1
+ import Component from '@glimmer/component';
2
+ import type { ButtonArgs } from './button';
3
+ interface ToggleButtonArgs extends Pick<ButtonArgs, 'intent' | 'size' | 'class' | 'isInGroup'> {
4
+ /**
5
+ * If the button is currently selected
6
+ *
7
+ * @defaultValue false
8
+ */
9
+ isSelected?: boolean;
10
+ /**
11
+ * Callback when the buttle is toggled
12
+ */
13
+ onChange?: (isSelected: boolean) => void;
14
+ }
15
+ interface ToggleButtonSignature {
16
+ Args: ToggleButtonArgs;
17
+ Blocks: {
18
+ default: [];
19
+ };
20
+ Element: HTMLButtonElement;
21
+ }
22
+ declare class ToggleButton extends Component<ToggleButtonSignature> {
23
+ get classNames(): string;
24
+ get isSelected(): boolean;
25
+ onChange: () => void;
26
+ }
27
+ export { ToggleButton, type ToggleButtonSignature };
28
+ export default ToggleButton;
@@ -0,0 +1,99 @@
1
+ import Component from '@glimmer/component';
2
+ import { type ButtonSignature } from '../buttons/button';
3
+ import { type ListboxSignature } from './listbox';
4
+ import { type PopoverSignature, type ContentSignature } from '../overlays/popover';
5
+ import type { ModifierLike } from '@glint/template';
6
+ import type { ListboxItem } from './listbox/item';
7
+ import type { WithBoundArgs } from '@glint/template';
8
+ interface DropdownArgs extends Pick<PopoverSignature['Args'], 'placement' | 'flipOptions' | 'middleware' | 'shiftOptions' | 'offsetOptions' | 'strategy' | 'didClose'> {
9
+ /**
10
+ * Whether the dropdown should close upon selecting an item.
11
+ *
12
+ * @defaultValue true
13
+ */
14
+ closeOnItemSelect?: boolean;
15
+ }
16
+ interface DropdownSignature {
17
+ Args: DropdownArgs;
18
+ Element: HTMLUListElement;
19
+ Blocks: {
20
+ default: [
21
+ {
22
+ Trigger: WithBoundArgs<typeof Trigger, 'anchor' | 'toggle' | 'trigger'>;
23
+ Menu: WithBoundArgs<typeof Menu, 'toggle' | 'Content' | 'closeOnItemSelect'>;
24
+ }
25
+ ];
26
+ };
27
+ }
28
+ declare class Dropdown extends Component<DropdownSignature> {
29
+ }
30
+ interface TriggerArgs extends Pick<ButtonSignature['Args'], 'appearance' | 'intent' | 'size' | 'isInGroup' | 'class'> {
31
+ /**
32
+ * @internal
33
+ */
34
+ anchor: ModifierLike<{
35
+ Element: HTMLElement;
36
+ }>;
37
+ trigger: ModifierLike<{
38
+ Element: HTMLElement;
39
+ }>;
40
+ /**
41
+ * @internal
42
+ */
43
+ toggle: () => void;
44
+ }
45
+ export interface TriggerSignature {
46
+ Args: TriggerArgs;
47
+ Element: HTMLButtonElement;
48
+ Blocks: {
49
+ default: [];
50
+ };
51
+ }
52
+ declare class Trigger extends Component<TriggerSignature> {
53
+ get anchor(): ModifierLike<{
54
+ Element: HTMLElement;
55
+ }>;
56
+ get trigger(): ModifierLike<{
57
+ Element: HTMLElement;
58
+ }>;
59
+ handleKeyDown: (event: KeyboardEvent) => void;
60
+ handleKeyUp: (event: KeyboardEvent) => void;
61
+ }
62
+ interface MenuArgs extends Pick<ListboxSignature<unknown>['Args'], 'appearance' | 'intent' | 'class' | 'selectionMode' | 'selectedKeys' | 'disabledKeys' | 'allowEmpty' | 'onSelectionChange'>, Pick<ContentSignature['Args'], 'renderInPlace' | 'target' | 'transitionDuration' | 'backdrop' | 'disableTransitions' | 'focusTrapOptions' | 'closeOnOutsideClick' | 'closeOnEscapeKey' | 'backdropTransition' | 'transition'> {
63
+ /**
64
+ * @internal
65
+ */
66
+ closeOnItemSelect?: boolean;
67
+ /**
68
+ * @internal
69
+ */
70
+ Content: PopoverSignature['Blocks']['default'][0]['Content'];
71
+ /**
72
+ * @internal
73
+ */
74
+ toggle: () => void;
75
+ onAction?: (key: string) => void;
76
+ /**
77
+ * @defaultValue true
78
+ */
79
+ blockScroll?: boolean;
80
+ /**
81
+ * @defaultValue false
82
+ */
83
+ disableFocusTrap?: boolean;
84
+ }
85
+ export interface MenuSignature {
86
+ Args: MenuArgs;
87
+ Element: HTMLUListElement;
88
+ Blocks: {
89
+ default: [item: WithBoundArgs<typeof ListboxItem, 'manager'>];
90
+ };
91
+ }
92
+ declare class Menu extends Component<MenuSignature> {
93
+ get classNames(): string;
94
+ onAction: (key: string) => void;
95
+ get blockScroll(): boolean;
96
+ get disableFocusTrap(): boolean;
97
+ }
98
+ export { Dropdown, type DropdownSignature };
99
+ export default Dropdown;
@@ -0,0 +1,3 @@
1
+ export * from './listbox';
2
+ export * from './dropdown';
3
+ export * from './table';
@@ -0,0 +1,51 @@
1
+ import Component from '@glimmer/component';
2
+ import type { ListManager, ListItem } from '../../../utils/listManager';
3
+ export interface ListboxItemSignature {
4
+ Args: {
5
+ manager: ListManager;
6
+ key: string;
7
+ textValue?: string;
8
+ description?: string;
9
+ shortcut?: string;
10
+ onClick?: () => void;
11
+ class?: string;
12
+ withDivider?: boolean;
13
+ /**
14
+ * The appearance of each item
15
+ *
16
+ * @defaultValue 'default'
17
+ */
18
+ appearance?: 'default' | 'outlined' | 'faded';
19
+ /**
20
+ * The intent of each item
21
+ */
22
+ intent?: 'default' | 'primary' | 'success' | 'warning' | 'danger';
23
+ type?: 'menu' | 'listbox';
24
+ };
25
+ Element: HTMLLIElement;
26
+ Blocks: {
27
+ default: [];
28
+ selectedIcon: [];
29
+ start: [];
30
+ end: [];
31
+ };
32
+ }
33
+ declare class ListboxItem extends Component<ListboxItemSignature> {
34
+ labelId: string;
35
+ listItem?: ListItem;
36
+ get manager(): ListManager;
37
+ get key(): string;
38
+ onRegister(item: ListItem): void;
39
+ onClick(): void;
40
+ get tabindex(): 0 | -1;
41
+ get classNames(): {
42
+ base: string;
43
+ descriptionWrapper: string;
44
+ label: string;
45
+ description: string;
46
+ selectedIcon: string;
47
+ shortcut: string;
48
+ };
49
+ get role(): "menuitem" | "option";
50
+ }
51
+ export { ListboxItem };
@@ -0,0 +1,75 @@
1
+ import Component from '@glimmer/component';
2
+ import { ListManager, type SelectionMode, type ListItem } from '../../../utils/listManager';
3
+ import { ListboxItem, type ListboxItemSignature } from './item';
4
+ import type { WithBoundArgs } from '@glint/template';
5
+ type ItemCompBounded = WithBoundArgs<typeof ListboxItem, 'manager'>;
6
+ interface ListboxSignature<T> {
7
+ Args: {
8
+ /**
9
+ * @default 'listbox'
10
+ */
11
+ type?: 'menu' | 'listbox';
12
+ selectionMode?: SelectionMode;
13
+ selectedKeys?: string[];
14
+ disabledKeys?: string[];
15
+ allowEmpty?: boolean;
16
+ items?: T[];
17
+ class?: string;
18
+ isKeyboardEventsEnabled?: boolean;
19
+ /** The element to add keyboard events to.
20
+ *
21
+ * This does not respect the option `iskeyboardEventsEnabled`.
22
+ * @defaultValue null
23
+ */
24
+ elementToAddKeyboardEvents?: HTMLElement;
25
+ /**
26
+ * @edefaultValue 'frist'
27
+ */
28
+ autoActivateMode?: 'none' | 'first' | 'selected';
29
+ onAction?: (key: string) => void;
30
+ onSelectionChange?: (key: string[]) => void;
31
+ onActiveItemChange?: (key?: string) => void;
32
+ /**
33
+ * The appearance of each item
34
+ *
35
+ * @defaultValue 'default'
36
+ */
37
+ appearance?: 'default' | 'outlined' | 'faded';
38
+ /**
39
+ * The intent of each item
40
+ */
41
+ intent?: 'default' | 'primary' | 'success' | 'warning' | 'danger';
42
+ };
43
+ Element: HTMLUListElement;
44
+ Blocks: {
45
+ item: [{
46
+ item: T;
47
+ key: string;
48
+ label: string;
49
+ Item: ItemCompBounded;
50
+ }];
51
+ default: [{
52
+ Item: ItemCompBounded;
53
+ }];
54
+ };
55
+ }
56
+ declare class Listbox<T = unknown> extends Component<ListboxSignature<T>> {
57
+ listManager: ListManager;
58
+ handleKeyPress: (event: KeyboardEvent) => void;
59
+ handleKeyDown: (event: KeyboardEvent) => void;
60
+ onKeyPress: (event: KeyboardEvent) => void;
61
+ onKeyDown: (event: KeyboardEvent) => void;
62
+ setupEvents: import("ember-modifier").FunctionBasedModifier<{
63
+ Args: {
64
+ Positional: unknown[];
65
+ Named: {
66
+ elementToAddKeyboardEvents?: HTMLElement;
67
+ };
68
+ };
69
+ Element: HTMLElement;
70
+ }>;
71
+ get classNames(): string;
72
+ get role(): "menu" | "listbox";
73
+ }
74
+ export { Listbox, ListboxItem, type ListboxSignature, type ListboxItemSignature, type ListItem };
75
+ export default Listbox;
@@ -0,0 +1,2 @@
1
+ export * from './listbox/listbox';
2
+ export { default } from './listbox/listbox';