@inglorious/ui 0.1.0 → 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/README.md +45 -0
  2. package/package.json +191 -16
  3. package/src/all.css +7 -0
  4. package/src/controls/button/button.stories.js +35 -15
  5. package/src/controls/button/index.js +1 -3
  6. package/src/controls/button/style.css +80 -37
  7. package/src/controls/button/template.js +23 -26
  8. package/src/controls/button-group/button-group.stories.js +19 -15
  9. package/src/controls/button-group/index.js +1 -2
  10. package/src/controls/button-group/style.css +0 -7
  11. package/src/controls/button-group/template.js +46 -56
  12. package/src/controls/checkbox/checkbox.stories.js +16 -13
  13. package/src/controls/checkbox/index.js +1 -2
  14. package/src/controls/checkbox/style.css +23 -2
  15. package/src/controls/checkbox/template.js +20 -18
  16. package/src/controls/combobox/combobox.stories.js +92 -0
  17. package/src/controls/{select → combobox}/handlers.js +8 -5
  18. package/src/controls/combobox/helpers.js +91 -0
  19. package/src/controls/combobox/index.js +43 -0
  20. package/src/controls/combobox/style.css +203 -0
  21. package/src/controls/combobox/template.js +340 -0
  22. package/src/controls/controls.css +12 -0
  23. package/src/controls/fab/fab.stories.js +11 -11
  24. package/src/controls/fab/index.js +1 -2
  25. package/src/controls/fab/template.js +21 -19
  26. package/src/controls/icon-button/icon-button.stories.js +8 -10
  27. package/src/controls/icon-button/index.js +1 -2
  28. package/src/controls/icon-button/template.js +13 -19
  29. package/src/controls/input/index.js +1 -2
  30. package/src/controls/input/input.stories.js +24 -23
  31. package/src/controls/input/style.css +9 -7
  32. package/src/controls/input/template.js +28 -31
  33. package/src/controls/radio-group/index.js +1 -2
  34. package/src/controls/radio-group/radio-group.stories.js +11 -8
  35. package/src/controls/radio-group/style.css +22 -1
  36. package/src/controls/radio-group/template.js +20 -15
  37. package/src/controls/rating/index.js +1 -2
  38. package/src/controls/rating/rating.stories.js +7 -10
  39. package/src/controls/rating/style.css +1 -2
  40. package/src/controls/rating/template.js +20 -17
  41. package/src/controls/select/helpers.js +2 -21
  42. package/src/controls/select/index.js +1 -13
  43. package/src/controls/select/select.stories.js +68 -64
  44. package/src/controls/select/style.css +66 -189
  45. package/src/controls/select/template.js +77 -406
  46. package/src/controls/slider/index.js +1 -2
  47. package/src/controls/slider/slider.stories.js +15 -12
  48. package/src/controls/slider/style.css +24 -3
  49. package/src/controls/slider/template.js +30 -23
  50. package/src/controls/switch/index.js +1 -2
  51. package/src/controls/switch/style.css +23 -2
  52. package/src/controls/switch/switch.stories.js +14 -11
  53. package/src/controls/switch/template.js +18 -16
  54. package/src/data-display/avatar/avatar.stories.js +106 -0
  55. package/src/data-display/avatar/index.js +3 -0
  56. package/src/data-display/avatar/style.css +64 -0
  57. package/src/data-display/avatar/template.js +81 -0
  58. package/src/data-display/badge/badge.stories.js +64 -0
  59. package/src/data-display/badge/index.js +3 -0
  60. package/src/data-display/badge/style.css +84 -0
  61. package/src/data-display/badge/template.js +46 -0
  62. package/src/data-display/chip/chip.stories.js +57 -0
  63. package/src/data-display/chip/index.js +3 -0
  64. package/src/data-display/chip/style.css +84 -0
  65. package/src/data-display/chip/template.js +32 -0
  66. package/src/data-display/data-display.css +11 -0
  67. package/src/data-display/data-grid/base.css +58 -0
  68. package/src/data-display/data-grid/data-grid.stories.js +158 -0
  69. package/src/data-display/data-grid/filters/helpers.js +8 -0
  70. package/src/data-display/data-grid/filters/index.js +21 -0
  71. package/src/data-display/data-grid/filters/input.js +24 -0
  72. package/src/data-display/data-grid/filters/range.js +48 -0
  73. package/src/data-display/data-grid/filters/select.js +17 -0
  74. package/src/data-display/data-grid/handlers.js +523 -0
  75. package/src/data-display/data-grid/helpers.js +248 -0
  76. package/src/data-display/data-grid/index.js +64 -0
  77. package/src/data-display/data-grid/style.css +14 -0
  78. package/src/data-display/data-grid/template.js +458 -0
  79. package/src/data-display/data-grid/theme.css +148 -0
  80. package/src/data-display/divider/divider.stories.js +48 -0
  81. package/src/data-display/divider/index.js +3 -0
  82. package/src/data-display/divider/style.css +18 -0
  83. package/src/data-display/divider/template.js +17 -0
  84. package/src/data-display/icon/icon-implementations.mdx +160 -0
  85. package/src/data-display/icon/icon-utf8.stories.js +156 -0
  86. package/src/data-display/icon/icon.stories.js +38 -0
  87. package/src/data-display/icon/index.js +3 -0
  88. package/src/data-display/icon/style.css +17 -0
  89. package/src/data-display/icon/template.js +19 -0
  90. package/src/data-display/list/handlers.js +25 -0
  91. package/src/data-display/list/index.js +4 -0
  92. package/src/data-display/list/list.stories.js +187 -0
  93. package/src/data-display/list/style.css +119 -0
  94. package/src/data-display/list/template.js +302 -0
  95. package/src/data-display/material-icon/index.js +3 -0
  96. package/src/data-display/material-icon/material-icon.stories.js +99 -0
  97. package/src/data-display/material-icon/style.css +27 -0
  98. package/src/data-display/material-icon/template.js +21 -0
  99. package/src/data-display/table/index.js +1 -0
  100. package/src/data-display/table/style.css +42 -0
  101. package/src/data-display/table/table.stories.js +40 -0
  102. package/src/data-display/table/template.js +114 -0
  103. package/src/data-display/tooltip/index.js +3 -0
  104. package/src/data-display/tooltip/style.css +57 -0
  105. package/src/data-display/tooltip/template.js +58 -0
  106. package/src/data-display/tooltip/tooltip.stories.js +44 -0
  107. package/src/data-display/typography/index.js +3 -0
  108. package/src/data-display/typography/style.css +49 -0
  109. package/src/data-display/typography/template.js +110 -0
  110. package/src/data-display/typography/typography.stories.js +48 -0
  111. package/src/data-display/virtual-list/handlers.js +68 -0
  112. package/src/data-display/virtual-list/index.js +4 -0
  113. package/src/data-display/virtual-list/template.js +101 -0
  114. package/src/examples/dashboard/app-drawer.js +255 -0
  115. package/src/examples/dashboard/app-header.js +149 -0
  116. package/src/examples/dashboard/dashboard.js +85 -0
  117. package/src/examples/dashboard/dashboard.stories.js +47 -0
  118. package/src/examples/dashboard/data.js +205 -0
  119. package/src/examples/dashboard/mode.js +27 -0
  120. package/src/examples/dashboard/primitive-content.js +1325 -0
  121. package/src/examples/dashboard/primitive-section.js +158 -0
  122. package/src/examples/dashboard/router.js +13 -0
  123. package/src/examples/dashboard/social-card.js +73 -0
  124. package/src/examples/dashboard/stat-card.js +84 -0
  125. package/src/examples/dashboard/style.css +339 -0
  126. package/src/examples/dashboard/theme-utils.js +95 -0
  127. package/src/examples/dashboard/theme.js +27 -0
  128. package/src/examples/dashboard/traffic-card.js +108 -0
  129. package/src/examples/dashboard/traffic-sales-card.js +267 -0
  130. package/src/feedback/alert/alert.stories.js +70 -0
  131. package/src/feedback/alert/index.js +3 -0
  132. package/src/feedback/alert/style.css +98 -0
  133. package/src/feedback/alert/template.js +74 -0
  134. package/src/feedback/backdrop/backdrop.stories.js +21 -0
  135. package/src/feedback/backdrop/index.js +3 -0
  136. package/src/feedback/backdrop/style.css +25 -0
  137. package/src/feedback/backdrop/template.js +31 -0
  138. package/src/feedback/dialog/dialog.stories.js +27 -0
  139. package/src/feedback/dialog/index.js +3 -0
  140. package/src/feedback/dialog/style.css +68 -0
  141. package/src/feedback/dialog/template.js +64 -0
  142. package/src/feedback/feedback.css +6 -0
  143. package/src/feedback/progress/index.js +3 -0
  144. package/src/feedback/progress/progress.stories.js +54 -0
  145. package/src/feedback/progress/style.css +95 -0
  146. package/src/feedback/progress/template.js +88 -0
  147. package/src/feedback/skeleton/index.js +3 -0
  148. package/src/feedback/skeleton/skeleton.stories.js +44 -0
  149. package/src/feedback/skeleton/style.css +41 -0
  150. package/src/feedback/skeleton/template.js +48 -0
  151. package/src/feedback/snackbar/index.js +3 -0
  152. package/src/feedback/snackbar/snackbar.stories.js +25 -0
  153. package/src/feedback/snackbar/style.css +64 -0
  154. package/src/feedback/snackbar/template.js +55 -0
  155. package/src/index.js +32 -1
  156. package/src/layout/container/container.stories.js +105 -0
  157. package/src/layout/container/index.js +3 -0
  158. package/src/layout/container/style.css +34 -0
  159. package/src/layout/container/template.js +119 -0
  160. package/src/layout/flex/flex.stories.js +28 -10
  161. package/src/layout/flex/index.js +1 -2
  162. package/src/layout/flex/style.css +20 -0
  163. package/src/layout/flex/template.js +40 -13
  164. package/src/layout/grid/grid.stories.js +46 -30
  165. package/src/layout/grid/index.js +1 -2
  166. package/src/layout/grid/style.css +20 -0
  167. package/src/layout/grid/template.js +100 -20
  168. package/src/layout/layout.css +3 -0
  169. package/src/navigation/bottom-navigation/bottom-navigation.stories.js +33 -0
  170. package/src/navigation/bottom-navigation/index.js +1 -0
  171. package/src/navigation/bottom-navigation/style.css +32 -0
  172. package/src/navigation/bottom-navigation/template.js +74 -0
  173. package/src/navigation/breadcrumbs/breadcrumbs.stories.js +33 -0
  174. package/src/navigation/breadcrumbs/index.js +1 -0
  175. package/src/navigation/breadcrumbs/style.css +27 -0
  176. package/src/navigation/breadcrumbs/template.js +79 -0
  177. package/src/navigation/drawer/drawer.stories.js +60 -0
  178. package/src/navigation/drawer/index.js +3 -0
  179. package/src/navigation/drawer/style.css +125 -0
  180. package/src/navigation/drawer/template.js +131 -0
  181. package/src/navigation/link/index.js +3 -0
  182. package/src/navigation/link/link.stories.js +53 -0
  183. package/src/navigation/link/style.css +40 -0
  184. package/src/navigation/link/template.js +53 -0
  185. package/src/navigation/menu/index.js +1 -0
  186. package/src/navigation/menu/menu.stories.js +36 -0
  187. package/src/navigation/menu/style.css +44 -0
  188. package/src/navigation/menu/template.js +81 -0
  189. package/src/navigation/navigation.css +9 -0
  190. package/src/navigation/pagination/index.js +1 -0
  191. package/src/navigation/pagination/pagination.stories.js +61 -0
  192. package/src/navigation/pagination/style.css +29 -0
  193. package/src/navigation/pagination/template.js +140 -0
  194. package/src/navigation/speed-dial/index.js +1 -0
  195. package/src/navigation/speed-dial/speed-dial.stories.js +40 -0
  196. package/src/navigation/speed-dial/style.css +38 -0
  197. package/src/navigation/speed-dial/template.js +68 -0
  198. package/src/navigation/stepper/index.js +1 -0
  199. package/src/navigation/stepper/stepper.stories.js +35 -0
  200. package/src/navigation/stepper/style.css +49 -0
  201. package/src/navigation/stepper/template.js +61 -0
  202. package/src/navigation/tabs/index.js +1 -0
  203. package/src/navigation/tabs/style.css +35 -0
  204. package/src/navigation/tabs/tabs.stories.js +40 -0
  205. package/src/navigation/tabs/template.js +79 -0
  206. package/src/overview.mdx +39 -0
  207. package/src/stories/notifyStory.js +22 -25
  208. package/src/styles/base.css +2 -0
  209. package/src/styles/reset.css +15 -0
  210. package/src/{themes → styles/themes}/bootstrap.css +2 -0
  211. package/src/{themes → styles/themes}/inglorious.css +9 -1
  212. package/src/{themes → styles/themes}/material.css +2 -0
  213. package/src/{tokens/index.css → styles/tokens.css} +9 -0
  214. package/src/surfaces/accordion/accordion.stories.js +60 -0
  215. package/src/surfaces/accordion/index.js +1 -0
  216. package/src/surfaces/accordion/style.css +64 -0
  217. package/src/surfaces/accordion/template.js +85 -0
  218. package/src/surfaces/app-bar/app-bar.stories.js +109 -0
  219. package/src/surfaces/app-bar/index.js +3 -0
  220. package/src/surfaces/app-bar/style.css +109 -0
  221. package/src/surfaces/app-bar/template.js +78 -0
  222. package/src/surfaces/card/card.stories.js +108 -0
  223. package/src/surfaces/card/index.js +1 -0
  224. package/src/surfaces/card/style.css +107 -0
  225. package/src/surfaces/card/template.js +163 -0
  226. package/src/surfaces/paper/index.js +3 -0
  227. package/src/surfaces/paper/paper.stories.js +97 -0
  228. package/src/surfaces/paper/style.css +73 -0
  229. package/src/surfaces/paper/template.js +76 -0
  230. package/src/surfaces/surfaces.css +4 -0
  231. package/types/controls/button-group.d.ts +8 -7
  232. package/types/controls/button.d.ts +10 -7
  233. package/types/controls/checkbox.d.ts +8 -6
  234. package/types/controls/combobox.d.ts +66 -0
  235. package/types/controls/fab.d.ts +6 -5
  236. package/types/controls/icon-button.d.ts +8 -7
  237. package/types/controls/input.d.ts +18 -11
  238. package/types/controls/radio-group.d.ts +7 -5
  239. package/types/controls/rating.d.ts +6 -5
  240. package/types/controls/select.d.ts +11 -34
  241. package/types/controls/slider.d.ts +8 -6
  242. package/types/controls/switch.d.ts +7 -5
  243. package/types/data-display/avatar.d.ts +30 -0
  244. package/types/data-display/badge.d.ts +20 -0
  245. package/types/data-display/chip.d.ts +25 -0
  246. package/types/data-display/data-grid.d.ts +151 -0
  247. package/types/data-display/divider.d.ts +14 -0
  248. package/types/data-display/icon.d.ts +16 -0
  249. package/types/data-display/list.d.ts +66 -0
  250. package/types/data-display/material-icon.d.ts +15 -0
  251. package/types/data-display/table.d.ts +45 -0
  252. package/types/data-display/tooltip.d.ts +20 -0
  253. package/types/data-display/typography.d.ts +28 -0
  254. package/types/data-display/virtual-list.d.ts +94 -0
  255. package/types/feedback/alert.d.ts +22 -0
  256. package/types/feedback/backdrop.d.ts +17 -0
  257. package/types/feedback/dialog.d.ts +21 -0
  258. package/types/feedback/progress.d.ts +18 -0
  259. package/types/feedback/skeleton.d.ts +18 -0
  260. package/types/feedback/snackbar.d.ts +19 -0
  261. package/types/index.d.ts +92 -14
  262. package/types/layout/container.d.ts +28 -0
  263. package/types/layout/flex.d.ts +16 -5
  264. package/types/layout/grid.d.ts +15 -4
  265. package/types/navigation/bottom-navigation.d.ts +33 -0
  266. package/types/navigation/breadcrumbs.d.ts +29 -0
  267. package/types/navigation/drawer.d.ts +23 -0
  268. package/types/navigation/link.d.ts +22 -0
  269. package/types/navigation/menu.d.ts +32 -0
  270. package/types/navigation/pagination.d.ts +50 -0
  271. package/types/navigation/speed-dial.d.ts +35 -0
  272. package/types/navigation/stepper.d.ts +26 -0
  273. package/types/navigation/tabs.d.ts +31 -0
  274. package/types/surfaces/accordion.d.ts +32 -0
  275. package/types/surfaces/app-bar.d.ts +25 -0
  276. package/types/surfaces/card.d.ts +39 -0
  277. package/types/surfaces/paper.d.ts +28 -0
  278. package/src/shared/withRenderValidation.js +0 -19
  279. package/src/widgets/card/card.stories.js +0 -135
  280. package/src/widgets/card/index.js +0 -4
  281. package/src/widgets/card/style.css +0 -53
  282. package/src/widgets/card/template.js +0 -97
  283. package/types/widgets/card.d.ts +0 -21
@@ -1,23 +1,26 @@
1
- import type { TemplateResult, Api } from "@inglorious/web"
1
+ import type { TemplateResult } from "@inglorious/web"
2
2
 
3
- export interface ButtonEntity {
3
+ export interface ButtonProps {
4
4
  id?: string
5
+ type: "button"
5
6
  children?: TemplateResult | string | number
6
7
  variant?: "default" | "outline" | "ghost"
7
8
  color?: "primary" | "secondary" | "success" | "warning" | "error" | "info"
8
9
  size?: "sm" | "md" | "lg"
9
10
  shape?: "rectangle" | "pill" | "round" | "square"
10
- disabled?: boolean
11
- fullWidth?: boolean
12
- type?: "button" | "submit" | "reset" | "menu"
11
+ isDisabled?: boolean
12
+ isPressed?: boolean
13
+ isFullWidth?: boolean
14
+ buttonType?: "button" | "submit" | "reset" | "menu"
13
15
  ariaLabel?: string
14
- ariaPressed?: boolean
16
+ isAriaPressed?: boolean
15
17
  className?: string
18
+ onClick?: () => void
16
19
  [key: string]: unknown
17
20
  }
18
21
 
19
22
  export interface ButtonType {
20
- render(entity: ButtonEntity, api: Api): TemplateResult
23
+ render(props: ButtonProps): TemplateResult
21
24
  }
22
25
 
23
26
  export declare const button: ButtonType
@@ -1,18 +1,20 @@
1
- import type { TemplateResult, Api } from "@inglorious/web"
1
+ import type { TemplateResult } from "@inglorious/web"
2
2
 
3
- export interface CheckboxEntity {
3
+ export interface CheckboxProps {
4
4
  id?: string
5
5
  name?: string
6
6
  label?: string
7
- checked?: boolean
8
- disabled?: boolean
9
- required?: boolean
7
+ isChecked?: boolean
8
+ isDisabled?: boolean
9
+ isRequired?: boolean
10
+ color?: "primary" | "secondary" | "success" | "warning" | "error" | "info"
10
11
  size?: "sm" | "md" | "lg"
12
+ onChange?: (isChecked: boolean) => void
11
13
  [key: string]: unknown
12
14
  }
13
15
 
14
16
  export interface CheckboxType {
15
- render(entity: CheckboxEntity, api: Api): TemplateResult
17
+ render(props: CheckboxProps): TemplateResult
16
18
  }
17
19
 
18
20
  export declare const checkbox: CheckboxType
@@ -0,0 +1,66 @@
1
+ import type { TemplateResult, Api } from "@inglorious/web"
2
+
3
+ export type ComboboxOption =
4
+ | string
5
+ | number
6
+ | {
7
+ value: string | number
8
+ label?: string
9
+ isDisabled?: boolean
10
+ [key: string]: unknown
11
+ }
12
+
13
+ export interface ComboboxProps {
14
+ id?: string
15
+ type?: string
16
+ label?: string
17
+ options?: ComboboxOption[]
18
+
19
+ isOpen?: boolean
20
+ searchTerm?: string
21
+ focusedIndex?: number
22
+
23
+ isMulti?: boolean
24
+ selectedValue?: string | number | (string | number)[] | null
25
+
26
+ isLoading?: boolean
27
+ isDisabled?: boolean
28
+ isSearchable?: boolean
29
+ isClearable?: boolean
30
+
31
+ placeholder?: string
32
+ noOptionsMessage?: string
33
+ loadingMessage?: string
34
+
35
+ isFullWidth?: boolean
36
+ size?: "sm" | "md" | "lg"
37
+ onToggle?: () => void
38
+ onClear?: () => void
39
+ onClose?: () => void
40
+ onSearchChange?: (value: string) => void
41
+ onFocusSet?: (index: number) => void
42
+ onFocusNext?: () => void
43
+ onFocusPrev?: () => void
44
+ onFocusFirst?: () => void
45
+ onFocusLast?: () => void
46
+ onOptionSelect?: (option: ComboboxOption) => void
47
+ onChange?: (option: ComboboxOption) => void
48
+ [key: string]: unknown
49
+ }
50
+
51
+ export interface ComboboxType {
52
+ create(entity: ComboboxProps): void
53
+ render(entity: ComboboxProps, api: Api): TemplateResult
54
+ open(entity: ComboboxProps): void
55
+ close(entity: ComboboxProps): void
56
+ toggle(entity: ComboboxProps): void
57
+ optionSelect(entity: ComboboxProps, option: ComboboxOption): void
58
+ clear(entity: ComboboxProps): void
59
+ searchChange(entity: ComboboxProps, searchTerm: string): void
60
+ focusNext(entity: ComboboxProps): void
61
+ focusPrev(entity: ComboboxProps): void
62
+ focusFirst(entity: ComboboxProps): void
63
+ focusLast(entity: ComboboxProps): void
64
+ }
65
+
66
+ export declare const combobox: ComboboxType
@@ -1,19 +1,20 @@
1
- import type { TemplateResult, Api } from "@inglorious/web"
1
+ import type { TemplateResult } from "@inglorious/web"
2
2
 
3
- export interface FabEntity {
3
+ export interface FabProps {
4
4
  id?: string
5
5
  children?: TemplateResult | string | number
6
6
  color?: "primary" | "secondary" | "success" | "warning" | "error" | "info"
7
7
  size?: "sm" | "md" | "lg"
8
- disabled?: boolean
8
+ isDisabled?: boolean
9
9
  type?: "button" | "submit" | "reset" | "menu"
10
- extended?: boolean
10
+ isExtended?: boolean
11
11
  ariaLabel?: string
12
+ onClick?: () => void
12
13
  [key: string]: unknown
13
14
  }
14
15
 
15
16
  export interface FabType {
16
- render(entity: FabEntity, api: Api): TemplateResult
17
+ render(props: FabProps): TemplateResult
17
18
  }
18
19
 
19
20
  export declare const fab: FabType
@@ -1,23 +1,24 @@
1
- import type { TemplateResult, Api } from "@inglorious/web"
1
+ import type { TemplateResult } from "@inglorious/web"
2
2
 
3
- export interface IconButtonEntity {
3
+ export interface IconButtonProps {
4
4
  id?: string
5
+ type?: string
5
6
  icon?: string
6
7
  label?: string
7
8
  iconAfter?: string
8
9
  direction?: "row" | "column"
9
- iconOnly?: boolean
10
10
  ariaLabel?: string
11
11
  variant?: "default" | "outline" | "ghost"
12
12
  color?: "primary" | "secondary" | "success" | "warning" | "error" | "info"
13
13
  size?: "sm" | "md" | "lg"
14
- disabled?: boolean
15
- fullWidth?: boolean
16
- type?: "button" | "submit" | "reset" | "menu"
14
+ isDisabled?: boolean
15
+ isFullWidth?: boolean
16
+ buttonType?: "button" | "submit" | "reset" | "menu"
17
+ onClick?: () => void
17
18
  }
18
19
 
19
20
  export interface IconButtonType {
20
- render(entity: IconButtonEntity, api: Api): TemplateResult
21
+ render(props: IconButtonProps): TemplateResult
21
22
  }
22
23
 
23
24
  export declare const iconButton: IconButtonType
@@ -1,29 +1,36 @@
1
- import type { TemplateResult, Api } from "@inglorious/web"
1
+ import type { TemplateResult } from "@inglorious/web"
2
2
 
3
- export interface InputEntity {
3
+ export interface InputProps {
4
4
  id?: string
5
5
  name?: string
6
- type?: "text" | "password" | "email" | "number" | "tel" | "url" | "search"
6
+ inputType?:
7
+ | "text"
8
+ | "password"
9
+ | "email"
10
+ | "number"
11
+ | "tel"
12
+ | "url"
13
+ | "search"
7
14
  value?: string
8
15
  placeholder?: string
9
16
  label?: string
10
17
  hint?: string
11
18
  error?: string
12
19
  size?: "sm" | "md" | "lg"
13
- disabled?: boolean
14
- readonly?: boolean
15
- required?: boolean
16
- fullWidth?: boolean
20
+ isDisabled?: boolean
21
+ isReadOnly?: boolean
22
+ isRequired?: boolean
23
+ isFullWidth?: boolean
17
24
  icon?: string
18
25
  iconAfter?: string
26
+ onChange?: (value: string) => void
27
+ onBlur?: () => void
28
+ onFocus?: () => void
19
29
  [key: string]: unknown
20
30
  }
21
31
 
22
32
  export interface InputType {
23
- render(entity: InputEntity, api: Api): TemplateResult
24
- change(entity: InputEntity, payload: string, api: Api): void
25
- blur(entity: InputEntity, payload: unknown, api: Api): void
26
- focus(entity: InputEntity, payload: unknown, api: Api): void
33
+ render(props: InputProps): TemplateResult
27
34
  }
28
35
 
29
36
  export declare const input: InputType
@@ -1,25 +1,27 @@
1
- import type { TemplateResult, Api } from "@inglorious/web"
1
+ import type { TemplateResult } from "@inglorious/web"
2
2
 
3
3
  export interface RadioOption {
4
4
  label: string
5
5
  value: string
6
- disabled?: boolean
6
+ isDisabled?: boolean
7
7
  [key: string]: unknown
8
8
  }
9
9
 
10
- export interface RadioGroupEntity {
10
+ export interface RadioGroupProps {
11
11
  id?: string
12
12
  name?: string
13
13
  label?: string
14
14
  value?: string
15
15
  options?: RadioOption[]
16
16
  direction?: "column" | "row"
17
- disabled?: boolean
17
+ color?: "primary" | "secondary" | "success" | "warning" | "error" | "info"
18
+ isDisabled?: boolean
19
+ onChange?: (value: string) => void
18
20
  [key: string]: unknown
19
21
  }
20
22
 
21
23
  export interface RadioGroupType {
22
- render(entity: RadioGroupEntity, api: Api): TemplateResult
24
+ render(props: RadioGroupProps): TemplateResult
23
25
  }
24
26
 
25
27
  export declare const radioGroup: RadioGroupType
@@ -1,18 +1,19 @@
1
- import type { TemplateResult, Api } from "@inglorious/web"
1
+ import type { TemplateResult } from "@inglorious/web"
2
2
 
3
- export interface RatingEntity {
3
+ export interface RatingProps {
4
4
  id?: string
5
5
  value?: number
6
6
  max?: number
7
- disabled?: boolean
8
- readonly?: boolean
7
+ isDisabled?: boolean
8
+ isReadOnly?: boolean
9
9
  symbol?: string
10
10
  emptySymbol?: string
11
+ onChange?: (value: number) => void
11
12
  size?: "sm" | "md" | "lg"
12
13
  }
13
14
 
14
15
  export interface RatingType {
15
- render(entity: RatingEntity, api: Api): TemplateResult
16
+ render(props: RatingProps): TemplateResult
16
17
  }
17
18
 
18
19
  export declare const rating: RatingType
@@ -1,4 +1,4 @@
1
- import type { TemplateResult, Api } from "@inglorious/web"
1
+ import type { TemplateResult } from "@inglorious/web"
2
2
 
3
3
  export type SelectOption =
4
4
  | string
@@ -6,51 +6,28 @@ export type SelectOption =
6
6
  | {
7
7
  value: string | number
8
8
  label?: string
9
- disabled?: boolean
10
9
  isDisabled?: boolean
11
10
  [key: string]: unknown
12
11
  }
13
12
 
14
- export interface SelectEntity {
13
+ export interface SelectProps {
15
14
  id?: string
16
15
  type?: string
17
- label?: string
16
+ name?: string
17
+ value?: unknown
18
18
  options?: SelectOption[]
19
-
20
- isOpen?: boolean
21
- searchTerm?: string
22
- focusedIndex?: number
23
-
24
- isMulti?: boolean
25
- selectedValue?: string | number | (string | number)[] | null
26
-
27
- isLoading?: boolean
28
- isDisabled?: boolean
29
- isSearchable?: boolean
30
- isClearable?: boolean
31
-
32
- placeholder?: string
33
- noOptionsMessage?: string
34
- loadingMessage?: string
35
-
36
- fullWidth?: boolean
37
19
  size?: "sm" | "md" | "lg"
20
+ isDisabled?: boolean
21
+ isFullWidth?: boolean
22
+ isMulti?: boolean
23
+ onChange?: (value: string) => void
24
+ onBlur?: () => void
25
+ onFocus?: () => void
38
26
  [key: string]: unknown
39
27
  }
40
28
 
41
29
  export interface SelectType {
42
- create(entity: SelectEntity): void
43
- render(entity: SelectEntity, api: Api): TemplateResult
44
- open(entity: SelectEntity): void
45
- close(entity: SelectEntity): void
46
- toggle(entity: SelectEntity): void
47
- optionSelect(entity: SelectEntity, option: SelectOption): void
48
- clear(entity: SelectEntity): void
49
- searchChange(entity: SelectEntity, searchTerm: string): void
50
- focusNext(entity: SelectEntity): void
51
- focusPrev(entity: SelectEntity): void
52
- focusFirst(entity: SelectEntity): void
53
- focusLast(entity: SelectEntity): void
30
+ render(props: SelectProps): TemplateResult
54
31
  }
55
32
 
56
33
  export declare const select: SelectType
@@ -1,6 +1,6 @@
1
- import type { TemplateResult, Api } from "@inglorious/web"
1
+ import type { TemplateResult } from "@inglorious/web"
2
2
 
3
- export interface SliderEntity {
3
+ export interface SliderProps {
4
4
  id?: string
5
5
  name?: string
6
6
  label?: string
@@ -8,14 +8,16 @@ export interface SliderEntity {
8
8
  min?: number
9
9
  max?: number
10
10
  step?: number
11
- disabled?: boolean
12
- showValue?: boolean
13
- fullWidth?: boolean
11
+ color?: "primary" | "secondary" | "success" | "warning" | "error" | "info"
12
+ isDisabled?: boolean
13
+ isValueVisible?: boolean
14
+ isFullWidth?: boolean
15
+ onChange?: (value: number) => void
14
16
  [key: string]: unknown
15
17
  }
16
18
 
17
19
  export interface SliderType {
18
- render(entity: SliderEntity, api: Api): TemplateResult
20
+ render(props: SliderProps): TemplateResult
19
21
  }
20
22
 
21
23
  export declare const slider: SliderType
@@ -1,17 +1,19 @@
1
- import type { TemplateResult, Api } from "@inglorious/web"
1
+ import type { TemplateResult } from "@inglorious/web"
2
2
 
3
- export interface SwitchEntity {
3
+ export interface SwitchProps {
4
4
  id?: string
5
5
  name?: string
6
6
  label?: string
7
- checked?: boolean
8
- disabled?: boolean
7
+ isChecked?: boolean
8
+ isDisabled?: boolean
9
+ color?: "primary" | "secondary" | "success" | "warning" | "error" | "info"
9
10
  size?: "sm" | "md" | "lg"
11
+ onChange?: (value: boolean) => void
10
12
  [key: string]: unknown
11
13
  }
12
14
 
13
15
  export interface SwitchType {
14
- render(entity: SwitchEntity, api: Api): TemplateResult
16
+ render(props: SwitchProps): TemplateResult
15
17
  }
16
18
 
17
19
  export declare const switchControl: SwitchType
@@ -0,0 +1,30 @@
1
+ import type { TemplateResult } from "@inglorious/web"
2
+
3
+ export interface AvatarProps {
4
+ id?: string
5
+ src?: string
6
+ alt?: string
7
+ initials?: string
8
+ size?: "sm" | "md" | "lg"
9
+ shape?: "circle" | "square"
10
+ color?:
11
+ | "default"
12
+ | "auto"
13
+ | "primary"
14
+ | "secondary"
15
+ | "success"
16
+ | "warning"
17
+ | "error"
18
+ | "info"
19
+ backgroundColor?: string
20
+ textColor?: string
21
+ children?: TemplateResult | string | number
22
+ onClick?: () => void
23
+ [key: string]: unknown
24
+ }
25
+
26
+ export interface AvatarType {
27
+ render(props: AvatarProps): TemplateResult
28
+ }
29
+
30
+ export declare const avatar: AvatarType
@@ -0,0 +1,20 @@
1
+ import type { TemplateResult } from "@inglorious/web"
2
+
3
+ export interface BadgeProps {
4
+ id?: string
5
+ children?: TemplateResult | string | number
6
+ color?: "primary" | "secondary" | "success" | "warning" | "error" | "info"
7
+ variant?: "solid" | "outline"
8
+ size?: "sm" | "md" | "lg"
9
+ shape?: "rectangle" | "pill" | "circle" | "square"
10
+ ringWidth?: string
11
+ className?: string
12
+ onClick?: () => void
13
+ [key: string]: unknown
14
+ }
15
+
16
+ export interface BadgeType {
17
+ render(props: BadgeProps): TemplateResult
18
+ }
19
+
20
+ export declare const badge: BadgeType
@@ -0,0 +1,25 @@
1
+ import type { TemplateResult } from "@inglorious/web"
2
+
3
+ export interface ChipProps {
4
+ id?: string
5
+ children?: TemplateResult | string | number
6
+ isRemovable?: boolean
7
+ color?:
8
+ | "default"
9
+ | "primary"
10
+ | "secondary"
11
+ | "success"
12
+ | "warning"
13
+ | "error"
14
+ | "info"
15
+ size?: "sm" | "md" | "lg"
16
+ shape?: "pill" | "rounded" | "square"
17
+ onClick?: () => void
18
+ [key: string]: unknown
19
+ }
20
+
21
+ export interface ChipType {
22
+ render(props: ChipProps): TemplateResult
23
+ }
24
+
25
+ export declare const chip: ChipType
@@ -0,0 +1,151 @@
1
+ import type { TemplateResult, Api } from "@inglorious/web"
2
+ import type { SelectOption } from "../controls/select"
3
+
4
+ export type Row = Record<string, any>
5
+
6
+ export interface DataGridVirtualization {
7
+ /** The current scroll position from the top in pixels. */
8
+ scrollTop: number
9
+
10
+ /** The start and end indices of the currently visible items (including buffer). */
11
+ visibleRange: { start: number; end: number }
12
+
13
+ /** The height of the visible viewport in pixels. */
14
+ viewportHeight: number
15
+
16
+ /** The number of items to render outside the viewport (above and below). */
17
+ bufferSize: number
18
+
19
+ /** The measured height of a single row in pixels. Null until measured on mount. */
20
+ itemHeight: number | null
21
+
22
+ /** An estimated height for rows used for calculations before they are measured. */
23
+ estimatedHeight: number
24
+ }
25
+
26
+ export interface Column {
27
+ id: string
28
+ title: string
29
+ type?: "string" | "number" | "boolean" | "date"
30
+ isSortable?: boolean
31
+ isFilterable?: boolean
32
+ filter?: {
33
+ type: "text" | "number" | "range" | "select" | "date" | "time" | "datetime"
34
+ options?: SelectOption[]
35
+ [key: string]: any
36
+ }
37
+ /**
38
+ * Column width semantics:
39
+ * - `auto` or `undefined`: flexible column (`1fr`)
40
+ * - `<n>fr`: proportional flex width
41
+ * - `<n>%`: literal percentage width
42
+ * - number / CSS length string: fixed width
43
+ */
44
+ width?: number | string
45
+ formatter?: string | ((value: any) => any)
46
+ sortFn?: (a: Row, b: Row) => number
47
+ filterFn?: (row: Row, filterValue: any) => boolean
48
+ format?: (value: any) => string
49
+ [key: string]: any
50
+ }
51
+
52
+ export interface DataGridProps<T extends Row = Row> {
53
+ id: string | number
54
+ type: string
55
+ data: T[]
56
+ columns: Column[]
57
+ sorts: { column: string; direction: "asc" | "desc" }[]
58
+ filters: Record<string, any>
59
+ search: { value: string; placeholder?: string } | null
60
+ isStriped?: boolean
61
+ isVirtualized?: boolean
62
+ virtualization?: DataGridVirtualization
63
+ selection: (string | number)[]
64
+ selectionAnchor?: string | number | null
65
+ pagination?: { page: number; pageSize: number; pageSizes: number[] } | null
66
+ rowId?: string
67
+ isMultiSelect: boolean
68
+ onSortChange?: (columnId: string) => void
69
+ onFilterChange?: (payload: { columnId: string; value: any }) => void
70
+ onSearchChange?: (value: string) => void
71
+ onColumnResizeStart?: (payload: {
72
+ columnId: string
73
+ event: PointerEvent
74
+ width: number
75
+ }) => void
76
+ onRowClick?: (payload: {
77
+ rowId: string | number
78
+ shiftKey?: boolean
79
+ metaKey?: boolean
80
+ ctrlKey?: boolean
81
+ }) => void
82
+ onVirtualScroll?: (containerEl: HTMLElement) => void
83
+ onVirtualMount?: (containerEl: HTMLElement) => void
84
+ onRowToggle?: (rowId: string | number) => void
85
+ onPageChange?: (page: number) => void
86
+ onPageNext?: () => void
87
+ onPagePrev?: () => void
88
+ onPageSizeChange?: (pageSize: number) => void
89
+ [key: string]: any
90
+ }
91
+
92
+ export interface DataGridType {
93
+ create(entity: DataGridProps): void
94
+ sortChange(entity: DataGridProps, columnId: string): void
95
+ sortsClear(entity: DataGridProps): void
96
+ filterChange(
97
+ entity: DataGridProps,
98
+ payload: { columnId: string; value: any },
99
+ ): void
100
+ filtersClear(entity: DataGridProps): void
101
+ searchChange(entity: DataGridProps, search: string): void
102
+ columnResize(
103
+ entity: DataGridProps,
104
+ payload: { columnId: string; width: number },
105
+ ): void
106
+ pageChange(entity: DataGridProps, page: number): void
107
+ pageNext(entity: DataGridProps): void
108
+ pagePrev(entity: DataGridProps): void
109
+ pageSizeChange(entity: DataGridProps, pageSize: number): void
110
+ rowClick(
111
+ entity: DataGridProps,
112
+ payload: {
113
+ rowId: string | number
114
+ shiftKey?: boolean
115
+ metaKey?: boolean
116
+ ctrlKey?: boolean
117
+ },
118
+ ): void
119
+ rowSelect(entity: DataGridProps, rowId: string | number): void
120
+ rowDeselect(entity: DataGridProps, rowId: string | number): void
121
+ rowToggle(entity: DataGridProps, rowId: string | number): void
122
+ rowsToggleAll(entity: DataGridProps): void
123
+ rowsSelectAll(entity: DataGridProps): void
124
+ selectionClear(entity: DataGridProps): void
125
+ virtualScroll(entity: DataGridProps, containerEl: HTMLElement): void
126
+ virtualMount(entity: DataGridProps, containerEl: HTMLElement): void
127
+ render(entity: DataGridProps, api: Api): TemplateResult
128
+ renderHeader(entity: DataGridProps, api: Api): TemplateResult
129
+ renderToolbar(entity: DataGridProps, api: Api): TemplateResult
130
+ renderHeaderColumn(
131
+ entity: DataGridProps,
132
+ payload: { column: Column; index: number },
133
+ api: Api,
134
+ ): TemplateResult
135
+ renderBody(entity: DataGridProps, api: Api): TemplateResult
136
+ renderRow(
137
+ entity: DataGridProps,
138
+ payload: { row: Row; index: number },
139
+ api: Api,
140
+ ): TemplateResult
141
+ renderCell(
142
+ entity: DataGridProps,
143
+ payload: { cell: any; index: number },
144
+ api: Api,
145
+ ): TemplateResult
146
+ renderValue(
147
+ entity: DataGridProps,
148
+ payload: { value: any; column: Column; index: number },
149
+ api: Api,
150
+ ): any
151
+ }
@@ -0,0 +1,14 @@
1
+ import type { TemplateResult } from "@inglorious/web"
2
+
3
+ export interface DividerProps {
4
+ id?: string
5
+ orientation?: "horizontal" | "vertical"
6
+ isInset?: boolean
7
+ [key: string]: unknown
8
+ }
9
+
10
+ export interface DividerType {
11
+ render(props: DividerProps): TemplateResult
12
+ }
13
+
14
+ export declare const divider: DividerType
@@ -0,0 +1,16 @@
1
+ import type { TemplateResult } from "@inglorious/web"
2
+
3
+ export interface IconProps {
4
+ id?: string
5
+ children?: TemplateResult | string | number
6
+ size?: "sm" | "md" | "lg"
7
+ color?: string
8
+ onClick?: () => void
9
+ [key: string]: unknown
10
+ }
11
+
12
+ export interface IconType {
13
+ render(props: IconProps): TemplateResult
14
+ }
15
+
16
+ export declare const icon: IconType