@inglorious/ui 9.8.0 → 9.8.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 (104) hide show
  1. package/package.json +5 -5
  2. package/src/controls/button/style.css +0 -2
  3. package/src/controls/button/template.js +2 -3
  4. package/src/controls/checkbox/style.css +0 -1
  5. package/src/controls/checkbox/template.js +0 -2
  6. package/src/controls/combobox/style.css +0 -14
  7. package/src/controls/combobox/template.js +0 -13
  8. package/src/controls/file-upload/template.js +1 -1
  9. package/src/controls/image-cropper/helpers.js +0 -2
  10. package/src/controls/image-cropper/image.js +0 -2
  11. package/src/controls/image-cropper/style.css +0 -6
  12. package/src/controls/image-cropper/template.js +3 -5
  13. package/src/controls/input/style.css +0 -1
  14. package/src/controls/radio-group/style.css +0 -2
  15. package/src/controls/rating/style.css +0 -3
  16. package/src/controls/select/style.css +0 -6
  17. package/src/controls/slider/style.css +0 -5
  18. package/src/controls/slider/template.js +0 -1
  19. package/src/controls/switch/style.css +0 -1
  20. package/src/controls/switch/template.js +0 -2
  21. package/src/controls/textarea/style.css +0 -2
  22. package/src/data-display/before-after/style.css +0 -4
  23. package/src/data-display/before-after/template.js +3 -3
  24. package/src/data-display/carousel/carousel.stories.js +0 -2
  25. package/src/data-display/carousel/handlers.js +0 -2
  26. package/src/data-display/carousel/style.css +0 -18
  27. package/src/data-display/carousel/template.js +0 -15
  28. package/src/data-display/chat/index.js +0 -1
  29. package/src/data-display/chat/style.css +0 -2
  30. package/src/data-display/chat/template.js +0 -1
  31. package/src/data-display/chip/template.js +0 -1
  32. package/src/data-display/data-grid/base.css +0 -2
  33. package/src/data-display/data-grid/handlers.js +1 -8
  34. package/src/data-display/data-grid/helpers.js +0 -5
  35. package/src/data-display/data-grid/template.js +0 -1
  36. package/src/data-display/data-grid/theme.css +0 -1
  37. package/src/data-display/icon/style.css +0 -7
  38. package/src/data-display/icon/template.js +2 -2
  39. package/src/data-display/table/style.css +0 -2
  40. package/src/data-display/tooltip/style.css +0 -3
  41. package/src/data-display/virtual-list/handlers.js +0 -2
  42. package/src/data-display/virtual-list/template.js +2 -4
  43. package/src/examples/dashboard/before-after-data.js +0 -3
  44. package/src/examples/dashboard/data.js +0 -1
  45. package/src/examples/dashboard/primitive-content.js +0 -2
  46. package/src/examples/dashboard/style.css +0 -3
  47. package/src/feedback/alert/style.css +0 -1
  48. package/src/feedback/dialog/dialog.stories.js +0 -4
  49. package/src/feedback/dialog/style.css +0 -10
  50. package/src/feedback/dialog/template.js +0 -5
  51. package/src/feedback/progress/style.css +0 -6
  52. package/src/feedback/progress/template.js +0 -3
  53. package/src/feedback/snackbar/snackbar.stories.js +0 -1
  54. package/src/feedback/snackbar/style.css +0 -10
  55. package/src/layout/flex/style.css +0 -2
  56. package/src/navigation/bottom-navigation/style.css +0 -7
  57. package/src/navigation/drawer/style.css +0 -21
  58. package/src/navigation/drawer/template.js +0 -2
  59. package/src/navigation/menu/menu.stories.js +0 -2
  60. package/src/navigation/menu/style.css +0 -4
  61. package/src/navigation/menu/template.js +0 -3
  62. package/src/navigation/speed-dial/style.css +0 -4
  63. package/src/navigation/speed-dial/template.js +0 -5
  64. package/src/navigation/tabs/template.js +0 -2
  65. package/src/navigation/view-transitions/index.js +0 -13
  66. package/src/navigation/view-transitions/style.css +0 -2
  67. package/src/shared/icons.js +0 -4
  68. package/src/styles/themes/bootstrap.css +0 -40
  69. package/src/styles/themes/inglorious.css +0 -21
  70. package/src/styles/themes/ios-18.css +0 -47
  71. package/src/styles/themes/ios-26.css +0 -55
  72. package/src/styles/themes/material-3.css +0 -52
  73. package/src/styles/themes/material-ui.css +0 -43
  74. package/src/styles/tokens.css +0 -40
  75. package/src/surfaces/accordion/style.css +0 -2
  76. package/src/surfaces/accordion/template.js +0 -4
  77. package/src/surfaces/app-bar/style.css +0 -3
  78. package/src/surfaces/card/style.css +0 -3
  79. package/types/controls/button-group.d.ts +5 -3
  80. package/types/controls/button.d.ts +3 -1
  81. package/types/controls/combobox.d.ts +13 -0
  82. package/types/controls/fab.d.ts +1 -1
  83. package/types/controls/icon-button.d.ts +7 -21
  84. package/types/controls/input.d.ts +2 -2
  85. package/types/data-display/avatar.d.ts +1 -1
  86. package/types/data-display/badge.d.ts +4 -2
  87. package/types/data-display/chip.d.ts +5 -3
  88. package/types/data-display/icon.d.ts +4 -2
  89. package/types/data-display/tooltip.d.ts +4 -2
  90. package/types/data-display/typography.d.ts +3 -1
  91. package/types/feedback/alert.d.ts +3 -1
  92. package/types/feedback/backdrop.d.ts +4 -2
  93. package/types/feedback/dialog.d.ts +3 -1
  94. package/types/index.d.ts +1 -0
  95. package/types/layout/container.d.ts +3 -1
  96. package/types/layout/flex.d.ts +9 -11
  97. package/types/layout/grid.d.ts +4 -2
  98. package/types/navigation/breadcrumbs.d.ts +1 -1
  99. package/types/navigation/drawer.d.ts +3 -1
  100. package/types/navigation/link.d.ts +4 -2
  101. package/types/shared/renderable.d.ts +12 -0
  102. package/types/surfaces/app-bar.d.ts +3 -1
  103. package/types/surfaces/card.d.ts +4 -2
  104. package/types/surfaces/paper.d.ts +3 -1
@@ -1,7 +1,3 @@
1
- /* The writing direction as a number, for what moves sideways: a slide that
2
- goes `translateX(calc(-100% * var(--iw-dir-sign)))` leaves to the left in
3
- English and to the right in Arabic. Set again on any element with a `dir`,
4
- so a subtree in the other direction gets its own. */
5
1
  :root,
6
2
  [dir="ltr"] {
7
3
  --iw-dir-sign: 1;
@@ -12,13 +8,9 @@
12
8
  }
13
9
 
14
10
  :root {
15
- /* ========================================
16
- COLOR PALETTE - Primitive Colors
17
- ======================================== */
18
11
  --iw-color-white: #ffffff;
19
12
  --iw-color-black: #000000;
20
13
 
21
- /* Brand Colors */
22
14
  --iw-color-primary-50: #e6fff0;
23
15
  --iw-color-primary-100: #b3ffd6;
24
16
  --iw-color-primary-200: #80ffbd;
@@ -30,7 +22,6 @@
30
22
  --iw-color-primary-800: #006637;
31
23
  --iw-color-primary-900: #00331c;
32
24
 
33
- /* Neutral Colors */
34
25
  --iw-color-gray-50: #fafafa;
35
26
  --iw-color-gray-100: #f4f4f5;
36
27
  --iw-color-gray-200: #e4e4e7;
@@ -42,7 +33,6 @@
42
33
  --iw-color-gray-800: #27272a;
43
34
  --iw-color-gray-900: #18181b;
44
35
 
45
- /* Semantic Colors */
46
36
  --iw-color-success-light: #d1fae5;
47
37
  --iw-color-success: #10b981;
48
38
  --iw-color-success-dark: #065f46;
@@ -59,9 +49,6 @@
59
49
  --iw-color-info: #3b82f6;
60
50
  --iw-color-info-dark: #1e40af;
61
51
 
62
- /* ========================================
63
- SPACING SCALE
64
- ======================================== */
65
52
  --iw-space-0: 0;
66
53
  --iw-space-1: 0.25rem;
67
54
  --iw-space-2: 0.5rem;
@@ -77,18 +64,12 @@
77
64
  --iw-space-20: 5rem;
78
65
  --iw-space-24: 6rem;
79
66
 
80
- /* ========================================
81
- BREAKPOINTS
82
- ======================================== */
83
67
  --iw-breakpoint-xs: 20rem;
84
68
  --iw-breakpoint-sm: 40rem;
85
69
  --iw-breakpoint-md: 48rem;
86
70
  --iw-breakpoint-lg: 64rem;
87
71
  --iw-breakpoint-xl: 80rem;
88
72
 
89
- /* ========================================
90
- BORDER RADIUS
91
- ======================================== */
92
73
  --iw-radius-none: 0;
93
74
  --iw-radius-sm: 2px;
94
75
  --iw-radius-md: 4px;
@@ -97,9 +78,6 @@
97
78
  --iw-radius-2xl: 16px;
98
79
  --iw-radius-full: 9999px;
99
80
 
100
- /* ========================================
101
- TYPOGRAPHY
102
- ======================================== */
103
81
  --iw-font-family-sans:
104
82
  system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
105
83
  "Helvetica Neue", Arial, sans-serif;
@@ -125,14 +103,10 @@
125
103
  --iw-line-height-normal: 1.5;
126
104
  --iw-line-height-relaxed: 1.75;
127
105
 
128
- /* Labels of buttons and tabs: a theme can set them in capitals. */
129
106
  --iw-label-text-transform: none;
130
107
  --iw-label-letter-spacing: normal;
131
108
  --iw-label-font-weight: var(--iw-font-weight-normal);
132
109
 
133
- /* ========================================
134
- SHADOWS
135
- ======================================== */
136
110
  --iw-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
137
111
  --iw-shadow-md:
138
112
  0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
@@ -141,12 +115,6 @@
141
115
  --iw-shadow-xl:
142
116
  0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
143
117
 
144
- /* ========================================
145
- TRANSITIONS
146
- ======================================== */
147
- /* A duration and an easing, so that motion can pick one of each. Anything
148
- that has to vary them separately — a page arriving is not eased the way a
149
- page leaving is — composes them rather than reaching for the shorthands. */
150
118
  --iw-duration-fast: 150ms;
151
119
  --iw-duration-normal: 200ms;
152
120
  --iw-duration-page: 250ms;
@@ -155,19 +123,11 @@
155
123
  --iw-easing-accelerate: cubic-bezier(0.4, 0, 1, 1);
156
124
  --iw-easing-decelerate: cubic-bezier(0, 0, 0.2, 1);
157
125
 
158
- /* Shorthands for a plain `ease` at one of the durations above. These keep
159
- working as they always have; reach for the tokens above instead when the
160
- easing has to be anything other than `ease`. The page transitions in
161
- `view-transitions` compose the two on purpose — a page arriving decelerates
162
- and a page leaving accelerates — so they are not a shorthand case. */
163
126
  --iw-transition-fast: var(--iw-duration-fast) ease;
164
127
  --iw-transition-normal: var(--iw-duration-normal) ease;
165
128
  --iw-transition-page: var(--iw-duration-page) ease;
166
129
  --iw-transition-slow: var(--iw-duration-slow) ease;
167
130
 
168
- /* ========================================
169
- Z-INDEX SCALE
170
- ======================================== */
171
131
  --iw-z-dropdown: 1000;
172
132
  --iw-z-sticky: 1020;
173
133
  --iw-z-fixed: 1030;
@@ -11,8 +11,6 @@
11
11
  border-top: 1px solid var(--iw-color-border);
12
12
  }
13
13
 
14
- /* A <summary>: flex drops the browser's disclosure marker, and the caret
15
- stands in for it. */
16
14
  .iw-accordion-trigger {
17
15
  padding: var(--iw-space-3) var(--iw-space-4);
18
16
  display: flex;
@@ -86,12 +86,9 @@ export const Accordion = {
86
86
  name=${props.name || nothing}
87
87
  .open=${isExpanded}
88
88
  @toggle=${(event) => {
89
- // newState is what the browser says; an environment whose toggle
90
- // event lacks it, such as jsdom, still has the element's own state.
91
89
  const isOpen = event.newState
92
90
  ? event.newState === "open"
93
91
  : event.currentTarget.open
94
- // Also fires when isExpanded opened it, which needs no report.
95
92
  if (isOpen === isExpanded) return
96
93
  onToggle?.(item, index, isOpen)
97
94
  props.onItemToggle?.(item, index, isOpen)
@@ -101,7 +98,6 @@ export const Accordion = {
101
98
  class="iw-accordion-trigger"
102
99
  aria-disabled=${isDisabled ? "true" : nothing}
103
100
  @click=${(event) => {
104
- // A summary cannot be disabled, so its toggle is refused instead.
105
101
  if (isDisabled) event.preventDefault()
106
102
  }}
107
103
  >
@@ -2,9 +2,6 @@
2
2
  display: flex;
3
3
  align-items: center;
4
4
  min-height: var(--iw-space-16);
5
- /* gap: var(--iw-space-3); */
6
- /* Room either side of the title and controls, so they do not touch the
7
- edges of the screen. */
8
5
  padding-inline: var(--iw-space-4);
9
6
  background: var(--iw-app-bar-bg, var(--iw-color-surface));
10
7
  color: var(--iw-color-text);
@@ -11,15 +11,12 @@
11
11
  transform var(--iw-transition-normal);
12
12
  }
13
13
 
14
- /* Set into the page rather than raised from it, for content grouped inside
15
- another surface. */
16
14
  .iw-card-sunk {
17
15
  background-color: var(--iw-color-bg-secondary, var(--iw-card-bg));
18
16
  border-color: transparent;
19
17
  box-shadow: none;
20
18
  }
21
19
 
22
- /* Only the grouping: no surface at all. */
23
20
  .iw-card-clear {
24
21
  background-color: transparent;
25
22
  border-color: transparent;
@@ -1,10 +1,12 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
+ import type { Renderable } from "../shared/renderable"
4
+
3
5
  export interface ButtonGroupItem {
4
6
  id?: string
5
7
  value?: string
6
8
  label: string
7
- children?: TemplateResult | string | number
9
+ children?: Renderable
8
10
  isDisabled?: boolean
9
11
  variant?: "default" | "outline" | "ghost"
10
12
  color?:
@@ -16,8 +18,8 @@ export interface ButtonGroupItem {
16
18
  | "error"
17
19
  | "info"
18
20
  size?: "sm" | "md" | "lg"
19
- icon?: string
20
- iconAfter?: string
21
+ icon?: TemplateResult | string
22
+ iconAfter?: TemplateResult | string
21
23
  [key: string]: unknown
22
24
  }
23
25
 
@@ -1,9 +1,11 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
+ import type { Renderable } from "../shared/renderable"
4
+
3
5
  export interface ButtonProps {
4
6
  id?: string
5
7
  type?: string
6
- children?: TemplateResult | string | number
8
+ children?: Renderable
7
9
  variant?: "default" | "outline" | "ghost"
8
10
  color?:
9
11
  | "default"
@@ -70,3 +70,16 @@ export type ComboboxType = {
70
70
  }
71
71
 
72
72
  export declare const Combobox: ComboboxType
73
+
74
+ export declare function getOptionValue(option: ComboboxOption): string | number
75
+ export declare function getOptionLabel(option: ComboboxOption): string
76
+ export declare function formatOption(option: ComboboxOption): ComboboxOption
77
+ export declare function isOptionSelected(
78
+ option: ComboboxOption,
79
+ selectedValue: ComboboxProps["selectedValue"],
80
+ isMulti?: boolean,
81
+ ): boolean
82
+ export declare function filterOptions(
83
+ options: ComboboxOption[],
84
+ searchTerm: string,
85
+ ): ComboboxOption[]
@@ -16,7 +16,7 @@ export interface FabProps {
16
16
  type?: "button" | "submit" | "reset" | "menu"
17
17
  isExtended?: boolean
18
18
  ariaLabel?: string
19
- onClick?: () => void
19
+ onClick?: (event: MouseEvent) => void
20
20
  [key: string]: unknown
21
21
  }
22
22
 
@@ -1,27 +1,13 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
- export interface IconButtonProps {
4
- id?: string
5
- type?: string
6
- icon?: string
7
- label?: string
8
- iconAfter?: string
3
+ import type { ButtonProps } from "./button"
4
+
5
+ /** A Button, with its content given as icons and a label. */
6
+ export interface IconButtonProps extends ButtonProps {
7
+ icon?: TemplateResult | string
8
+ label?: TemplateResult | string | number
9
+ iconAfter?: TemplateResult | string
9
10
  direction?: "row" | "column"
10
- ariaLabel?: string
11
- variant?: "default" | "outline" | "ghost"
12
- color?:
13
- | "default"
14
- | "primary"
15
- | "secondary"
16
- | "success"
17
- | "warning"
18
- | "error"
19
- | "info"
20
- size?: "sm" | "md" | "lg"
21
- isDisabled?: boolean
22
- isFullWidth?: boolean
23
- buttonType?: "button" | "submit" | "reset" | "menu"
24
- onClick?: () => void
25
11
  }
26
12
 
27
13
  export type IconButtonType = {
@@ -29,8 +29,8 @@ export interface InputProps {
29
29
  isReadOnly?: boolean
30
30
  isRequired?: boolean
31
31
  isFullWidth?: boolean
32
- icon?: string
33
- iconAfter?: string
32
+ icon?: TemplateResult | string
33
+ iconAfter?: TemplateResult | string
34
34
  onChange?: (value: string) => void
35
35
  onBlur?: () => void
36
36
  onFocus?: () => void
@@ -19,7 +19,7 @@ export interface AvatarProps {
19
19
  backgroundColor?: string
20
20
  textColor?: string
21
21
  children?: TemplateResult | string | number
22
- onClick?: () => void
22
+ onClick?: (event: MouseEvent) => void
23
23
  [key: string]: unknown
24
24
  }
25
25
 
@@ -1,15 +1,17 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
+ import type { Renderable } from "../shared/renderable"
4
+
3
5
  export interface BadgeProps {
4
6
  id?: string
5
- children?: TemplateResult | string | number
7
+ children?: Renderable
6
8
  color?: "primary" | "secondary" | "success" | "warning" | "error" | "info"
7
9
  variant?: "solid" | "outline"
8
10
  size?: "sm" | "md" | "lg"
9
11
  shape?: "rectangle" | "pill" | "circle" | "square"
10
12
  ringWidth?: string
11
13
  className?: string
12
- onClick?: () => void
14
+ onClick?: (event: MouseEvent) => void
13
15
  [key: string]: unknown
14
16
  }
15
17
 
@@ -1,10 +1,12 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
+ import type { Renderable } from "../shared/renderable"
4
+
3
5
  export interface ChipProps {
4
6
  id?: string
5
- children?: TemplateResult | string | number
7
+ children?: Renderable
6
8
  /** Shown before the label, such as an `Icon.render(...)`. Decorative. */
7
- icon?: TemplateResult
9
+ icon?: TemplateResult | string
8
10
  isRemovable?: boolean
9
11
  color?:
10
12
  | "default"
@@ -23,7 +25,7 @@ export interface ChipProps {
23
25
  isSelected?: boolean
24
26
  /** Only for a chip with `isSelected`. */
25
27
  isDisabled?: boolean
26
- onClick?: () => void
28
+ onClick?: (event: MouseEvent) => void
27
29
  [key: string]: unknown
28
30
  }
29
31
 
@@ -1,5 +1,7 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
+ import type { Renderable } from "../shared/renderable"
4
+
3
5
  /**
4
6
  * An icon in the Iconify format, as every set on `@iconify-icons/*` exports
5
7
  * it: `import arrowBack from "@iconify-icons/material-symbols/arrow-back"`.
@@ -19,7 +21,7 @@ export interface IconProps {
19
21
  /** The icon to draw, as inline SVG at the size's font size. */
20
22
  icon?: IconData
21
23
  /** Shown when there is no `icon`: an emoji, a glyph, any markup. */
22
- children?: TemplateResult | string | number
24
+ children?: Renderable
23
25
  size?: "sm" | "md" | "lg"
24
26
  color?: string
25
27
  /**
@@ -30,7 +32,7 @@ export interface IconProps {
30
32
  /** Names an icon that means something on its own. Without it the icon is decorative. */
31
33
  label?: string
32
34
  className?: string
33
- onClick?: () => void
35
+ onClick?: (event: MouseEvent) => void
34
36
  [key: string]: unknown
35
37
  }
36
38
 
@@ -1,15 +1,17 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
+ import type { Renderable } from "../shared/renderable"
4
+
3
5
  export interface TooltipProps {
4
6
  id?: string
5
- children?: TemplateResult | string | number
7
+ children?: Renderable
6
8
  content?: TemplateResult | string | number
7
9
  position?: "top" | "right" | "bottom" | "left"
8
10
  size?: "sm" | "md" | "lg"
9
11
  isOpen?: boolean
10
12
  maxWidth?: string
11
13
  className?: string
12
- onClick?: () => void
14
+ onClick?: (event: MouseEvent) => void
13
15
  [key: string]: unknown
14
16
  }
15
17
 
@@ -1,11 +1,13 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
+ import type { Renderable } from "../shared/renderable"
4
+
3
5
  export type TypographyVariant =
4
6
  "body" | "h1" | "h2" | "h3" | "caption" | "overline"
5
7
 
6
8
  export interface TypographyProps {
7
9
  id?: string
8
- children?: TemplateResult | string | number
10
+ children?: Renderable
9
11
  variant?: TypographyVariant
10
12
  align?: "left" | "center" | "right"
11
13
  weight?: string | number
@@ -1,11 +1,13 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
+ import type { Renderable } from "../shared/renderable"
4
+
3
5
  export interface AlertProps {
4
6
  id?: string
5
7
  type?: string
6
8
  title?: TemplateResult | string | number
7
9
  description?: TemplateResult | string | number
8
- children?: TemplateResult | string | number
10
+ children?: Renderable
9
11
  severity?: "info" | "success" | "warning" | "error" | "neutral"
10
12
  variant?: "filled" | "outlined"
11
13
  icon?: TemplateResult | string | number
@@ -1,12 +1,14 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
+ import type { Renderable } from "../shared/renderable"
4
+
3
5
  export interface BackdropProps {
4
6
  id?: string
5
7
  type?: string
6
8
  isOpen?: boolean
7
9
  className?: string
8
- children?: TemplateResult | string | number
9
- onClick?: () => void
10
+ children?: Renderable
11
+ onClick?: (event: MouseEvent) => void
10
12
  [key: string]: unknown
11
13
  }
12
14
 
@@ -1,5 +1,7 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
+ import type { Renderable } from "../shared/renderable"
4
+
3
5
  export interface DialogProps {
4
6
  id?: string
5
7
  type?: string
@@ -16,7 +18,7 @@ export interface DialogProps {
16
18
  variant?: "dialog" | "sheet"
17
19
  title?: TemplateResult | string | number
18
20
  description?: TemplateResult | string | number
19
- children?: TemplateResult | string | number
21
+ children?: Renderable
20
22
  actions?: TemplateResult | string | number
21
23
  className?: string
22
24
  /** The close button's accessible name, for the app's language. Defaults to `"Close"`. */
package/types/index.d.ts CHANGED
@@ -80,6 +80,7 @@ export type { TextareaProps, TextareaType } from "./controls/textarea"
80
80
  export type { FileUploadProps, FileUploadType } from "./controls/file-upload"
81
81
  export type { ContainerProps, ContainerType } from "./layout/container"
82
82
  export type { FlexProps, FlexType } from "./layout/flex"
83
+ export type { Renderable } from "./shared/renderable"
83
84
  export type { GridProps, GridType } from "./layout/grid"
84
85
  export type {
85
86
  BottomNavigationProps,
@@ -1,5 +1,7 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
+ import type { Renderable } from "../shared/renderable"
4
+
3
5
  export interface ContainerProps {
4
6
  id?: string
5
7
  type?: string
@@ -12,7 +14,7 @@ export interface ContainerProps {
12
14
  | "nav"
13
15
  | "aside"
14
16
  | "article"
15
- children?: TemplateResult | string | number
17
+ children?: Renderable
16
18
  maxWidth?: "xs" | "sm" | "md" | "lg" | "xl" | "none" | false | number | string
17
19
  isFixed?: boolean
18
20
  padding?: "none" | "sm" | "md" | "lg" | "xl"
@@ -1,17 +1,13 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
+ import type { Renderable } from "../shared/renderable"
4
+
3
5
  export interface FlexProps {
4
6
  id?: string
5
7
  type?: string
6
- element?:
7
- | "div"
8
- | "section"
9
- | "main"
10
- | "header"
11
- | "footer"
12
- | "nav"
13
- | "aside"
14
- | "article"
8
+ /** The tag to render. Defaults to `"div"`. */
9
+ element?: keyof HTMLElementTagNameMap
10
+ className?: string
15
11
  direction?: "row" | "column" | "row-reverse" | "column-reverse"
16
12
  wrap?: "nowrap" | "wrap" | "wrap-reverse"
17
13
  justify?: "start" | "center" | "end" | "between" | "around" | "evenly"
@@ -21,8 +17,10 @@ export interface FlexProps {
21
17
  overflow?: "visible" | "hidden" | "clip" | "scroll" | "auto"
22
18
  isInline?: boolean
23
19
  isFullWidth?: boolean
24
- children?: Array<TemplateResult | string | number>
25
- onClick?: () => void
20
+ children?: Renderable
21
+ onClick?: (event: MouseEvent) => void
22
+ /** Any other property is set on the element, such as `style` or `data-*`. */
23
+ [key: string]: unknown
26
24
  }
27
25
 
28
26
  export type FlexType = {
@@ -1,5 +1,7 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
+ import type { Renderable } from "../shared/renderable"
4
+
3
5
  export interface GridProps {
4
6
  id?: string
5
7
  type?: string
@@ -19,8 +21,8 @@ export interface GridProps {
19
21
  align?: "stretch" | "start" | "center" | "end"
20
22
  justify?: "stretch" | "start" | "center" | "end"
21
23
  isFullWidth?: boolean
22
- children?: Array<TemplateResult | string | number>
23
- onClick?: () => void
24
+ children?: Renderable
25
+ onClick?: (event: MouseEvent) => void
24
26
  }
25
27
 
26
28
  export type GridType = {
@@ -4,7 +4,7 @@ export interface BreadcrumbItem {
4
4
  id?: string | number
5
5
  label: TemplateResult | string | number
6
6
  href?: string
7
- onClick?: () => void
7
+ onClick?: (event: MouseEvent) => void
8
8
  [key: string]: unknown
9
9
  }
10
10
 
@@ -1,5 +1,7 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
+ import type { Renderable } from "../shared/renderable"
4
+
3
5
  export interface DrawerProps {
4
6
  id?: string
5
7
  type?: string
@@ -13,7 +15,7 @@ export interface DrawerProps {
13
15
  isHidden?: boolean
14
16
  isCollapsed?: boolean
15
17
  title?: TemplateResult | string | number
16
- children?: TemplateResult | string | number
18
+ children?: Renderable
17
19
  hasBackdrop?: boolean
18
20
  className?: string
19
21
  /** The close button's accessible name, for the app's language. Defaults to `"Close"`. */
@@ -1,17 +1,19 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
+ import type { Renderable } from "../shared/renderable"
4
+
3
5
  export interface LinkProps {
4
6
  id?: string
5
7
  type?: string
6
8
  href?: string
7
9
  label?: TemplateResult | string | number
8
- children?: TemplateResult | string | number
10
+ children?: Renderable
9
11
  underline?: "always" | "hover" | "none"
10
12
  color?: "primary" | "secondary" | "inherit"
11
13
  isMuted?: boolean
12
14
  isExternal?: boolean
13
15
  className?: string
14
- onClick?: () => void
16
+ onClick?: (event: MouseEvent) => void
15
17
  [key: string]: unknown
16
18
  }
17
19
 
@@ -0,0 +1,12 @@
1
+ import type { TemplateResult } from "@inglorious/web"
2
+
3
+ /** What a template can render, `nothing` and `when()`'s results included. */
4
+ export type Renderable =
5
+ | TemplateResult
6
+ | string
7
+ | number
8
+ | boolean
9
+ | symbol
10
+ | null
11
+ | undefined
12
+ | Renderable[]
@@ -1,5 +1,7 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
+ import type { Renderable } from "../shared/renderable"
4
+
3
5
  export interface AppBarProps {
4
6
  id?: string
5
7
  type?: string
@@ -7,7 +9,7 @@ export interface AppBarProps {
7
9
  subtitle?: TemplateResult | string | number
8
10
  leading?: TemplateResult | string | number
9
11
  trailing?: TemplateResult | string | number
10
- children?: TemplateResult | string | number
12
+ children?: Renderable
11
13
  isDense?: boolean
12
14
  variant?: "regular" | "dense" | "prominent"
13
15
  color?: "default" | "primary" | "secondary" | "transparent" | "inherit"
@@ -1,5 +1,7 @@
1
1
  import type { TemplateResult } from "@inglorious/web"
2
2
 
3
+ import type { Renderable } from "../shared/renderable"
4
+
3
5
  export interface CardProps {
4
6
  id?: string
5
7
  type?: string
@@ -21,7 +23,7 @@ export interface CardProps {
21
23
  subtitle?: TemplateResult | string | number
22
24
  header?: TemplateResult | string | number
23
25
  body?: TemplateResult | string | number
24
- children?: TemplateResult | string | number
26
+ children?: Renderable
25
27
  footer?: TemplateResult | string | number
26
28
  headerPadding?: "none" | "sm" | "md" | "lg" | "xl"
27
29
  bodyPadding?: "none" | "sm" | "md" | "lg" | "xl"
@@ -30,7 +32,7 @@ export interface CardProps {
30
32
  isClickable?: boolean
31
33
  isFullWidth?: boolean
32
34
  className?: string
33
- onClick?: () => void
35
+ onClick?: (event: MouseEvent) => void
34
36
  [key: string]: unknown
35
37
  }
36
38