@prokodo/ui 0.0.52 → 0.0.54

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 (204) hide show
  1. package/README.md +81 -81
  2. package/dist/_virtual/_commonjsHelpers.js +9 -0
  3. package/dist/_virtual/common.js +7 -0
  4. package/dist/components/accordion/Accordion.client.js +3 -1
  5. package/dist/components/accordion/Accordion.view.js +100 -81
  6. package/dist/components/animated/Animated.server.js +3 -1
  7. package/dist/components/animatedText/AnimatedText.client.js +1 -7
  8. package/dist/components/animatedText/AnimatedText.view.js +4 -1
  9. package/dist/components/avatar/Avatar.view.js +2 -2
  10. package/dist/components/base-link/BaseLink.view.js +1 -1
  11. package/dist/components/button/Button.server.js +1 -8
  12. package/dist/components/calendly/Calendly.client.js +63 -54
  13. package/dist/components/calendly/Calendly.server.js +3 -1
  14. package/dist/components/card/Card.client.js +2 -1
  15. package/dist/components/card/Card.effects.client.js +5 -1
  16. package/dist/components/card/Card.view.js +19 -2
  17. package/dist/components/carousel/Carousel.client.js +36 -12
  18. package/dist/components/chip/Chip.view.js +10 -6
  19. package/dist/components/datePicker/DatePicker.client.js +53 -37
  20. package/dist/components/datePicker/DatePicker.view.js +3 -1
  21. package/dist/components/dialog/Dialog.client.js +22 -14
  22. package/dist/components/dialog/Dialog.view.js +10 -2
  23. package/dist/components/drawer/Drawer.client.js +10 -2
  24. package/dist/components/drawer/Drawer.effects.client.js +7 -2
  25. package/dist/components/dynamic-list/DynamicList.client.js +8 -7
  26. package/dist/components/dynamic-list/DynamicList.server.js +10 -4
  27. package/dist/components/dynamic-list/DynamicList.view.js +1 -1
  28. package/dist/components/form/Form.client.js +16 -13
  29. package/dist/components/form/Form.view.js +8 -4
  30. package/dist/components/form/FormField.client.js +5 -5
  31. package/dist/components/form/FormField.server.js +3 -23
  32. package/dist/components/form/FormResponse.js +5 -1
  33. package/dist/components/grid/Grid.js +7 -2
  34. package/dist/components/grid/GridRow.js +12 -2
  35. package/dist/components/headline/Headline.js +3 -1
  36. package/dist/components/icon/Icon.js +8 -4
  37. package/dist/components/image-text/ImageText.js +5 -1
  38. package/dist/components/input/Input.client.js +52 -28
  39. package/dist/components/input/Input.view.js +92 -68
  40. package/dist/components/inputOTP/InputOTP.js +107 -90
  41. package/dist/components/label/Label.js +1 -8
  42. package/dist/components/link/Link.view.js +3 -1
  43. package/dist/components/list/List.js +94 -42
  44. package/dist/components/loading/Loading.client.js +15 -2
  45. package/dist/components/loading/Loading.server.js +8 -1
  46. package/dist/components/loading/Loading.view.js +30 -7
  47. package/dist/components/post-item/PostItem.client.js +17 -0
  48. package/dist/components/post-item/PostItem.js +7 -136
  49. package/dist/components/post-item/PostItem.lazy.js +14 -0
  50. package/dist/components/post-item/PostItem.module.scss.js +3 -1
  51. package/dist/components/post-item/PostItem.server.js +14 -0
  52. package/dist/components/post-item/PostItem.view.js +238 -0
  53. package/dist/components/post-item/PostItemAuthor.js +28 -22
  54. package/dist/components/post-teaser/PostTeaser.client.js +30 -0
  55. package/dist/components/post-teaser/PostTeaser.js +9 -169
  56. package/dist/components/post-teaser/PostTeaser.lazy.js +13 -0
  57. package/dist/components/post-teaser/PostTeaser.module.scss.js +3 -0
  58. package/dist/components/post-teaser/PostTeaser.server.js +22 -0
  59. package/dist/components/post-teaser/PostTeaser.view.js +252 -0
  60. package/dist/components/post-widget/PostWidget.client.js +9 -0
  61. package/dist/components/post-widget/PostWidget.js +11 -156
  62. package/dist/components/post-widget/PostWidget.lazy.js +13 -0
  63. package/dist/components/post-widget/PostWidget.module.scss.js +1 -0
  64. package/dist/components/post-widget/PostWidget.server.js +11 -0
  65. package/dist/components/post-widget/PostWidget.view.js +263 -0
  66. package/dist/components/post-widget-carousel/PostWidgetCarousel.client.js +9 -0
  67. package/dist/components/post-widget-carousel/PostWidgetCarousel.js +9 -160
  68. package/dist/components/post-widget-carousel/PostWidgetCarousel.lazy.js +13 -0
  69. package/dist/components/post-widget-carousel/PostWidgetCarousel.module.scss.js +3 -0
  70. package/dist/components/post-widget-carousel/PostWidgetCarousel.server.js +11 -0
  71. package/dist/components/post-widget-carousel/PostWidgetCarousel.view.js +244 -0
  72. package/dist/components/rich-text/RichText.client.js +182 -12
  73. package/dist/components/rich-text/RichText.module.scss.js +1 -1
  74. package/dist/components/select/Select.view.js +132 -116
  75. package/dist/components/sidenav/SideNav.client.js +19 -18
  76. package/dist/components/sidenav/SideNav.server.js +8 -1
  77. package/dist/components/sidenav/SideNav.view.js +21 -3
  78. package/dist/components/skeleton/Skeleton.effects.client.js +3 -1
  79. package/dist/components/slider/Slider.client.js +56 -38
  80. package/dist/components/slider/Slider.view.js +1 -7
  81. package/dist/components/snackbar/SnackbarProvider.client.js +21 -22
  82. package/dist/components/stepper/Stepper.client.js +1 -8
  83. package/dist/components/switch/Switch.client.js +1 -6
  84. package/dist/components/switch/Switch.server.js +1 -3
  85. package/dist/components/table/Table.js +3 -1
  86. package/dist/components/table/TableCell.js +13 -1
  87. package/dist/components/teaser/Teaser.js +1 -5
  88. package/dist/constants/project.js +1 -1
  89. package/dist/helpers/createIsland.js +3 -1
  90. package/dist/helpers/createLazyWrapper.js +3 -1
  91. package/dist/helpers/date.js +21 -0
  92. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/common.js +5 -0
  93. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/common.js +90 -0
  94. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/core.js +1629 -0
  95. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/bash.js +407 -0
  96. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/c.js +307 -0
  97. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/cpp.js +556 -0
  98. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/csharp.js +413 -0
  99. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/css.js +950 -0
  100. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/diff.js +66 -0
  101. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/go.js +167 -0
  102. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/graphql.js +83 -0
  103. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/ini.js +129 -0
  104. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/java.js +268 -0
  105. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/javascript.js +715 -0
  106. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/json.js +53 -0
  107. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/kotlin.js +268 -0
  108. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/less.js +1031 -0
  109. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/lua.js +74 -0
  110. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/makefile.js +84 -0
  111. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/markdown.js +245 -0
  112. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/objectivec.js +256 -0
  113. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/perl.js +498 -0
  114. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/php-template.js +59 -0
  115. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/php.js +614 -0
  116. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/plaintext.js +25 -0
  117. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/python-repl.js +38 -0
  118. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/python.js +428 -0
  119. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/r.js +223 -0
  120. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/ruby.js +426 -0
  121. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/rust.js +326 -0
  122. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/scss.js +935 -0
  123. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/shell.js +37 -0
  124. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/sql.js +658 -0
  125. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/swift.js +893 -0
  126. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/typescript.js +829 -0
  127. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/vbnet.js +146 -0
  128. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/wasm.js +134 -0
  129. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/xml.js +239 -0
  130. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/yaml.js +214 -0
  131. package/dist/node_modules/.pnpm/marked-highlight@2.2.2_marked@15.0.12/node_modules/marked-highlight/src/index.js +93 -0
  132. package/dist/tsconfig.build.tsbuildinfo +1 -1
  133. package/dist/types/components/accordion/Accordion.model.d.ts +1 -1
  134. package/dist/types/components/animated/Animated.client.d.ts +2 -2
  135. package/dist/types/components/animated/Animated.model.d.ts +1 -1
  136. package/dist/types/components/button/Button.client.d.ts +1 -1
  137. package/dist/types/components/button/Button.d.ts +1 -1
  138. package/dist/types/components/button/Button.lazy.d.ts +1 -1
  139. package/dist/types/components/button/Button.server.d.ts +1 -1
  140. package/dist/types/components/button/Button.view.d.ts +1 -1
  141. package/dist/types/components/card/Card.effects.client.d.ts +1 -1
  142. package/dist/types/components/card/index.d.ts +1 -1
  143. package/dist/types/components/carousel/Carousel.d.ts +3 -0
  144. package/dist/types/components/carousel/Carousel.lazy.d.ts +3 -0
  145. package/dist/types/components/carousel/Carousel.model.d.ts +4 -0
  146. package/dist/types/components/dialog/Dialog.client.d.ts +1 -1
  147. package/dist/types/components/dialog/Dialog.model.d.ts +4 -4
  148. package/dist/types/components/dialog/Dialog.view.d.ts +2 -2
  149. package/dist/types/components/drawer/Drawer.client.d.ts +1 -1
  150. package/dist/types/components/drawer/Drawer.d.ts +1 -1
  151. package/dist/types/components/drawer/Drawer.effects.client.d.ts +1 -1
  152. package/dist/types/components/drawer/Drawer.lazy.d.ts +1 -1
  153. package/dist/types/components/drawer/Drawer.model.d.ts +6 -6
  154. package/dist/types/components/drawer/Drawer.server.d.ts +1 -1
  155. package/dist/types/components/drawer/Drawer.view.d.ts +2 -2
  156. package/dist/types/components/drawer/index.d.ts +1 -1
  157. package/dist/types/components/icon/IconList.d.ts +1 -1
  158. package/dist/types/components/icon/index.d.ts +1 -1
  159. package/dist/types/components/image/Image.model.d.ts +2 -2
  160. package/dist/types/components/link/Link.d.ts +1 -1
  161. package/dist/types/components/link/Link.model.d.ts +1 -1
  162. package/dist/types/components/link/Link.server.d.ts +1 -1
  163. package/dist/types/components/loading/index.d.ts +1 -1
  164. package/dist/types/components/post-item/PostItem.client.d.ts +4 -0
  165. package/dist/types/components/post-item/PostItem.d.ts +3 -2
  166. package/dist/types/components/post-item/PostItem.lazy.d.ts +5 -0
  167. package/dist/types/components/post-item/PostItem.model.d.ts +46 -6
  168. package/dist/types/components/post-item/PostItem.server.d.ts +3 -0
  169. package/dist/types/components/post-item/PostItem.view.d.ts +3 -0
  170. package/dist/types/components/post-item/PostItemAuthor.model.d.ts +5 -8
  171. package/dist/types/components/post-item/index.d.ts +2 -2
  172. package/dist/types/components/post-teaser/PostTeaser.client.d.ts +4 -0
  173. package/dist/types/components/post-teaser/PostTeaser.d.ts +3 -2
  174. package/dist/types/components/post-teaser/PostTeaser.lazy.d.ts +5 -0
  175. package/dist/types/components/post-teaser/PostTeaser.model.d.ts +49 -3
  176. package/dist/types/components/post-teaser/PostTeaser.server.d.ts +3 -0
  177. package/dist/types/components/post-teaser/PostTeaser.view.d.ts +3 -0
  178. package/dist/types/components/post-teaser/index.d.ts +1 -1
  179. package/dist/types/components/post-widget/PostWidget.client.d.ts +4 -0
  180. package/dist/types/components/post-widget/PostWidget.d.ts +13 -3
  181. package/dist/types/components/post-widget/PostWidget.lazy.d.ts +14 -0
  182. package/dist/types/components/post-widget/PostWidget.model.d.ts +53 -3
  183. package/dist/types/components/post-widget/PostWidget.server.d.ts +3 -0
  184. package/dist/types/components/post-widget/PostWidget.view.d.ts +3 -0
  185. package/dist/types/components/post-widget/index.d.ts +1 -1
  186. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.client.d.ts +3 -0
  187. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.d.ts +11 -3
  188. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.lazy.d.ts +12 -0
  189. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.model.d.ts +39 -0
  190. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.server.d.ts +3 -0
  191. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.view.d.ts +3 -0
  192. package/dist/types/components/post-widget-carousel/index.d.ts +1 -1
  193. package/dist/types/components/rich-text/RichText.client.d.ts +1 -1
  194. package/dist/types/components/rich-text/RichText.d.ts +5 -0
  195. package/dist/types/components/rich-text/RichText.lazy.d.ts +5 -0
  196. package/dist/types/components/rich-text/RichText.model.d.ts +5 -0
  197. package/dist/types/components/sidenav/index.d.ts +1 -1
  198. package/dist/types/components/skeleton/Skeleton.effects.client.d.ts +2 -2
  199. package/dist/types/helpers/createIsland.d.ts +1 -1
  200. package/dist/types/helpers/createLazyWrapper.d.ts +1 -1
  201. package/dist/types/helpers/date.d.ts +5 -0
  202. package/dist/ui.css +154 -65
  203. package/package.json +5 -2
  204. package/dist/helpers/calculation.js +0 -6
@@ -36,11 +36,17 @@ function SelectView({
36
36
  const btnRef = _clientState == null ? void 0 : _clientState.buttonRef;
37
37
  const listRef = _clientState == null ? void 0 : _clientState.listRef;
38
38
  const selectedItems = Array.isArray(value) ? items.filter((i) => value.includes(i.value)) : items.filter((i) => i.value === value);
39
- const display = selectedItems.length === 0 ? /* @__PURE__ */ jsx("span", { className: bem("button__inner", {
40
- "is-placeholder": true,
41
- "is-placeholder--disabled": Boolean(disabled),
42
- expanded: open
43
- }), children: placeholder }) : /* @__PURE__ */ jsx("span", { className: bem("button__inner", { expanded: open }), children: selectedItems.map((i, idx) => {
39
+ const display = selectedItems.length === 0 ? /* @__PURE__ */ jsx(
40
+ "span",
41
+ {
42
+ className: bem("button__inner", {
43
+ "is-placeholder": true,
44
+ "is-placeholder--disabled": Boolean(disabled),
45
+ expanded: open
46
+ }),
47
+ children: placeholder
48
+ }
49
+ ) : /* @__PURE__ */ jsx("span", { className: bem("button__inner", { expanded: open }), children: selectedItems.map((i, idx) => {
44
50
  var _a;
45
51
  return /* @__PURE__ */ jsxs(Fragment, { children: [
46
52
  Boolean(iconVisible) && ((_a = i.icon) == null ? void 0 : _a.call(i)),
@@ -48,122 +54,132 @@ function SelectView({
48
54
  idx < selectedItems.length - 1 && ", "
49
55
  ] }, i == null ? void 0 : i.label);
50
56
  }) });
51
- return /* @__PURE__ */ jsxs("div", { className: bem(void 0, {
52
- fullWidth: Boolean(fullWidth)
53
- }, className), children: [
54
- !Boolean(hideLabel) && /* @__PURE__ */ jsx(
55
- Label,
56
- {
57
- ...labelProps,
58
- className: bem("label", void 0, labelProps == null ? void 0 : labelProps.className),
59
- error: isError,
60
- htmlFor: id,
61
- label,
62
- required,
63
- type: "label"
64
- }
65
- ),
66
- /* @__PURE__ */ jsxs("div", { className: bem("field", void 0, fieldClassName), children: [
67
- /* @__PURE__ */ jsx(
68
- "button",
57
+ return /* @__PURE__ */ jsxs(
58
+ "div",
59
+ {
60
+ className: bem(
61
+ void 0,
69
62
  {
70
- ref: btnRef,
71
- "aria-controls": listId,
72
- "aria-describedby": errorId ?? helperId,
73
- "aria-expanded": open,
74
- "aria-haspopup": "listbox",
75
- className: bem("button", { expanded: open }),
76
- disabled,
77
- id,
78
- name,
79
- type: "button",
80
- onClick: _clientState == null ? void 0 : _clientState.onButtonClick,
81
- onKeyDown: _clientState == null ? void 0 : _clientState.onButtonKey,
82
- children: display
83
- }
63
+ fullWidth: Boolean(fullWidth)
64
+ },
65
+ className
84
66
  ),
85
- /* @__PURE__ */ jsx(
86
- "input",
87
- {
88
- name,
89
- type: "hidden",
90
- value: Array.isArray(value) ? value.join(",") : value ?? ""
91
- }
92
- ),
93
- /* @__PURE__ */ jsxs(
94
- "ul",
95
- {
96
- ref: listRef,
97
- className: bem("listbox", { "is-open": open, "is-closed": !open }),
98
- hidden: !open,
99
- id: listId,
100
- role: "listbox",
101
- tabIndex: -1,
102
- children: [
103
- !Boolean(required) && !Boolean(multiple) && /* @__PURE__ */ jsx(
104
- "li",
105
- {
106
- "aria-selected": selectedItems.length === 0,
107
- className: bem("item", { selected: selectedItems.length === 0 }),
108
- role: "option",
109
- onClick: /* @__PURE__ */ __name(() => _clientState == null ? void 0 : _clientState.onOptionClick(null), "onClick"),
110
- onKeyDown: /* @__PURE__ */ __name(() => _clientState == null ? void 0 : _clientState.onOptionClick(null), "onKeyDown"),
111
- children: placeholder
112
- },
113
- "placeholder"
114
- ),
115
- items.map((opt) => {
116
- var _a;
117
- const selected = Array.isArray(value) ? value.includes(opt.value) : opt.value === value;
118
- return /* @__PURE__ */ jsxs(
119
- "li",
120
- {
121
- "aria-selected": selected,
122
- className: bem("item", { selected }),
123
- role: "option",
124
- onClick: /* @__PURE__ */ __name(() => _clientState == null ? void 0 : _clientState.onOptionClick(opt.value), "onClick"),
125
- onKeyDown: /* @__PURE__ */ __name(() => _clientState == null ? void 0 : _clientState.onOptionClick(opt.value), "onKeyDown"),
126
- children: [
127
- Boolean(multiple) && /* @__PURE__ */ jsx(
128
- "input",
129
- {
130
- readOnly: true,
131
- "aria-hidden": "true",
132
- className: bem("checkbox", { checked: selected }),
133
- defaultChecked: selected,
134
- type: "checkbox"
135
- }
136
- ),
137
- Boolean(iconVisible) && ((_a = opt.icon) == null ? void 0 : _a.call(opt)),
138
- opt.label
139
- ]
140
- },
141
- `${id}-${opt.value}`
142
- );
143
- })
144
- ]
145
- }
146
- )
147
- ] }),
148
- (isError || Boolean(helperText)) && /* @__PURE__ */ jsx(
149
- "div",
150
- {
151
- "aria-live": isError ? "assertive" : "polite",
152
- className: bem("helperText"),
153
- id: errorId ?? helperId,
154
- role: isError ? "alert" : void 0,
155
- children: /* @__PURE__ */ jsx(
156
- "span",
67
+ children: [
68
+ !Boolean(hideLabel) && /* @__PURE__ */ jsx(
69
+ Label,
157
70
  {
158
- className: bem("helperText__content", {
159
- "is-error": isError
160
- }),
161
- children: errorText ?? helperText
71
+ ...labelProps,
72
+ className: bem("label", void 0, labelProps == null ? void 0 : labelProps.className),
73
+ error: isError,
74
+ htmlFor: id,
75
+ label,
76
+ required,
77
+ type: "label"
78
+ }
79
+ ),
80
+ /* @__PURE__ */ jsxs("div", { className: bem("field", void 0, fieldClassName), children: [
81
+ /* @__PURE__ */ jsx(
82
+ "button",
83
+ {
84
+ ref: btnRef,
85
+ "aria-controls": listId,
86
+ "aria-describedby": errorId ?? helperId,
87
+ "aria-expanded": open,
88
+ "aria-haspopup": "listbox",
89
+ className: bem("button", { expanded: open }),
90
+ disabled,
91
+ id,
92
+ name,
93
+ type: "button",
94
+ onClick: _clientState == null ? void 0 : _clientState.onButtonClick,
95
+ onKeyDown: _clientState == null ? void 0 : _clientState.onButtonKey,
96
+ children: display
97
+ }
98
+ ),
99
+ /* @__PURE__ */ jsx(
100
+ "input",
101
+ {
102
+ name,
103
+ type: "hidden",
104
+ value: Array.isArray(value) ? value.join(",") : value ?? ""
105
+ }
106
+ ),
107
+ /* @__PURE__ */ jsxs(
108
+ "ul",
109
+ {
110
+ ref: listRef,
111
+ className: bem("listbox", { "is-open": open, "is-closed": !open }),
112
+ hidden: !open,
113
+ id: listId,
114
+ role: "listbox",
115
+ tabIndex: -1,
116
+ children: [
117
+ !Boolean(required) && !Boolean(multiple) && /* @__PURE__ */ jsx(
118
+ "li",
119
+ {
120
+ "aria-selected": selectedItems.length === 0,
121
+ className: bem("item", { selected: selectedItems.length === 0 }),
122
+ role: "option",
123
+ onClick: /* @__PURE__ */ __name(() => _clientState == null ? void 0 : _clientState.onOptionClick(null), "onClick"),
124
+ onKeyDown: /* @__PURE__ */ __name(() => _clientState == null ? void 0 : _clientState.onOptionClick(null), "onKeyDown"),
125
+ children: placeholder
126
+ },
127
+ "placeholder"
128
+ ),
129
+ items.map((opt) => {
130
+ var _a;
131
+ const selected = Array.isArray(value) ? value.includes(opt.value) : opt.value === value;
132
+ return /* @__PURE__ */ jsxs(
133
+ "li",
134
+ {
135
+ "aria-selected": selected,
136
+ className: bem("item", { selected }),
137
+ role: "option",
138
+ onClick: /* @__PURE__ */ __name(() => _clientState == null ? void 0 : _clientState.onOptionClick(opt.value), "onClick"),
139
+ onKeyDown: /* @__PURE__ */ __name(() => _clientState == null ? void 0 : _clientState.onOptionClick(opt.value), "onKeyDown"),
140
+ children: [
141
+ Boolean(multiple) && /* @__PURE__ */ jsx(
142
+ "input",
143
+ {
144
+ readOnly: true,
145
+ "aria-hidden": "true",
146
+ className: bem("checkbox", { checked: selected }),
147
+ defaultChecked: selected,
148
+ type: "checkbox"
149
+ }
150
+ ),
151
+ Boolean(iconVisible) && ((_a = opt.icon) == null ? void 0 : _a.call(opt)),
152
+ opt.label
153
+ ]
154
+ },
155
+ `${id}-${opt.value}`
156
+ );
157
+ })
158
+ ]
159
+ }
160
+ )
161
+ ] }),
162
+ (isError || Boolean(helperText)) && /* @__PURE__ */ jsx(
163
+ "div",
164
+ {
165
+ "aria-live": isError ? "assertive" : "polite",
166
+ className: bem("helperText"),
167
+ id: errorId ?? helperId,
168
+ role: isError ? "alert" : void 0,
169
+ children: /* @__PURE__ */ jsx(
170
+ "span",
171
+ {
172
+ className: bem("helperText__content", {
173
+ "is-error": isError
174
+ }),
175
+ children: errorText ?? helperText
176
+ }
177
+ )
162
178
  }
163
179
  )
164
- }
165
- )
166
- ] });
180
+ ]
181
+ }
182
+ );
167
183
  }
168
184
  __name(SelectView, "SelectView");
169
185
  export {
@@ -10,9 +10,7 @@ function SidebarClient({
10
10
  onChange,
11
11
  ...props
12
12
  }) {
13
- const [collapsed, setCollapsed] = useState(
14
- props.initialCollapsed ?? false
15
- );
13
+ const [collapsed, setCollapsed] = useState(props.initialCollapsed ?? false);
16
14
  useEffect(() => {
17
15
  const stored = localStorage.getItem(STORAGE_KEY);
18
16
  if (stored !== null) setCollapsed(stored === "1");
@@ -23,21 +21,24 @@ function SidebarClient({
23
21
  return !c;
24
22
  });
25
23
  }, "handleToggle");
26
- const formatedItems = useMemo(() => items.map((el) => {
27
- var _a;
28
- return {
29
- ...el,
30
- redirect: (el == null ? void 0 : el.redirect) && {
31
- ...el == null ? void 0 : el.redirect,
32
- href: ((_a = el == null ? void 0 : el.redirect) == null ? void 0 : _a.href) ?? "",
33
- onClick: /* @__PURE__ */ __name((e) => {
34
- var _a2, _b;
35
- (_b = (_a2 = el == null ? void 0 : el.redirect) == null ? void 0 : _a2.onClick) == null ? void 0 : _b.call(_a2, e);
36
- onChange == null ? void 0 : onChange(el);
37
- }, "onClick")
38
- }
39
- };
40
- }), [items, onChange]);
24
+ const formatedItems = useMemo(
25
+ () => items.map((el) => {
26
+ var _a;
27
+ return {
28
+ ...el,
29
+ redirect: (el == null ? void 0 : el.redirect) && {
30
+ ...el == null ? void 0 : el.redirect,
31
+ href: ((_a = el == null ? void 0 : el.redirect) == null ? void 0 : _a.href) ?? "",
32
+ onClick: /* @__PURE__ */ __name((e) => {
33
+ var _a2, _b;
34
+ (_b = (_a2 = el == null ? void 0 : el.redirect) == null ? void 0 : _a2.onClick) == null ? void 0 : _b.call(_a2, e);
35
+ onChange == null ? void 0 : onChange(el);
36
+ }, "onClick")
37
+ }
38
+ };
39
+ }),
40
+ [items, onChange]
41
+ );
41
42
  return /* @__PURE__ */ jsx(
42
43
  SideNavView,
43
44
  {
@@ -3,7 +3,14 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import SideNavView from "./SideNav.view.js";
5
5
  function SideNavServer(props) {
6
- return /* @__PURE__ */ jsx(SideNavView, { ...props, collapsed: props.initialCollapsed ?? false, interactive: false });
6
+ return /* @__PURE__ */ jsx(
7
+ SideNavView,
8
+ {
9
+ ...props,
10
+ collapsed: props.initialCollapsed ?? false,
11
+ interactive: false
12
+ }
13
+ );
7
14
  }
8
15
  __name(SideNavServer, "SideNavServer");
9
16
  export {
@@ -20,7 +20,14 @@ function SideNavView({
20
20
  className
21
21
  }) {
22
22
  const renderItem = /* @__PURE__ */ __name((icon, label) => /* @__PURE__ */ jsxs(Fragment, { children: [
23
- /* @__PURE__ */ jsx("div", { className: bem("icon__wrapper"), children: /* @__PURE__ */ jsx(Icon, { size: 25, ...icon, className: bem("icon", void 0, icon == null ? void 0 : icon.className) }) }),
23
+ /* @__PURE__ */ jsx("div", { className: bem("icon__wrapper"), children: /* @__PURE__ */ jsx(
24
+ Icon,
25
+ {
26
+ size: 25,
27
+ ...icon,
28
+ className: bem("icon", void 0, icon == null ? void 0 : icon.className)
29
+ }
30
+ ) }),
24
31
  !collapsed && /* @__PURE__ */ jsx("span", { className: bem("label", { collapsed }), children: label })
25
32
  ] }), "renderItem");
26
33
  return /* @__PURE__ */ jsxs(
@@ -38,7 +45,14 @@ function SideNavView({
38
45
  type: "button",
39
46
  onClick: onToggle,
40
47
  children: [
41
- /* @__PURE__ */ jsx(Icon, { size: "md", ...iconProps, name: collapsed ? collapsedIcon : unCollapsedIcon }),
48
+ /* @__PURE__ */ jsx(
49
+ Icon,
50
+ {
51
+ size: "md",
52
+ ...iconProps,
53
+ name: collapsed ? collapsedIcon : unCollapsedIcon
54
+ }
55
+ ),
42
56
  /* @__PURE__ */ jsx("span", { className: bem("collape__label", { "is-hidden": collapsed }), children: collapsed ? collapsedLabel : unCollapsedLabel })
43
57
  ]
44
58
  }
@@ -47,8 +61,12 @@ function SideNavView({
47
61
  Link,
48
62
  {
49
63
  ...redirect,
50
- className: bem("link", { collapsed, "is-active": Boolean(active) }, redirect == null ? void 0 : redirect.className),
51
64
  href: redirect.href,
65
+ className: bem(
66
+ "link",
67
+ { collapsed, "is-active": Boolean(active) },
68
+ redirect == null ? void 0 : redirect.className
69
+ ),
52
70
  children: renderItem(icon, label)
53
71
  }
54
72
  ) : /* @__PURE__ */ jsx(Fragment, { children: renderItem(icon, label) }) }, label)) }) })
@@ -2,7 +2,9 @@
2
2
  var __defProp = Object.defineProperty;
3
3
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
4
4
  import { useEffect } from "react";
5
- function SkeletonEffectsLoader({ animation }) {
5
+ function SkeletonEffectsLoader({
6
+ animation
7
+ }) {
6
8
  useEffect(() => {
7
9
  if (animation && animation !== "none") {
8
10
  void import("./Skeleton.effects.module.scss.js");
@@ -16,7 +16,10 @@ function SliderClient(props) {
16
16
  marks = false,
17
17
  snap = "none"
18
18
  } = props;
19
- const clamp = useCallback((v) => Math.min(Math.max(v, min), max), [min, max]);
19
+ const clamp = useCallback(
20
+ (v) => Math.min(Math.max(v, min), max),
21
+ [min, max]
22
+ );
20
23
  const markValues = useMemo(() => {
21
24
  if (Array.isArray(marks)) {
22
25
  return [...new Set(marks.map((m) => m.value))].filter((v) => typeof v === "number").sort((a, b) => a - b);
@@ -35,30 +38,36 @@ function SliderClient(props) {
35
38
  (v) => clamp(step > 0 ? Math.round((v - min) / step) * step + min : v),
36
39
  [clamp, step, min]
37
40
  );
38
- const snapToMarks = useCallback((v) => {
39
- const c = clamp(v);
40
- const arr = markValues;
41
- if (arr.length === 0) return snapToStep(c);
42
- let best = c, bestD = Infinity;
43
- for (const mv of arr) {
44
- const d = Math.abs(c - mv);
45
- if (d < bestD) {
46
- best = mv;
47
- bestD = d;
41
+ const snapToMarks = useCallback(
42
+ (v) => {
43
+ const c = clamp(v);
44
+ const arr = markValues;
45
+ if (arr.length === 0) return snapToStep(c);
46
+ let best = c, bestD = Infinity;
47
+ for (const mv of arr) {
48
+ const d = Math.abs(c - mv);
49
+ if (d < bestD) {
50
+ best = mv;
51
+ bestD = d;
52
+ }
48
53
  }
49
- }
50
- return clamp(best);
51
- }, [clamp, markValues, snapToStep]);
52
- const quantize = useCallback((v) => {
53
- switch (snap) {
54
- case "step":
55
- return snapToStep(v);
56
- case "marks":
57
- return snapToMarks(v);
58
- default:
59
- return clamp(v);
60
- }
61
- }, [snap, snapToMarks, snapToStep, clamp]);
54
+ return clamp(best);
55
+ },
56
+ [clamp, markValues, snapToStep]
57
+ );
58
+ const quantize = useCallback(
59
+ (v) => {
60
+ switch (snap) {
61
+ case "step":
62
+ return snapToStep(v);
63
+ case "marks":
64
+ return snapToMarks(v);
65
+ default:
66
+ return clamp(v);
67
+ }
68
+ },
69
+ [snap, snapToMarks, snapToStep, clamp]
70
+ );
62
71
  const initial = useMemo(() => {
63
72
  const numeric = typeof controlledValue === "number" ? controlledValue : typeof controlledValue === "string" ? Number(controlledValue) : min;
64
73
  return quantize(numeric);
@@ -72,20 +81,29 @@ function SliderClient(props) {
72
81
  }
73
82
  }, [controlledValue, min, quantize]);
74
83
  const [isFocused, setIsFocused] = useState(false);
75
- const handleFocus = useCallback((e) => {
76
- setIsFocused(true);
77
- onFocus == null ? void 0 : onFocus(e);
78
- }, [onFocus]);
79
- const handleBlur = useCallback((e) => {
80
- setIsFocused(false);
81
- onBlur == null ? void 0 : onBlur(e);
82
- }, [onBlur]);
83
- const handleChange = useCallback((e) => {
84
- const raw = Number(e.currentTarget.value);
85
- const q = quantize(raw);
86
- setInternalValue((prev) => prev === q ? prev : q);
87
- onChange == null ? void 0 : onChange(e, q);
88
- }, [onChange, quantize]);
84
+ const handleFocus = useCallback(
85
+ (e) => {
86
+ setIsFocused(true);
87
+ onFocus == null ? void 0 : onFocus(e);
88
+ },
89
+ [onFocus]
90
+ );
91
+ const handleBlur = useCallback(
92
+ (e) => {
93
+ setIsFocused(false);
94
+ onBlur == null ? void 0 : onBlur(e);
95
+ },
96
+ [onBlur]
97
+ );
98
+ const handleChange = useCallback(
99
+ (e) => {
100
+ const raw = Number(e.currentTarget.value);
101
+ const q = quantize(raw);
102
+ setInternalValue((prev) => prev === q ? prev : q);
103
+ onChange == null ? void 0 : onChange(e, q);
104
+ },
105
+ [onChange, quantize]
106
+ );
89
107
  return /* @__PURE__ */ jsx(
90
108
  SliderView,
91
109
  {
@@ -59,13 +59,7 @@ const SliderView = /* @__PURE__ */ __name(({
59
59
  ),
60
60
  /* @__PURE__ */ jsxs("div", { className: bem("root", { disabled: Boolean(disabled) }), children: [
61
61
  /* @__PURE__ */ jsx("div", { className: bem("rail") }),
62
- /* @__PURE__ */ jsx(
63
- "div",
64
- {
65
- className: bem("track"),
66
- style: { width: `${pct}%` }
67
- }
68
- ),
62
+ /* @__PURE__ */ jsx("div", { className: bem("track"), style: { width: `${pct}%` } }),
69
63
  markPoints.map((m) => {
70
64
  const leftPct = max > min ? ((m.value < min ? min : m.value > max ? max : m.value) - min) / (max - min) * 100 : 0;
71
65
  return /* @__PURE__ */ jsx(
@@ -36,13 +36,19 @@ function SnackbarProvider({
36
36
  const close = useCallback((id) => {
37
37
  setQueue((q) => q.filter((s) => s.id !== id));
38
38
  }, []);
39
- const ctx = useMemo(() => ({ enqueue, close }), [enqueue, close]);
40
- const grouped = useMemo(() => queue.reduce((acc, s) => {
41
- var _a, _b;
42
- const key = `${(_a = s.anchorOrigin) == null ? void 0 : _a.vertical}-${(_b = s.anchorOrigin) == null ? void 0 : _b.horizontal}`;
43
- (acc[key] ?? (acc[key] = [])).push(s);
44
- return acc;
45
- }, {}), [queue]);
39
+ const ctx = useMemo(
40
+ () => ({ enqueue, close }),
41
+ [enqueue, close]
42
+ );
43
+ const grouped = useMemo(
44
+ () => queue.reduce((acc, s) => {
45
+ var _a, _b;
46
+ const key = `${(_a = s.anchorOrigin) == null ? void 0 : _a.vertical}-${(_b = s.anchorOrigin) == null ? void 0 : _b.horizontal}`;
47
+ (acc[key] ?? (acc[key] = [])).push(s);
48
+ return acc;
49
+ }, {}),
50
+ [queue]
51
+ );
46
52
  return /* @__PURE__ */ jsxs(SnackbarCtx.Provider, { value: ctx, children: [
47
53
  children,
48
54
  Object.entries(grouped).map(([key, snacks]) => {
@@ -52,23 +58,16 @@ function SnackbarProvider({
52
58
  [`is-${vertical}`]: true,
53
59
  [`is-${horizontal}`]: true
54
60
  };
55
- return /* @__PURE__ */ jsx(
56
- "div",
61
+ return /* @__PURE__ */ jsx("div", { className: bem(void 0, mod, className), children: snacks.map((snk) => /* @__PURE__ */ jsx(
62
+ Snackbar,
57
63
  {
58
- className: bem(void 0, mod, className),
59
- children: snacks.map((snk) => /* @__PURE__ */ jsx(
60
- Snackbar,
61
- {
62
- ...snk,
63
- open: true,
64
- className: bem("snackbar", mod, snk.className),
65
- onClose: /* @__PURE__ */ __name(() => close(snk.id), "onClose")
66
- },
67
- snk.id
68
- ))
64
+ ...snk,
65
+ open: true,
66
+ className: bem("snackbar", mod, snk.className),
67
+ onClose: /* @__PURE__ */ __name(() => close(snk.id), "onClose")
69
68
  },
70
- key
71
- );
69
+ snk.id
70
+ )) }, key);
72
71
  })
73
72
  ] });
74
73
  }
@@ -104,14 +104,7 @@ const StepperClient = forwardRef((props, ref) => {
104
104
  }
105
105
  };
106
106
  }),
107
- [
108
- steps,
109
- activeStep,
110
- handleStepClick,
111
- handleStepKeyDown,
112
- onFocus,
113
- onBlur
114
- ]
107
+ [steps, activeStep, handleStepClick, handleStepKeyDown, onFocus, onBlur]
115
108
  );
116
109
  return /* @__PURE__ */ jsx(
117
110
  StepperView,
@@ -5,12 +5,7 @@ import { jsx } from "react/jsx-runtime";
5
5
  import { memo, useState, useEffect, useCallback } from "react";
6
6
  import { SwitchView } from "./Switch.view.js";
7
7
  function SwitchClient(props) {
8
- const {
9
- checked: controlledChecked,
10
- onChange,
11
- onFocus,
12
- onBlur
13
- } = props;
8
+ const { checked: controlledChecked, onChange, onFocus, onBlur } = props;
14
9
  const [isChecked, setIsChecked] = useState(
15
10
  controlledChecked ?? false
16
11
  );
@@ -3,9 +3,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { SwitchView } from "./Switch.view.js";
5
5
  function SwitchServer(props) {
6
- const {
7
- checked: controlledChecked
8
- } = props;
6
+ const { checked: controlledChecked } = props;
9
7
  const isChecked = typeof controlledChecked === "boolean" ? controlledChecked : false;
10
8
  return /* @__PURE__ */ jsx(
11
9
  SwitchView,
@@ -50,7 +50,9 @@ const Table = /* @__PURE__ */ __name(({
50
50
  return /* @__PURE__ */ jsx(
51
51
  "tr",
52
52
  {
53
- className: bem("body__row", { "has-link": isString((_a = row == null ? void 0 : row.redirect) == null ? void 0 : _a.href) }),
53
+ className: bem("body__row", {
54
+ "has-link": isString((_a = row == null ? void 0 : row.redirect) == null ? void 0 : _a.href)
55
+ }),
54
56
  children: row == null ? void 0 : row.cells.filter((el) => el !== null).map((cell, b) => /* @__PURE__ */ createElement(
55
57
  TableCell,
56
58
  {
@@ -36,7 +36,19 @@ const TableCell = /* @__PURE__ */ __name(({
36
36
  ...cellProps,
37
37
  className: bem(void 0, { "has-icon": Boolean(icon) }, className),
38
38
  id,
39
- children: (redirect == null ? void 0 : redirect.href) !== void 0 ? /* @__PURE__ */ jsx(Link, { priority: true, ...redirect, className: bem("inner", { "has-link": true }, (redirect == null ? void 0 : redirect.className) ?? classNameInner), children: renderCellContent() }) : /* @__PURE__ */ jsx("span", { className: bem("inner", void 0, classNameInner), children: renderCellContent() })
39
+ children: (redirect == null ? void 0 : redirect.href) !== void 0 ? /* @__PURE__ */ jsx(
40
+ Link,
41
+ {
42
+ priority: true,
43
+ ...redirect,
44
+ className: bem(
45
+ "inner",
46
+ { "has-link": true },
47
+ (redirect == null ? void 0 : redirect.className) ?? classNameInner
48
+ ),
49
+ children: renderCellContent()
50
+ }
51
+ ) : /* @__PURE__ */ jsx("span", { className: bem("inner", void 0, classNameInner), children: renderCellContent() })
40
52
  }
41
53
  );
42
54
  }, "TableCell");