@inglorious/ui 0.1.0 → 1.0.1

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 +190 -15
  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
@@ -0,0 +1,23 @@
1
+ import type { TemplateResult } from "@inglorious/web"
2
+
3
+ export interface DrawerProps {
4
+ id?: string
5
+ type?: string
6
+ isOpen?: boolean
7
+ anchor?: "left" | "right" | "top" | "bottom"
8
+ variant?: "temporary" | "persistent" | "permanent" | "responsive"
9
+ breakpoint?: "sm" | "md" | "lg" | "xl"
10
+ isCollapsed?: boolean
11
+ title?: TemplateResult | string | number
12
+ children?: TemplateResult | string | number
13
+ hasBackdrop?: boolean
14
+ className?: string
15
+ onClose?: () => void
16
+ [key: string]: unknown
17
+ }
18
+
19
+ export interface DrawerType {
20
+ render(props: DrawerProps): TemplateResult | null
21
+ }
22
+
23
+ export declare const drawer: DrawerType
@@ -0,0 +1,22 @@
1
+ import type { TemplateResult } from "@inglorious/web"
2
+
3
+ export interface LinkProps {
4
+ id?: string
5
+ type?: string
6
+ href?: string
7
+ label?: TemplateResult | string | number
8
+ children?: TemplateResult | string | number
9
+ underline?: "always" | "hover" | "none"
10
+ color?: "primary" | "secondary" | "inherit"
11
+ isMuted?: boolean
12
+ isExternal?: boolean
13
+ className?: string
14
+ onClick?: () => void
15
+ [key: string]: unknown
16
+ }
17
+
18
+ export interface LinkType {
19
+ render(props: LinkProps): TemplateResult
20
+ }
21
+
22
+ export declare const link: LinkType
@@ -0,0 +1,32 @@
1
+ import type { TemplateResult } from "@inglorious/web"
2
+
3
+ export interface MenuItem {
4
+ id?: string | number
5
+ value?: string | number
6
+ label?: TemplateResult | string | number
7
+ icon?: TemplateResult | string | number
8
+ trailing?: TemplateResult | string | number
9
+ hasDivider?: boolean
10
+ isDisabled?: boolean
11
+ isSelected?: boolean
12
+ onClick?: (value: string | number) => void
13
+ [key: string]: unknown
14
+ }
15
+
16
+ export interface MenuProps {
17
+ id?: string
18
+ type?: string
19
+ isOpen?: boolean
20
+ items?: MenuItem[]
21
+ isDense?: boolean
22
+ className?: string
23
+ onItemClick?: (value: string | number, item: MenuItem) => void
24
+ [key: string]: unknown
25
+ }
26
+
27
+ export interface MenuType {
28
+ render(props: MenuProps): TemplateResult | null
29
+ renderItem(item: MenuItem, index: number, props: MenuProps): TemplateResult
30
+ }
31
+
32
+ export declare const menu: MenuType
@@ -0,0 +1,50 @@
1
+ import type { TemplateResult } from "@inglorious/web"
2
+
3
+ export interface PaginationProps {
4
+ id?: string
5
+ type?: string
6
+ page?: number
7
+ count?: number
8
+ siblingCount?: number
9
+ isFirstButtonVisible?: boolean
10
+ isLastButtonVisible?: boolean
11
+ isDisabled?: boolean
12
+ buttonVariant?: "default" | "outline" | "ghost"
13
+ buttonColor?:
14
+ | "primary"
15
+ | "secondary"
16
+ | "success"
17
+ | "warning"
18
+ | "error"
19
+ | "info"
20
+ buttonSize?: "sm" | "md" | "lg"
21
+ itemClassName?: string
22
+ className?: string
23
+ onChange?: (page: number) => void
24
+ [key: string]: unknown
25
+ }
26
+
27
+ export interface PaginationItemRenderProps {
28
+ item: number | string
29
+ }
30
+
31
+ export interface PaginationControlRenderProps {
32
+ label: string
33
+ target: number
34
+ isDisabled?: boolean
35
+ onChange?: (page: number) => void
36
+ }
37
+
38
+ export interface PaginationType {
39
+ render(props: PaginationProps): TemplateResult
40
+ renderItem(
41
+ props: PaginationProps,
42
+ payload: PaginationItemRenderProps,
43
+ ): TemplateResult
44
+ renderControl(
45
+ props: PaginationProps,
46
+ payload: PaginationControlRenderProps,
47
+ ): TemplateResult
48
+ }
49
+
50
+ export declare const pagination: PaginationType
@@ -0,0 +1,35 @@
1
+ import type { TemplateResult } from "@inglorious/web"
2
+
3
+ export interface SpeedDialAction {
4
+ id?: string | number
5
+ value?: string | number
6
+ label?: TemplateResult | string | number
7
+ icon?: TemplateResult | string | number
8
+ isDisabled?: boolean
9
+ onClick?: (value: string | number) => void
10
+ [key: string]: unknown
11
+ }
12
+
13
+ export interface SpeedDialProps {
14
+ id?: string
15
+ type?: string
16
+ isOpen?: boolean
17
+ icon?: TemplateResult | string | number
18
+ ariaLabel?: string
19
+ direction?: "up" | "down" | "left" | "right"
20
+ actions?: SpeedDialAction[]
21
+ onToggle?: (isOpen: boolean) => void
22
+ onAction?: (value: string | number, action: SpeedDialAction) => void
23
+ [key: string]: unknown
24
+ }
25
+
26
+ export interface SpeedDialType {
27
+ render(props: SpeedDialProps): TemplateResult
28
+ renderAction(
29
+ action: SpeedDialAction,
30
+ index: number,
31
+ props: SpeedDialProps,
32
+ ): TemplateResult
33
+ }
34
+
35
+ export declare const speedDial: SpeedDialType
@@ -0,0 +1,26 @@
1
+ import type { TemplateResult } from "@inglorious/web"
2
+
3
+ export interface Step {
4
+ id?: string | number
5
+ label: TemplateResult | string | number
6
+ optional?: TemplateResult | string | number
7
+ isCompleted?: boolean
8
+ [key: string]: unknown
9
+ }
10
+
11
+ export interface StepperProps {
12
+ id?: string
13
+ type?: string
14
+ steps?: Step[]
15
+ activeStep?: number
16
+ orientation?: "horizontal" | "vertical"
17
+ isAlternativeLabel?: boolean
18
+ [key: string]: unknown
19
+ }
20
+
21
+ export interface StepperType {
22
+ render(props: StepperProps): TemplateResult
23
+ renderStep(step: Step, index: number, props: StepperProps): TemplateResult
24
+ }
25
+
26
+ export declare const stepper: StepperType
@@ -0,0 +1,31 @@
1
+ import type { TemplateResult } from "@inglorious/web"
2
+
3
+ export interface TabItem {
4
+ id?: string | number
5
+ value?: string | number
6
+ label: TemplateResult | string | number
7
+ icon?: TemplateResult | string | number
8
+ panel?: TemplateResult | string | number
9
+ isDisabled?: boolean
10
+ onClick?: (value: string | number) => void
11
+ [key: string]: unknown
12
+ }
13
+
14
+ export interface TabsProps {
15
+ id?: string
16
+ type?: string
17
+ items?: TabItem[]
18
+ value?: string | number
19
+ isCentered?: boolean
20
+ isFullWidth?: boolean
21
+ onChange?: (value: string | number) => void
22
+ [key: string]: unknown
23
+ }
24
+
25
+ export interface TabsType {
26
+ render(props: TabsProps): TemplateResult
27
+ renderTab(item: TabItem, index: number, props: TabsProps): TemplateResult
28
+ renderPanel(item: TabItem | null, props: TabsProps): TemplateResult | null
29
+ }
30
+
31
+ export declare const tabs: TabsType
@@ -0,0 +1,32 @@
1
+ import type { TemplateResult } from "@inglorious/web"
2
+
3
+ export interface AccordionItem {
4
+ id?: string | number
5
+ title: TemplateResult | string | number
6
+ content?: TemplateResult | string | number
7
+ icon?: TemplateResult | string | number
8
+ isExpanded?: boolean
9
+ isDisabled?: boolean
10
+ onToggle?: (item: AccordionItem, index: number, expanded: boolean) => void
11
+ [key: string]: unknown
12
+ }
13
+
14
+ export interface AccordionProps {
15
+ id?: string
16
+ type?: string
17
+ className?: string
18
+ items?: AccordionItem[]
19
+ onItemToggle?: (item: AccordionItem, index: number, expanded: boolean) => void
20
+ [key: string]: unknown
21
+ }
22
+
23
+ export interface AccordionType {
24
+ render(props: AccordionProps): TemplateResult
25
+ renderItem(
26
+ item: AccordionItem,
27
+ index: number,
28
+ props: AccordionProps,
29
+ ): TemplateResult
30
+ }
31
+
32
+ export declare const accordion: AccordionType
@@ -0,0 +1,25 @@
1
+ import type { TemplateResult } from "@inglorious/web"
2
+
3
+ export interface AppBarProps {
4
+ id?: string
5
+ type?: string
6
+ title?: TemplateResult | string | number
7
+ subtitle?: TemplateResult | string | number
8
+ leading?: TemplateResult | string | number
9
+ trailing?: TemplateResult | string | number
10
+ children?: TemplateResult | string | number
11
+ isDense?: boolean
12
+ variant?: "regular" | "dense" | "prominent"
13
+ color?: "default" | "primary" | "secondary" | "transparent" | "inherit"
14
+ isElevated?: boolean
15
+ position?: "static" | "sticky" | "fixed" | "absolute" | "relative"
16
+ placement?: "top" | "bottom"
17
+ className?: string
18
+ [key: string]: unknown
19
+ }
20
+
21
+ export interface AppBarType {
22
+ render(props: AppBarProps): TemplateResult
23
+ }
24
+
25
+ export declare const appBar: AppBarType
@@ -0,0 +1,39 @@
1
+ import type { TemplateResult } from "@inglorious/web"
2
+
3
+ export interface CardProps {
4
+ id?: string
5
+ type?: string
6
+ element?:
7
+ | "article"
8
+ | "section"
9
+ | "div"
10
+ | "main"
11
+ | "header"
12
+ | "footer"
13
+ | "nav"
14
+ | "aside"
15
+ title?: TemplateResult | string | number
16
+ subtitle?: TemplateResult | string | number
17
+ header?: TemplateResult | string | number
18
+ body?: TemplateResult | string | number
19
+ children?: TemplateResult | string | number
20
+ footer?: TemplateResult | string | number
21
+ headerPadding?: "none" | "sm" | "md" | "lg" | "xl"
22
+ bodyPadding?: "none" | "sm" | "md" | "lg" | "xl"
23
+ footerPadding?: "none" | "sm" | "md" | "lg" | "xl"
24
+ isHoverable?: boolean
25
+ isClickable?: boolean
26
+ isFullWidth?: boolean
27
+ className?: string
28
+ onClick?: () => void
29
+ [key: string]: unknown
30
+ }
31
+
32
+ export interface CardType {
33
+ render(props: CardProps): TemplateResult
34
+ renderHeader(props: CardProps): TemplateResult | null
35
+ renderBody(props: CardProps): TemplateResult | null
36
+ renderFooter(props: CardProps): TemplateResult | null
37
+ }
38
+
39
+ export declare const card: CardType
@@ -0,0 +1,28 @@
1
+ import type { TemplateResult } from "@inglorious/web"
2
+
3
+ export interface PaperProps {
4
+ id?: string
5
+ type?: string
6
+ element?:
7
+ | "div"
8
+ | "section"
9
+ | "main"
10
+ | "header"
11
+ | "footer"
12
+ | "nav"
13
+ | "aside"
14
+ | "article"
15
+ children?: TemplateResult | string | number
16
+ variant?: "elevated" | "outlined"
17
+ elevation?: number
18
+ padding?: "none" | "sm" | "md" | "lg"
19
+ radius?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full"
20
+ className?: string
21
+ [key: string]: unknown
22
+ }
23
+
24
+ export interface PaperType {
25
+ render(props: PaperProps): TemplateResult
26
+ }
27
+
28
+ export declare const paper: PaperType
@@ -1,19 +0,0 @@
1
- export function withRenderValidation(type) {
2
- if (typeof type.render !== "function") {
3
- throw new TypeError(
4
- "withRenderValidation(type): type.render must be a function",
5
- )
6
- }
7
-
8
- return {
9
- ...type,
10
-
11
- render(entity, api) {
12
- if (entity == null || api == null) {
13
- throw new TypeError("render(entity, api): both arguments are required")
14
- }
15
-
16
- return type.render(entity, api)
17
- },
18
- }
19
- }
@@ -1,135 +0,0 @@
1
- import { html } from "@inglorious/web"
2
-
3
- import {
4
- makeStoryRender,
5
- notifyActionArgType,
6
- } from "../../stories/notifyStory.js"
7
- import { card } from "."
8
-
9
- export default {
10
- title: "Widgets/Card",
11
- tags: ["autodocs"],
12
- render: makeStoryRender(card, "story-card"),
13
- argTypes: {
14
- ...notifyActionArgType,
15
- title: {
16
- control: "text",
17
- description: "Primary header text.",
18
- },
19
- subtitle: {
20
- control: "text",
21
- description: "Secondary header text.",
22
- },
23
- hoverable: {
24
- control: "boolean",
25
- description: "Enables hover visual feedback.",
26
- },
27
- clickable: {
28
- control: "boolean",
29
- description: "Marks the card as interactive and emits click events.",
30
- },
31
- fullWidth: {
32
- control: "boolean",
33
- description: "Expands card width to 100% of its container.",
34
- },
35
- },
36
- parameters: {
37
- docs: {
38
- description: {
39
- component:
40
- "Container widget with overridable header/body/footer sub-renderers.",
41
- },
42
- },
43
- actions: {
44
- handles: ["click"],
45
- },
46
- },
47
- }
48
- export const Default = {}
49
- Default.args = {
50
- title: "Card Title",
51
- subtitle: "This is a card subtitle",
52
- hoverable: false,
53
- clickable: false,
54
- fullWidth: false,
55
- }
56
-
57
- export const Hoverable = {}
58
- Hoverable.args = {
59
- ...Default.args,
60
- hoverable: true,
61
- }
62
-
63
- export const Clickable = {}
64
- Clickable.args = {
65
- ...Default.args,
66
- hoverable: true,
67
- clickable: true,
68
- }
69
-
70
- const cardWithFooter = [
71
- ...card,
72
- {
73
- renderFooter(entity, api) {
74
- return html`<div
75
- class="iw-card-footer"
76
- style="display: flex; gap: 0.5rem;"
77
- >
78
- ${entity.footerActions?.map(
79
- (action) =>
80
- html`<button
81
- class="iw-button iw-button-sm ${action.variant === "ghost"
82
- ? "iw-button-ghost"
83
- : ""}"
84
- @click=${() => api.notify(`#${entity.id}:${action.event}`)}
85
- >
86
- ${action.label}
87
- </button>`,
88
- )}
89
- </div>`
90
- },
91
- },
92
- ]
93
-
94
- export const WithFooter = {}
95
- WithFooter.render = makeStoryRender(cardWithFooter, "card-footer", {
96
- resolveByEntityType: true,
97
- })
98
- WithFooter.args = {
99
- type: "cardWithFooter",
100
- title: "Card with Footer",
101
- subtitle: "This card has a footer section",
102
- footerActions: [
103
- { label: "Cancel", event: "cancel", variant: "ghost" },
104
- { label: "Save", event: "save" },
105
- ],
106
- }
107
-
108
- export const NoHeader = {}
109
- NoHeader.args = {
110
- title: null,
111
- subtitle: null,
112
- }
113
-
114
- export const FullWidth = {}
115
- FullWidth.args = {
116
- ...Default.args,
117
- fullWidth: true,
118
- }
119
-
120
- export const Interactive = {}
121
- Interactive.render = makeStoryRender(cardWithFooter, "card-interactive", {
122
- resolveByEntityType: true,
123
- })
124
- Interactive.args = {
125
- type: "cardWithFooter",
126
- title: "Interactive Card",
127
- subtitle: "Hover, click, and trigger footer actions",
128
- hoverable: true,
129
- clickable: true,
130
- fullWidth: false,
131
- footerActions: [
132
- { label: "Details", event: "details", variant: "ghost" },
133
- { label: "Open", event: "open" },
134
- ],
135
- }
@@ -1,4 +0,0 @@
1
- import { withRenderValidation } from "../../shared/withRenderValidation.js"
2
- import * as renderers from "./template.js"
3
-
4
- export const card = [{ ...renderers }, withRenderValidation]
@@ -1,53 +0,0 @@
1
- .iw-card {
2
- display: flex;
3
- flex-direction: column;
4
- background-color: var(--iw-card-bg);
5
- border: 1px solid var(--iw-card-border);
6
- border-radius: var(--iw-card-radius);
7
- box-shadow: var(--iw-card-shadow);
8
- overflow: hidden;
9
- transition: all var(--iw-transition-normal);
10
-
11
- &.iw-card-hoverable:hover {
12
- box-shadow: var(--iw-card-shadow-hover);
13
- }
14
-
15
- &.iw-card-clickable {
16
- cursor: pointer;
17
- }
18
-
19
- &.iw-card-full-width {
20
- width: 100%;
21
- }
22
-
23
- .iw-card-header {
24
- padding: var(--iw-space-4);
25
- border-bottom: 1px solid var(--iw-color-border);
26
- }
27
-
28
- .iw-card-title {
29
- margin: 0;
30
- font-size: var(--iw-font-size-lg);
31
- font-weight: var(--iw-font-weight-semibold);
32
- color: var(--iw-color-text);
33
- line-height: var(--iw-line-height-tight);
34
- }
35
-
36
- .iw-card-subtitle {
37
- margin: var(--iw-space-1) 0 0;
38
- font-size: var(--iw-font-size-sm);
39
- color: var(--iw-color-text-secondary);
40
- line-height: var(--iw-line-height-normal);
41
- }
42
-
43
- .iw-card-body {
44
- padding: var(--iw-space-4);
45
- flex: 1;
46
- }
47
-
48
- .iw-card-footer {
49
- padding: var(--iw-space-4);
50
- border-top: 1px solid var(--iw-color-border);
51
- background-color: var(--iw-color-bg-secondary);
52
- }
53
- }
@@ -1,97 +0,0 @@
1
- /**
2
- * @typedef {import('../../../types/widgets/card').CardEntity} CardEntity
3
- * @typedef {import('@inglorious/web').Api} Api
4
- * @typedef {import('@inglorious/web').TemplateResult} TemplateResult
5
- */
6
-
7
- import { classMap, html } from "@inglorious/web"
8
-
9
- /**
10
- * Card component for Inglorious Web.
11
- *
12
- * @example
13
- * // Stateless usage
14
- * card.render({ title: 'Card Title', subtitle: 'Description' }, api)
15
- *
16
- * @example
17
- * // Stateful usage with event handling
18
- * // Entity: { type: 'card', id: 'myCard', title: 'Click me' }
19
- * // In store: api.render('myCard')
20
- *
21
- * @param {CardEntity} entity
22
- * @param {Api} api
23
- * @returns {TemplateResult}
24
- */
25
- export function render(entity, api) {
26
- const { hoverable = false, clickable = false, fullWidth = false } = entity
27
- const type = getCardType(entity, api)
28
-
29
- const classes = {
30
- "iw-card": true,
31
- "iw-card-hoverable": hoverable || clickable,
32
- "iw-card-clickable": clickable,
33
- "iw-card-full-width": fullWidth,
34
- }
35
-
36
- return html`
37
- <div
38
- class=${classMap(classes)}
39
- @click=${() => api.notify(`#${entity.id}:click`)}
40
- >
41
- ${type.renderHeader(entity, api)} ${type.renderBody(entity, api)}
42
- ${type.renderFooter(entity, api)}
43
- </div>
44
- `
45
- }
46
-
47
- /**
48
- * Default header renderer.
49
- * Override in composed types for custom header rendering.
50
- * @param {CardEntity} entity
51
- * @returns {TemplateResult | null}
52
- */
53
- export function renderHeader(entity) {
54
- const { title, subtitle } = entity
55
- const hasHeader = title || subtitle
56
- if (!hasHeader) return null
57
-
58
- return html`<div class="iw-card-header">
59
- ${title ? html`<h3 class="iw-card-title">${title}</h3>` : null}
60
- ${subtitle ? html`<p class="iw-card-subtitle">${subtitle}</p>` : null}
61
- </div>`
62
- }
63
-
64
- /**
65
- * Default body renderer.
66
- * Override in composed types for custom body rendering.
67
- * @returns {TemplateResult}
68
- */
69
- export function renderBody() {
70
- return html`<div class="iw-card-body">
71
- <slot></slot>
72
- </div>`
73
- }
74
-
75
- /**
76
- * Default footer renderer.
77
- * Override in composed types for custom footer rendering.
78
- * @returns {TemplateResult | null}
79
- */
80
- export function renderFooter() {
81
- return null
82
- }
83
-
84
- function getCardType(entity, api) {
85
- const resolved = api?.getType?.(entity?.type)
86
- return hasCardRenderers(resolved)
87
- ? resolved
88
- : { renderHeader, renderBody, renderFooter }
89
- }
90
-
91
- function hasCardRenderers(type) {
92
- return (
93
- typeof type?.renderHeader === "function" &&
94
- typeof type?.renderBody === "function" &&
95
- typeof type?.renderFooter === "function"
96
- )
97
- }
@@ -1,21 +0,0 @@
1
- import type { TemplateResult, Api } from "@inglorious/web"
2
-
3
- export interface CardEntity {
4
- id?: string
5
- type?: string
6
- title?: string
7
- subtitle?: string
8
- hoverable?: boolean
9
- clickable?: boolean
10
- fullWidth?: boolean
11
- }
12
-
13
- export interface CardType {
14
- render(entity: CardEntity, api: Api): TemplateResult
15
- renderHeader(entity: CardEntity, api: Api): TemplateResult | null
16
- renderBody(entity: CardEntity, api: Api): TemplateResult
17
- renderFooter(entity: CardEntity, api: Api): TemplateResult | null
18
- click(entity: CardEntity, payload: unknown, api: Api): void
19
- }
20
-
21
- export declare const card: CardType