@infonomic/uikit 6.8.2 → 6.9.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 (224) hide show
  1. package/README.md +183 -19
  2. package/dist/components/accordion/accordion.js +5 -5
  3. package/dist/components/accordion/accordion.module.css +11 -1
  4. package/dist/components/accordion/accordion_module.css +3 -1
  5. package/dist/components/avatar/avatar.d.ts +8 -2
  6. package/dist/components/avatar/avatar.d.ts.map +1 -1
  7. package/dist/components/avatar/avatar.js +6 -7
  8. package/dist/components/avatar/avatar.module.css +9 -4
  9. package/dist/components/avatar/avatar_module.css +3 -1
  10. package/dist/components/badge/badge.d.ts +1 -1
  11. package/dist/components/badge/badge.module.css +9 -4
  12. package/dist/components/badge/badge_module.css +3 -1
  13. package/dist/components/button/button-group.d.ts +1 -1
  14. package/dist/components/button/button-group.module.css +11 -1
  15. package/dist/components/button/button-group_module.css +4 -2
  16. package/dist/components/button/button.module.css +9 -4
  17. package/dist/components/button/button_module.css +3 -1
  18. package/dist/components/button/combo-button.d.ts +1 -1
  19. package/dist/components/button/combo-button.module.css +11 -1
  20. package/dist/components/button/combo-button_module.css +3 -1
  21. package/dist/components/button/control-buttons.module.css +11 -1
  22. package/dist/components/button/control-buttons_module.css +3 -1
  23. package/dist/components/button/copy-button.module.css +9 -4
  24. package/dist/components/button/copy-button_module.css +3 -1
  25. package/dist/components/button/index.d.ts +5 -5
  26. package/dist/components/card/card.module.css +9 -4
  27. package/dist/components/card/card_module.css +3 -1
  28. package/dist/components/chips/chip.module.css +9 -4
  29. package/dist/components/chips/chip_module.css +3 -1
  30. package/dist/components/container/container.module.css +9 -4
  31. package/dist/components/container/container_module.css +6 -4
  32. package/dist/components/dropdown/dropdown.js +11 -11
  33. package/dist/components/dropdown/dropdown.module.css +9 -4
  34. package/dist/components/dropdown/dropdown_module.css +3 -1
  35. package/dist/components/hamburger/hamburger.module.css +9 -4
  36. package/dist/components/hamburger/hamburger_module.css +3 -1
  37. package/dist/components/inputs/autocomplete.module.css +9 -4
  38. package/dist/components/inputs/autocomplete_module.css +3 -1
  39. package/dist/components/inputs/calendar.module.css +9 -4
  40. package/dist/components/inputs/calendar_module.css +4 -2
  41. package/dist/components/inputs/checkbox-group.module.css +9 -4
  42. package/dist/components/inputs/checkbox-group_module.css +3 -1
  43. package/dist/components/inputs/checkbox.module.css +9 -4
  44. package/dist/components/inputs/checkbox_module.css +3 -1
  45. package/dist/components/inputs/error-text.module.css +9 -4
  46. package/dist/components/inputs/error-text_module.css +3 -1
  47. package/dist/components/inputs/help-text.module.css +9 -4
  48. package/dist/components/inputs/help-text_module.css +3 -1
  49. package/dist/components/inputs/input-adornment.module.css +9 -4
  50. package/dist/components/inputs/input-adornment_module.css +3 -1
  51. package/dist/components/inputs/input-password.d.ts +18 -2
  52. package/dist/components/inputs/input-password.d.ts.map +1 -1
  53. package/dist/components/inputs/input-password.js +19 -11
  54. package/dist/components/inputs/input-password.module.css +55 -0
  55. package/dist/components/inputs/input-password.module.js +5 -0
  56. package/dist/components/inputs/input-password_module.css +25 -0
  57. package/dist/components/inputs/input.d.ts +1 -1
  58. package/dist/components/inputs/input.module.css +9 -4
  59. package/dist/components/inputs/input_module.css +3 -1
  60. package/dist/components/inputs/label.module.css +9 -4
  61. package/dist/components/inputs/label_module.css +3 -1
  62. package/dist/components/inputs/radio-group.d.ts +1 -1
  63. package/dist/components/inputs/radio-group.module.css +9 -4
  64. package/dist/components/inputs/radio-group_module.css +3 -1
  65. package/dist/components/inputs/select.module.css +9 -4
  66. package/dist/components/inputs/select_module.css +3 -1
  67. package/dist/components/inputs/text-area.module.css +9 -4
  68. package/dist/components/inputs/text-area_module.css +3 -1
  69. package/dist/components/notifications/alert.module.css +9 -4
  70. package/dist/components/notifications/alert_module.css +4 -2
  71. package/dist/components/notifications/toast.module.css +9 -4
  72. package/dist/components/notifications/toast_module.css +5 -3
  73. package/dist/components/pager/first-button.d.ts +1 -1
  74. package/dist/components/pager/hooks/usePagination.d.ts +1 -1
  75. package/dist/components/pager/last-button.d.ts +1 -1
  76. package/dist/components/pager/next-button.d.ts +1 -1
  77. package/dist/components/pager/number-button.d.ts +1 -1
  78. package/dist/components/pager/pagination.d.ts +7 -7
  79. package/dist/components/pager/pagination.module.css +9 -4
  80. package/dist/components/pager/pagination_module.css +4 -2
  81. package/dist/components/pager/previous-button.d.ts +1 -1
  82. package/dist/components/scroll-area/scroll-area.module.css +9 -4
  83. package/dist/components/scroll-area/scroll-area_module.css +3 -1
  84. package/dist/components/scroll-to-top/scroll-to-top.module.css +9 -3
  85. package/dist/components/scroll-to-top/scroll-to-top_module.css +4 -2
  86. package/dist/components/section/section.module.css +9 -4
  87. package/dist/components/section/section_module.css +3 -1
  88. package/dist/components/shimmer/shimmer.module.css +9 -4
  89. package/dist/components/shimmer/shimmer_module.css +3 -1
  90. package/dist/components/table/table.module.css +9 -4
  91. package/dist/components/table/table_module.css +3 -1
  92. package/dist/components/tabs/tabs.module.css +9 -4
  93. package/dist/components/tabs/tabs_module.css +3 -1
  94. package/dist/components/tooltip/tooltip.module.css +9 -4
  95. package/dist/components/tooltip/tooltip_module.css +3 -1
  96. package/dist/css-layers.d.ts +23 -0
  97. package/dist/css-layers.d.ts.map +1 -0
  98. package/dist/css-layers.js +14 -0
  99. package/dist/icons/icons.module.css +11 -1
  100. package/dist/icons/icons_module.css +3 -1
  101. package/dist/icons/stopwatch-icon.d.ts +1 -1
  102. package/dist/loaders/ellipses.module.css +9 -4
  103. package/dist/loaders/ellipses_module.css +3 -1
  104. package/dist/loaders/ring.module.css +9 -4
  105. package/dist/loaders/ring_module.css +3 -1
  106. package/dist/loaders/spinner.module.css +9 -4
  107. package/dist/loaders/spinner_module.css +3 -1
  108. package/dist/react.d.ts +14 -14
  109. package/dist/styles/components-vanilla.css +1 -1
  110. package/dist/styles/reset.css +1 -1
  111. package/dist/styles/styles.css +1 -1
  112. package/dist/styles/typography.css +1 -1
  113. package/dist/widgets/datepicker/datepicker.d.ts +42 -1
  114. package/dist/widgets/datepicker/datepicker.d.ts.map +1 -1
  115. package/dist/widgets/datepicker/datepicker.js +34 -4
  116. package/dist/widgets/datepicker/datepicker.module.css +21 -2
  117. package/dist/widgets/datepicker/datepicker.module.js +1 -0
  118. package/dist/widgets/datepicker/datepicker_module.css +7 -2
  119. package/dist/widgets/drawer/drawer.d.ts +4 -4
  120. package/dist/widgets/drawer/drawer.module.css +11 -1
  121. package/dist/widgets/drawer/drawer_module.css +4 -2
  122. package/dist/widgets/modal/modal-context.d.ts +20 -0
  123. package/dist/widgets/modal/modal-context.d.ts.map +1 -0
  124. package/dist/widgets/modal/modal-context.js +4 -0
  125. package/dist/widgets/modal/modal-header.d.ts +1 -1
  126. package/dist/widgets/modal/modal-header.d.ts.map +1 -1
  127. package/dist/widgets/modal/modal-header.js +23 -1
  128. package/dist/widgets/modal/modal.d.ts +13 -8
  129. package/dist/widgets/modal/modal.d.ts.map +1 -1
  130. package/dist/widgets/modal/modal.js +8 -4
  131. package/dist/widgets/modal/modal.module.css +11 -1
  132. package/dist/widgets/modal/modal_module.css +5 -3
  133. package/dist/widgets/timeline/timeline.module.css +9 -4
  134. package/dist/widgets/timeline/timeline_module.css +3 -1
  135. package/package.json +45 -32
  136. package/src/components/accordion/accordion.module.css +11 -1
  137. package/src/components/avatar/avatar.module.css +9 -4
  138. package/src/components/avatar/avatar.stories.tsx +8 -0
  139. package/src/components/avatar/avatar.tsx +17 -8
  140. package/src/components/badge/badge.module.css +9 -4
  141. package/src/components/button/button-group.module.css +11 -1
  142. package/src/components/button/button.module.css +9 -4
  143. package/src/components/button/combo-button.module.css +11 -1
  144. package/src/components/button/control-buttons.module.css +11 -1
  145. package/src/components/button/copy-button.module.css +9 -4
  146. package/src/components/card/card.module.css +9 -4
  147. package/src/components/chips/chip.module.css +9 -4
  148. package/src/components/container/container.module.css +9 -4
  149. package/src/components/dropdown/dropdown.module.css +9 -4
  150. package/src/components/hamburger/hamburger.module.css +9 -4
  151. package/src/components/inputs/autocomplete.module.css +9 -4
  152. package/src/components/inputs/calendar.module.css +9 -4
  153. package/src/components/inputs/checkbox-group.module.css +9 -4
  154. package/src/components/inputs/checkbox.module.css +9 -4
  155. package/src/components/inputs/error-text.module.css +9 -4
  156. package/src/components/inputs/help-text.module.css +9 -4
  157. package/src/components/inputs/input-adornment.module.css +9 -4
  158. package/src/components/inputs/input-password.module.css +55 -0
  159. package/src/components/inputs/input-password.tsx +49 -7
  160. package/src/components/inputs/input.module.css +9 -4
  161. package/src/components/inputs/label.module.css +9 -4
  162. package/src/components/inputs/radio-group.module.css +9 -4
  163. package/src/components/inputs/select.module.css +9 -4
  164. package/src/components/inputs/text-area.module.css +9 -4
  165. package/src/components/notifications/alert.module.css +9 -4
  166. package/src/components/notifications/toast.module.css +9 -4
  167. package/src/components/pager/pagination.module.css +9 -4
  168. package/src/components/scroll-area/scroll-area.module.css +9 -4
  169. package/src/components/scroll-to-top/scroll-to-top.module.css +9 -3
  170. package/src/components/section/section.module.css +9 -4
  171. package/src/components/shimmer/shimmer.module.css +9 -4
  172. package/src/components/table/table.module.css +9 -4
  173. package/src/components/tabs/tabs.module.css +9 -4
  174. package/src/components/tooltip/tooltip.module.css +9 -4
  175. package/src/css-layers.ts +34 -0
  176. package/src/icons/icons.module.css +11 -1
  177. package/src/loaders/ellipses.module.css +9 -4
  178. package/src/loaders/ring.module.css +9 -4
  179. package/src/loaders/spinner.module.css +9 -4
  180. package/src/styles/base/animations.css +12 -0
  181. package/src/styles/base/base.css +12 -0
  182. package/src/styles/base/borders.css +12 -0
  183. package/src/styles/base/breakpoints.css +12 -0
  184. package/src/styles/base/colors.css +12 -0
  185. package/src/styles/base/opacity.css +12 -0
  186. package/src/styles/base/shadows.css +12 -0
  187. package/src/styles/base/size.css +12 -0
  188. package/src/styles/base/spacing.css +12 -0
  189. package/src/styles/base/transitions.css +12 -0
  190. package/src/styles/base/typography.css +12 -0
  191. package/src/styles/base/z-index.css +12 -0
  192. package/src/styles/components/components.css +12 -0
  193. package/src/styles/components/fade-in-lift.css +27 -13
  194. package/src/styles/components/hamburger.css +11 -6
  195. package/src/styles/components/loaders.css +168 -154
  196. package/src/styles/functional/README.md +18 -18
  197. package/src/styles/functional/borders.css +12 -0
  198. package/src/styles/functional/colors.css +12 -0
  199. package/src/styles/functional/functional.css +12 -0
  200. package/src/styles/functional/grid-flex.css +12 -0
  201. package/src/styles/functional/shadcn-compat.css +12 -0
  202. package/src/styles/functional/surfaces.css +12 -0
  203. package/src/styles/functional/typography.css +12 -0
  204. package/src/styles/local-fonts.css +12 -0
  205. package/src/styles/reset.css +18 -0
  206. package/src/styles/styles.css +9 -4
  207. package/src/styles/theme/autofill.css +12 -0
  208. package/src/styles/theme/defaults.css +12 -0
  209. package/src/styles/theme/scrollers.css +12 -0
  210. package/src/styles/theme/theme.css +12 -0
  211. package/src/styles/typography/fonts.css +12 -0
  212. package/src/styles/typography/prose.css +12 -0
  213. package/src/styles/typography.css +12 -0
  214. package/src/styles/utils/scroll-layout-shift.css +12 -0
  215. package/src/styles/utils/utility-classes.css +12 -0
  216. package/src/styles/utils/utils.css +12 -0
  217. package/src/widgets/datepicker/datepicker.module.css +21 -2
  218. package/src/widgets/datepicker/datepicker.tsx +97 -4
  219. package/src/widgets/drawer/drawer.module.css +11 -1
  220. package/src/widgets/modal/modal-context.ts +23 -0
  221. package/src/widgets/modal/modal-header.tsx +29 -2
  222. package/src/widgets/modal/modal.module.css +11 -1
  223. package/src/widgets/modal/modal.tsx +15 -6
  224. package/src/widgets/timeline/timeline.module.css +9 -4
@@ -13,14 +13,14 @@ import { ScrollArea } from "../../components/scroll-area/scroll-area.js";
13
13
  import { CalendarIcon } from "../../icons/calendar-icon.js";
14
14
  import { CloseIcon } from "../../icons/close-icon.js";
15
15
  import datepicker_module from "./datepicker.module.js";
16
- function DatePicker({ id, name, label, required, initialValue, mode = 'datetime', yearsInFuture = 1, yearsInPast = 10, variant, intent, inputSize, inputClassName, inputWrapperClassName, containerClassName, contentClassName, onClear = ()=>{}, onDateChange = ()=>{}, validatorFn, helpText, errorText, placeHolderText = '', ariaLabelForSearch = 'date', ariaLabelForClear = 'clear', ...rest }) {
16
+ function DatePicker({ id, name, label, required, initialValue, mode = 'datetime', minDate, maxDate, yearsInFuture = 1, yearsInPast = 10, variant, intent, inputSize, inputClassName, inputWrapperClassName, containerClassName, contentClassName, onClear = ()=>{}, onDateChange = ()=>{}, onWallTimeChange, validatorFn, helpText, errorText, placeHolderText = '', ariaLabelForSearch = 'date', ariaLabelForClear = 'clear', ...rest }) {
17
17
  const [isOpen, setIsOpen] = useState(false);
18
- const [time, setTime] = useState('08:00');
19
18
  const [date, setDate] = useState(()=>{
20
19
  if (initialValue) return initialValue;
21
20
  if (null == initialValue && true === required) return new Date();
22
21
  return null;
23
22
  });
23
+ const [time, setTime] = useState(()=>null != date ? format(date, 'HH:mm') : '08:00');
24
24
  const [month, setMonth] = useState(date);
25
25
  const calendarRef = useRef(null);
26
26
  const inputRef = useRef(null);
@@ -29,11 +29,31 @@ function DatePicker({ id, name, label, required, initialValue, mode = 'datetime'
29
29
  if (inputRef?.current != null) inputRef.current.value = '';
30
30
  setDate(null);
31
31
  onDateChange(null);
32
+ emitWallTime(null, time);
32
33
  onClear();
33
34
  };
34
35
  const handleOnDateChange = (value)=>{
35
36
  if (null != onDateChange && 'function' == typeof onDateChange) onDateChange(value);
36
37
  };
38
+ const emitWallTime = (day, clock)=>{
39
+ if (null == onWallTimeChange) return;
40
+ onWallTimeChange(null == day ? null : {
41
+ date: format(day, 'yyyy-MM-dd'),
42
+ time: clock
43
+ });
44
+ };
45
+ const disabledDays = [
46
+ ...null == minDate ? [] : [
47
+ {
48
+ before: minDate
49
+ }
50
+ ],
51
+ ...null == maxDate ? [] : [
52
+ {
53
+ after: maxDate
54
+ }
55
+ ]
56
+ ];
37
57
  const handleOnKeyDown = (e)=>{
38
58
  if ('ArrowDown' === e.key) {
39
59
  e.preventDefault();
@@ -44,6 +64,7 @@ function DatePicker({ id, name, label, required, initialValue, mode = 'datetime'
44
64
  if (null == initialValue && null != date && true === required && false === hasInitialized.current) {
45
65
  hasInitialized.current = true;
46
66
  onDateChange(date);
67
+ emitWallTime(date, time);
47
68
  }
48
69
  });
49
70
  return /*#__PURE__*/ jsxs("div", {
@@ -134,6 +155,7 @@ function DatePicker({ id, name, label, required, initialValue, mode = 'datetime'
134
155
  /*#__PURE__*/ jsx(Popover.Portal, {
135
156
  children: /*#__PURE__*/ jsx(Popover.Positioner, {
136
157
  sideOffset: 5,
158
+ className: clsx('infonomic-datepicker-positioner', datepicker_module.positioner),
137
159
  children: /*#__PURE__*/ jsxs(Popover.Popup, {
138
160
  className: clsx('infonomic-datepicker-content', datepicker_module.content, contentClassName),
139
161
  children: [
@@ -151,15 +173,18 @@ function DatePicker({ id, name, label, required, initialValue, mode = 'datetime'
151
173
  onMonthChange: setMonth,
152
174
  onSelect: (selectedDate)=>{
153
175
  if (selectedDate) {
176
+ const day = new Date(selectedDate.getTime());
154
177
  const [hours, minutes] = time.split(':');
155
178
  selectedDate.setHours(Number.parseInt(hours, 10), Number.parseInt(minutes, 10));
156
179
  setDate(selectedDate);
157
180
  setMonth(selectedDate);
158
181
  handleOnDateChange(selectedDate);
182
+ emitWallTime(day, time);
159
183
  }
160
184
  },
161
- startMonth: new Date(new Date().getFullYear() - yearsInPast, 0),
162
- endMonth: new Date(new Date().getFullYear() + yearsInFuture, 0)
185
+ disabled: disabledDays.length > 0 ? disabledDays : void 0,
186
+ startMonth: minDate ?? new Date(new Date().getFullYear() - yearsInPast, 0),
187
+ endMonth: maxDate ?? new Date(new Date().getFullYear() + yearsInFuture, 0)
163
188
  })
164
189
  }),
165
190
  'datetime' === mode && /*#__PURE__*/ jsx("div", {
@@ -185,6 +210,7 @@ function DatePicker({ id, name, label, required, initialValue, mode = 'datetime'
185
210
  newDate.setHours(Number.parseInt(hour, 10), Number.parseInt(minute, 10), 0);
186
211
  setDate(newDate);
187
212
  handleOnDateChange(newDate);
213
+ emitWallTime(date, timeValue);
188
214
  }
189
215
  },
190
216
  children: timeValue
@@ -212,9 +238,12 @@ function DatePicker({ id, name, label, required, initialValue, mode = 'datetime'
212
238
  className: clsx('infonomic-datepicker-content-actions-button', datepicker_module["content-actions-button"]),
213
239
  onClick: ()=>{
214
240
  const today = new Date();
241
+ const clock = format(today, 'HH:mm');
215
242
  setDate(today);
216
243
  setMonth(today);
244
+ setTime(clock);
217
245
  handleOnDateChange(today);
246
+ emitWallTime(today, clock);
218
247
  },
219
248
  children: "Today"
220
249
  })
@@ -241,6 +270,7 @@ function DatePicker({ id, name, label, required, initialValue, mode = 'datetime'
241
270
  onClick: ()=>{
242
271
  setIsOpen(false);
243
272
  handleOnDateChange(date);
273
+ emitWallTime(date, time);
244
274
  },
245
275
  children: "Select"
246
276
  })
@@ -1,4 +1,14 @@
1
- @layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-components;
1
+ @layer base,
2
+ infonomic-base,
3
+ theme,
4
+ infonomic-theme,
5
+ infonomic-functional,
6
+ infonomic-typography,
7
+ components,
8
+ infonomic-components,
9
+ overrides,
10
+ infonomic-utilities,
11
+ utilities;
2
12
 
3
13
  @layer infonomic-components {
4
14
  .container,
@@ -13,10 +23,19 @@
13
23
  width: 100%;
14
24
  }
15
25
 
26
+ /* Base UI's Positioner is the absolutely-positioned element, so it is the
27
+ one that can take part in z-index stacking. The Popup inside it is
28
+ `position: static`, where a z-index is inert — which is why the calendar
29
+ lost to any positioned ancestor above it in the tree, most visibly by
30
+ rendering behind a Modal. */
31
+ .positioner,
32
+ :global(.infonomic-datepicker-positioner) {
33
+ z-index: 50;
34
+ }
35
+
16
36
  .content,
17
37
  :global(.infonomic-datepicker-content) {
18
38
  width: 100%;
19
- z-index: 50;
20
39
  border-radius: 4px;
21
40
  padding-top: var(--spacing-16);
22
41
  padding-bottom: var(--spacing-8);
@@ -4,6 +4,7 @@ const datepicker_module = {
4
4
  input: "input-SaODq9",
5
5
  "input-wrapper": "input-wrapper-qwAckv",
6
6
  inputWrapper: "input-wrapper-qwAckv",
7
+ positioner: "positioner-l698qq",
7
8
  content: "content-UK9iLF",
8
9
  slideDownAndFade: "slideDownAndFade-dohHTE",
9
10
  slideLeftAndFade: "slideLeftAndFade-ugM6Hs",
@@ -1,4 +1,4 @@
1
- @layer infonomic-base, infonomic-utilities, infonomic-theme;
1
+ @layer base, infonomic-base, theme, infonomic-theme, infonomic-functional, infonomic-typography, components;
2
2
 
3
3
  @layer infonomic-components {
4
4
  :is(.container-u5_VUp, .infonomic-datepicker-container) {
@@ -9,8 +9,11 @@
9
9
  width: 100%;
10
10
  }
11
11
 
12
- :is(.content-UK9iLF, .infonomic-datepicker-content) {
12
+ :is(.positioner-l698qq, .infonomic-datepicker-positioner) {
13
13
  z-index: 50;
14
+ }
15
+
16
+ :is(.content-UK9iLF, .infonomic-datepicker-content) {
14
17
  width: 100%;
15
18
  padding-top: var(--spacing-16);
16
19
  padding-bottom: var(--spacing-8);
@@ -186,3 +189,5 @@
186
189
  }
187
190
  }
188
191
 
192
+ @layer overrides, infonomic-utilities, utilities;
193
+
@@ -1,8 +1,8 @@
1
1
  import type { ReactNode } from 'react';
2
- import { DrawerContainer } from './drawer-container';
3
- import { DrawerContent } from './drawer-content';
4
- import { DrawerHeader } from './drawer-header';
5
- import { DrawerTopActions } from './drawer-top-actions';
2
+ import { DrawerContainer } from './drawer-container.js';
3
+ import { DrawerContent } from './drawer-content.js';
4
+ import { DrawerHeader } from './drawer-header.js';
5
+ import { DrawerTopActions } from './drawer-top-actions.js';
6
6
  export interface DrawerProps {
7
7
  id: string;
8
8
  isOpen: boolean;
@@ -1,4 +1,14 @@
1
- @layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-components;
1
+ @layer base,
2
+ infonomic-base,
3
+ theme,
4
+ infonomic-theme,
5
+ infonomic-functional,
6
+ infonomic-typography,
7
+ components,
8
+ infonomic-components,
9
+ overrides,
10
+ infonomic-utilities,
11
+ utilities;
2
12
 
3
13
  @layer infonomic-components {
4
14
  /* Backdrop overlay (replaces previous Overlay component) */
@@ -1,4 +1,4 @@
1
- @layer infonomic-base, infonomic-utilities, infonomic-theme;
1
+ @layer base, infonomic-base, theme, infonomic-theme, infonomic-functional, infonomic-typography, components;
2
2
 
3
3
  @layer infonomic-components {
4
4
  :is(.backdrop-Ga1s55, .infonomic-drawer-backdrop) {
@@ -74,7 +74,7 @@
74
74
  width: 86%;
75
75
  }
76
76
 
77
- @media (min-width: 48rem) {
77
+ @media (width >= 48rem) {
78
78
  .drawer-depth-0-VYE9YM.drawer-medium-ZFbdby {
79
79
  width: 600px;
80
80
  }
@@ -127,3 +127,5 @@
127
127
  }
128
128
  }
129
129
 
130
+ @layer overrides, infonomic-utilities, utilities;
131
+
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Shared between `Modal` and its slots. Lives in its own module because
3
+ * `Modal` renders `Modal.Header` while `Modal.Header` needs the context —
4
+ * importing it from `modal.tsx` would make the two modules circular.
5
+ */
6
+ export declare const ModalContext: import("react").Context<{
7
+ onDismiss?: () => void;
8
+ /**
9
+ * Id the dialog points `aria-labelledby` at. `Modal.Header` puts it on the
10
+ * heading it finds among its children, which is what gives the dialog its
11
+ * accessible name — without it a screen reader announces the modal as an
12
+ * unnamed "dialog".
13
+ *
14
+ * A dangling reference degrades safely: name computation ignores an
15
+ * `aria-labelledby` that resolves to nothing and falls through, so a modal
16
+ * with no header is no worse off than before.
17
+ */
18
+ headingId?: string;
19
+ }>;
20
+ //# sourceMappingURL=modal-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal-context.d.ts","sourceRoot":"","sources":["../../../src/widgets/modal/modal-context.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,YAAY;gBACX,MAAM,IAAI;IACtB;;;;;;;;;OASG;gBACS,MAAM;EACd,CAAA"}
@@ -0,0 +1,4 @@
1
+ "use client";
2
+ import { createContext } from "react";
3
+ const ModalContext = createContext({});
4
+ export { ModalContext };
@@ -1,4 +1,4 @@
1
- import type * as React from 'react';
1
+ import * as React from 'react';
2
2
  type ModalHeaderIntrinsicProps = React.JSX.IntrinsicElements['div'];
3
3
  export interface ModalHeaderProps extends ModalHeaderIntrinsicProps {
4
4
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"modal-header.d.ts","sourceRoot":"","sources":["../../../src/widgets/modal/modal-header.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAMnC,KAAK,yBAAyB,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAA;AACnE,MAAM,WAAW,gBAAiB,SAAQ,yBAAyB;IACjE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,WAAW,0CAKrB,gBAAgB,GAAG;IACpB,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;CACtC,sBAOA,CAAA"}
1
+ {"version":3,"file":"modal-header.d.ts","sourceRoot":"","sources":["../../../src/widgets/modal/modal-header.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B,KAAK,yBAAyB,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAA;AACnE,MAAM,WAAW,gBAAiB,SAAQ,yBAAyB;IACjE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AA0BD,eAAO,MAAM,WAAW,0CAKrB,gBAAgB,GAAG;IACpB,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;CACtC,sBAQA,CAAA"}
@@ -2,7 +2,29 @@
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import clsx from "clsx";
4
4
  import modal_module from "./modal.module.js";
5
+ import { ModalContext } from "./modal-context.js";
6
+ import * as __rspack_external_react from "react";
7
+ const HEADING_TAGS = new Set([
8
+ 'h1',
9
+ 'h2',
10
+ 'h3',
11
+ 'h4',
12
+ 'h5',
13
+ 'h6'
14
+ ]);
15
+ function labelHeading(children, headingId) {
16
+ let labelled = false;
17
+ return __rspack_external_react.Children.map(children, (child)=>{
18
+ if (labelled || !/*#__PURE__*/ __rspack_external_react.isValidElement(child)) return child;
19
+ if ('string' != typeof child.type || !HEADING_TAGS.has(child.type)) return child;
20
+ labelled = true;
21
+ return /*#__PURE__*/ __rspack_external_react.cloneElement(child, {
22
+ id: headingId
23
+ });
24
+ });
25
+ }
5
26
  const modal_header_ModalHeader = function({ ref, children, className, ...rest }) {
27
+ const { headingId } = (0, __rspack_external_react.useContext)(ModalContext);
6
28
  const classes = clsx('infonomic-modal-header', modal_module["modal-header"], 'prose', className);
7
29
  return /*#__PURE__*/ jsx("div", {
8
30
  style: {
@@ -11,7 +33,7 @@ const modal_header_ModalHeader = function({ ref, children, className, ...rest })
11
33
  ref: ref,
12
34
  ...rest,
13
35
  className: classes,
14
- children: children
36
+ children: null == headingId ? children : labelHeading(children, headingId)
15
37
  });
16
38
  };
17
39
  export { modal_header_ModalHeader as ModalHeader };
@@ -1,17 +1,22 @@
1
1
  import type React from 'react';
2
- import { ModalActions } from './modal-actions';
3
- import { ModalContainer } from './modal-container';
4
- import { ModalContent } from './modal-content';
5
- import { ModalHeader } from './modal-header';
2
+ import { ModalActions } from './modal-actions.js';
3
+ import { ModalContainer } from './modal-container.js';
4
+ import { ModalContent } from './modal-content.js';
5
+ import { ModalContext } from './modal-context.js';
6
+ import { ModalHeader } from './modal-header.js';
7
+ export { ModalContext };
6
8
  export interface ModalProps {
7
9
  isOpen?: boolean;
8
10
  onDismiss?: () => void;
9
11
  closeOnOverlayClick?: boolean;
12
+ /**
13
+ * Accessible name for the dialog, for modals that carry no `Modal.Header`
14
+ * heading to borrow one from. Modals that do have a heading need nothing
15
+ * here — see `ModalContext.headingId`.
16
+ */
17
+ ariaLabel?: string;
10
18
  children?: React.ReactNode;
11
19
  }
12
- export declare const ModalContext: React.Context<{
13
- onDismiss?: () => void;
14
- }>;
15
20
  export type UseModalProps = ReturnType<typeof useModal>;
16
21
  export declare function useModal(): {
17
22
  onDismiss: () => void;
@@ -19,7 +24,7 @@ export declare function useModal(): {
19
24
  isOpen: boolean;
20
25
  setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
21
26
  };
22
- declare function Modal({ isOpen, onDismiss, closeOnOverlayClick, children, }: ModalProps): React.JSX.Element;
27
+ declare function Modal({ isOpen, onDismiss, closeOnOverlayClick, ariaLabel, children, }: ModalProps): React.JSX.Element;
23
28
  declare namespace Modal {
24
29
  var displayName: string;
25
30
  export { ModalContainer as Container };
@@ -1 +1 @@
1
- {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/widgets/modal/modal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAED,eAAO,MAAM,YAAY;gBACX,MAAM,IAAI;EAClB,CAAA;AAEN,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAEvD,wBAAgB,QAAQ,IAAI;IAC1B,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;CACzD,CAiBA;AAED,iBAAS,KAAK,CAAC,EACb,MAAM,EACN,SAAS,EACT,mBAAmB,EACnB,QAAQ,GACT,EAAE,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAqDhC;kBA1DQ,KAAK;;aA8DI,cAAc;aACjB,WAAW;aACV,YAAY;aACZ,YAAY;;AAE5B,OAAO,EAAE,KAAK,EAAE,CAAA"}
1
+ {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/widgets/modal/modal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,OAAO,EAAE,YAAY,EAAE,CAAA;AAEvB,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAEvD,wBAAgB,QAAQ,IAAI;IAC1B,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;CACzD,CAiBA;AAED,iBAAS,KAAK,CAAC,EACb,MAAM,EACN,SAAS,EACT,mBAAmB,EACnB,SAAS,EACT,QAAQ,GACT,EAAE,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAwDhC;kBA9DQ,KAAK;;aAkEI,cAAc;aACjB,WAAW;aACV,YAAY;aACZ,YAAY;;AAE5B,OAAO,EAAE,KAAK,EAAE,CAAA"}
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { createContext, useCallback, useRef, useState } from "react";
3
+ import { useCallback, useId, useRef, useState } from "react";
4
4
  import { Dialog } from "@base-ui/react/dialog";
5
5
  import clsx from "clsx";
6
6
  import modal_module from "./modal.module.js";
7
7
  import { ModalActions } from "./modal-actions.js";
8
8
  import { ModalContainer } from "./modal-container.js";
9
9
  import { ModalContent } from "./modal-content.js";
10
+ import { ModalContext } from "./modal-context.js";
10
11
  import { ModalHeader } from "./modal-header.js";
11
- const ModalContext = /*#__PURE__*/ createContext({});
12
12
  function useModal() {
13
13
  const [isOpen, setIsOpen] = useState(false);
14
14
  const onDismiss = useCallback(()=>{
@@ -24,7 +24,8 @@ function useModal() {
24
24
  setIsOpen
25
25
  };
26
26
  }
27
- function Modal({ isOpen, onDismiss, closeOnOverlayClick, children }) {
27
+ function Modal({ isOpen, onDismiss, closeOnOverlayClick, ariaLabel, children }) {
28
+ const headingId = useId();
28
29
  const pressStartedOnOverlay = useRef(false);
29
30
  const handleOverlayPointerDown = (event)=>{
30
31
  pressStartedOnOverlay.current = event.target === event.currentTarget;
@@ -38,7 +39,8 @@ function Modal({ isOpen, onDismiss, closeOnOverlayClick, children }) {
38
39
  };
39
40
  return /*#__PURE__*/ jsx(ModalContext.Provider, {
40
41
  value: {
41
- onDismiss
42
+ onDismiss,
43
+ headingId
42
44
  },
43
45
  children: /*#__PURE__*/ jsx(Dialog.Root, {
44
46
  open: isOpen,
@@ -54,6 +56,8 @@ function Modal({ isOpen, onDismiss, closeOnOverlayClick, children }) {
54
56
  }),
55
57
  /*#__PURE__*/ jsx(Dialog.Popup, {
56
58
  className: clsx('infonomic-modal-wrapper', modal_module["modal-wrapper"]),
59
+ "aria-label": ariaLabel,
60
+ "aria-labelledby": null == ariaLabel ? headingId : void 0,
57
61
  onPointerDown: handleOverlayPointerDown,
58
62
  onClick: handleOverlayClick,
59
63
  children: children
@@ -1,4 +1,14 @@
1
- @layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-components;
1
+ @layer base,
2
+ infonomic-base,
3
+ theme,
4
+ infonomic-theme,
5
+ infonomic-functional,
6
+ infonomic-typography,
7
+ components,
8
+ infonomic-components,
9
+ overrides,
10
+ infonomic-utilities,
11
+ utilities;
2
12
 
3
13
  @layer infonomic-components {
4
14
  /* Backdrop overlay */
@@ -1,4 +1,4 @@
1
- @layer infonomic-base, infonomic-utilities, infonomic-theme;
1
+ @layer base, infonomic-base, theme, infonomic-theme, infonomic-functional, infonomic-typography, components;
2
2
 
3
3
  @layer infonomic-components {
4
4
  :is(.backdrop-BgKon2, .infonomic-modal-backdrop) {
@@ -42,7 +42,7 @@
42
42
  opacity: 0;
43
43
  }
44
44
 
45
- @media screen and (min-width: 40rem) {
45
+ @media screen and (width >= 40rem) {
46
46
  :is(.modal-wrapper-wF5Mv1, .infonomic-modal-wrapper) {
47
47
  justify-content: center;
48
48
  }
@@ -62,7 +62,7 @@
62
62
  display: flex;
63
63
  }
64
64
 
65
- @media screen and (min-width: 40rem) {
65
+ @media screen and (width >= 40rem) {
66
66
  :is(.modal-container-PPkPyj, .infonomic-modal-container) {
67
67
  width: auto;
68
68
  min-height: auto;
@@ -116,3 +116,5 @@
116
116
  }
117
117
  }
118
118
 
119
+ @layer overrides, infonomic-utilities, utilities;
120
+
@@ -1,9 +1,14 @@
1
- @layer infonomic-base,
2
- infonomic-functional,
3
- infonomic-utilities,
1
+ @layer base,
2
+ infonomic-base,
3
+ theme,
4
4
  infonomic-theme,
5
+ infonomic-functional,
5
6
  infonomic-typography,
6
- infonomic-components;
7
+ components,
8
+ infonomic-components,
9
+ overrides,
10
+ infonomic-utilities,
11
+ utilities;
7
12
 
8
13
  @layer infonomic-components {
9
14
  .timeline,
@@ -1,4 +1,4 @@
1
- @layer infonomic-base, infonomic-functional, infonomic-utilities, infonomic-theme, infonomic-typography;
1
+ @layer base, infonomic-base, theme, infonomic-theme, infonomic-functional, infonomic-typography, components;
2
2
 
3
3
  @layer infonomic-components {
4
4
  :is(.timeline-qJOU85, .infonomic-timeline) {
@@ -81,3 +81,5 @@
81
81
  }
82
82
  }
83
83
 
84
+ @layer overrides, infonomic-utilities, utilities;
85
+
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@infonomic/uikit",
3
3
  "private": false,
4
4
  "license": "MIT",
5
- "version": "6.8.2",
5
+ "version": "6.9.1",
6
6
  "type": "module",
7
7
  "description": "Infonomic UI kit is a collection of reusable UI components and utilities for React and Astro.",
8
8
  "keywords": [
@@ -55,52 +55,59 @@
55
55
  "./components.css": {
56
56
  "import": "./dist/styles/components-vanilla.css",
57
57
  "default": "./dist/styles/components-vanilla.css"
58
+ },
59
+ "./css-layers": {
60
+ "types": "./dist/css-layers.d.ts",
61
+ "import": "./dist/css-layers.js",
62
+ "default": "./dist/css-layers.js"
58
63
  }
59
64
  },
60
65
  "peerDependencies": {
66
+ "postcss": "^8.4.0",
61
67
  "react": "^19.0.0",
62
68
  "react-dom": "^19.0.0"
63
69
  },
64
70
  "dependencies": {
65
- "@base-ui/react": "^1.7.0",
71
+ "@base-ui/react": "^1.9.0",
66
72
  "clsx": "^2.1.1",
67
73
  "date-fns": "^4.4.0",
68
- "motion": "^13.1.0",
74
+ "motion": "^14.14.0",
69
75
  "npm-run-all": "^4.1.5",
70
76
  "prism-react-renderer": "^2.4.1",
71
- "react-day-picker": "^10.0.1",
72
- "zod": "^4.4.3",
73
- "zod-form-data": "^3.0.3"
77
+ "react-day-picker": "^10.0.2",
78
+ "zod": "^4.6.7",
79
+ "zod-form-data": "^3.0.4"
74
80
  },
75
81
  "devDependencies": {
76
- "@astrojs/check": "0.9.10",
77
- "@astrojs/node": "11.1.2",
78
- "@biomejs/biome": "2.5.8",
79
- "@rsbuild/plugin-react": "^2.1.0",
80
- "@rslib/core": "^0.23.2",
81
- "@storybook/addon-a11y": "^10.5.8",
82
- "@storybook/addon-docs": "^10.5.8",
83
- "@storybook/addon-links": "^10.5.8",
84
- "@storybook/addon-themes": "^10.5.8",
85
- "@storybook/react-vite": "^10.5.8",
86
- "@types/lodash": "^4.17.25",
87
- "@types/node": "^26.2.0",
88
- "@types/react": "19.2.18",
89
- "@types/react-dom": "19.2.4",
90
- "@vitejs/plugin-react": "^6.0.5",
91
- "astro": "7.2.2",
92
- "chokidar": "^5.0.0",
93
- "eslint-plugin-storybook": "^10.5.8",
82
+ "@astrojs/check": "0.9.12",
83
+ "@astrojs/node": "11.1.14",
84
+ "@biomejs/biome": "2.6.8",
85
+ "@rsbuild/plugin-react": "^2.1.1",
86
+ "@rslib/core": "^1.0.7",
87
+ "@storybook/addon-a11y": "^10.6.7",
88
+ "@storybook/addon-docs": "^10.6.7",
89
+ "@storybook/addon-links": "^10.6.7",
90
+ "@storybook/addon-themes": "^10.6.7",
91
+ "@storybook/react-vite": "^10.6.7",
92
+ "@types/lodash": "^4.17.27",
93
+ "@types/node": "^26.6.6",
94
+ "@types/react": "19.3.0",
95
+ "@types/react-dom": "19.3.0",
96
+ "@vitejs/plugin-react": "^6.3.0",
97
+ "astro": "7.4.13",
98
+ "chokidar": "^6.0.0",
99
+ "eslint-plugin-storybook": "^10.6.7",
94
100
  "lightningcss": "^1.33.0",
95
101
  "lightningcss-cli": "^1.33.0",
96
- "react": "^19.2.8",
97
- "react-dom": "^19.2.8",
98
- "rimraf": "^6.1.3",
99
- "storybook": "^10.5.8",
102
+ "postcss": "^8.5.33",
103
+ "react": "^19.3.1",
104
+ "react-dom": "^19.3.1",
105
+ "rimraf": "^6.1.4",
106
+ "storybook": "^10.6.7",
100
107
  "typescript": "7.0.2",
101
- "typescript-plugin-css-modules": "^5.2.0",
102
- "vite": "^8.2.1",
103
- "vitest": "^4.1.10"
108
+ "typescript-plugin-css-modules": "^5.3.0",
109
+ "vite": "^8.3.8",
110
+ "vitest": "^5.1.1"
104
111
  },
105
112
  "publishConfig": {
106
113
  "access": "public",
@@ -109,6 +116,11 @@
109
116
  "src/"
110
117
  ]
111
118
  },
119
+ "peerDependenciesMeta": {
120
+ "postcss": {
121
+ "optional": true
122
+ }
123
+ },
112
124
  "scripts": {
113
125
  "dev": "run-p dev:*",
114
126
  "skip:astro-compose": "node ./scripts/build-astro.js",
@@ -127,6 +139,7 @@
127
139
  "lint": "biome check --write --unsafe --diagnostic-level=error",
128
140
  "storybook": "storybook dev -p 6007",
129
141
  "build-storybook": "storybook build",
130
- "test": "vitest"
142
+ "test": "node --test tests/*.test.mjs",
143
+ "test:css-build": "CSS_BUILD_CHECK=1 node --test tests/*.test.mjs"
131
144
  }
132
145
  }
@@ -1,4 +1,14 @@
1
- @layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-components;
1
+ @layer base,
2
+ infonomic-base,
3
+ theme,
4
+ infonomic-theme,
5
+ infonomic-functional,
6
+ infonomic-typography,
7
+ components,
8
+ infonomic-components,
9
+ overrides,
10
+ infonomic-utilities,
11
+ utilities;
2
12
 
3
13
  @layer infonomic-components {
4
14
  .item,
@@ -1,9 +1,14 @@
1
- @layer infonomic-base,
2
- infonomic-functional,
3
- infonomic-utilities,
1
+ @layer base,
2
+ infonomic-base,
3
+ theme,
4
4
  infonomic-theme,
5
+ infonomic-functional,
5
6
  infonomic-typography,
6
- infonomic-components;
7
+ components,
8
+ infonomic-components,
9
+ overrides,
10
+ infonomic-utilities,
11
+ utilities;
7
12
 
8
13
  @layer infonomic-components {
9
14
  /* relative inline-flex h-10 w-10 rounded-full */