@lerianstudio/sindarian-ui 2.0.0-beta.25 → 2.0.0-beta.27

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 (307) hide show
  1. package/dist/charts/chart.js +4 -231
  2. package/dist/charts/index.js +1 -11
  3. package/dist/components/breadcrumb/get-breadcrumb-paths.js +1 -18
  4. package/dist/components/breadcrumb/index.js +1 -37
  5. package/dist/components/card/account-card/index.js +1 -69
  6. package/dist/components/card/basic-card/index.js +1 -20
  7. package/dist/components/card/dashboard-card/index.js +1 -20
  8. package/dist/components/card/entity-card/index.js +1 -68
  9. package/dist/components/card/index.js +1 -20
  10. package/dist/components/dialog/confirmation-dialog/index.js +1 -96
  11. package/dist/components/dialog/confirmation-dialog/use-confirm-dialog.js +1 -55
  12. package/dist/components/dialog/index.js +1 -19
  13. package/dist/components/dialog/large-dialog/index.js +1 -21
  14. package/dist/components/entity-box/index.js +1 -67
  15. package/dist/components/entity-data-table/index.js +1 -20
  16. package/dist/components/form/combo-box-field/index.js +1 -35
  17. package/dist/components/form/country-field/index.js +1 -11
  18. package/dist/components/form/date-picker-field/index.js +1 -83
  19. package/dist/components/form/date-range-field/index.js +1 -58
  20. package/dist/components/form/date-time-picker-field/index.js +1 -114
  21. package/dist/components/form/file-upload-field/index.js +1 -69
  22. package/dist/components/form/index.js +1 -31
  23. package/dist/components/form/input-field/index.js +1 -96
  24. package/dist/components/form/otp-field/index.js +1 -19
  25. package/dist/components/form/pagination-limit-field/index.js +1 -10
  26. package/dist/components/form/password-field/index.js +1 -16
  27. package/dist/components/form/radio-group-field/index.js +1 -36
  28. package/dist/components/form/renderable-label.js +1 -57
  29. package/dist/components/form/select-field/index.js +1 -68
  30. package/dist/components/form/state-field/index.js +1 -42
  31. package/dist/components/form/switch-field/index.js +1 -16
  32. package/dist/components/form/textarea-field/index.js +1 -23
  33. package/dist/components/page/index.js +1 -20
  34. package/dist/components/page-header/index.js +1 -80
  35. package/dist/components/pagination/index.js +1 -10
  36. package/dist/components/table/id-table-cell.js +1 -109
  37. package/dist/components/table/index.js +1 -19
  38. package/dist/components/table/locked-table-actions.js +1 -41
  39. package/dist/components/table/name-table-cell.js +1 -58
  40. package/dist/components/ui/accordion/index.js +1 -62
  41. package/dist/components/ui/alert/index.js +1 -45
  42. package/dist/components/ui/alert-dialog/index.js +1 -84
  43. package/dist/components/ui/autocomplete/index.js +1 -440
  44. package/dist/components/ui/autosize-textarea/index.js +1 -89
  45. package/dist/components/ui/avatar/index.js +1 -51
  46. package/dist/components/ui/badge/index.js +1 -83
  47. package/dist/components/ui/breadcrumb/index.js +1 -35
  48. package/dist/components/ui/button/index.js +1 -65
  49. package/dist/components/ui/calendar/index.js +1 -118
  50. package/dist/components/ui/card/index.js +1 -32
  51. package/dist/components/ui/checkbox/index.js +1 -44
  52. package/dist/components/ui/collapsible/index.js +1 -50
  53. package/dist/components/ui/command/index.js +1 -95
  54. package/dist/components/ui/copy-field/index.js +1 -163
  55. package/dist/components/ui/dialog/index.js +1 -80
  56. package/dist/components/ui/dialog/styles.css +1 -1
  57. package/dist/components/ui/dropdown-menu/index.js +1 -110
  58. package/dist/components/ui/field/index.js +1 -82
  59. package/dist/components/ui/file-upload/index.js +1 -574
  60. package/dist/components/ui/form.js +1 -162
  61. package/dist/components/ui/hover-card/index.js +1 -51
  62. package/dist/components/ui/icon-button/index.js +1 -35
  63. package/dist/components/ui/input/adornment.js +1 -21
  64. package/dist/components/ui/input/index.js +1 -99
  65. package/dist/components/ui/label/index.js +1 -45
  66. package/dist/components/ui/lerian-wordmark/index.js +1 -7
  67. package/dist/components/ui/loading-button/index.js +1 -9
  68. package/dist/components/ui/multiple-select/index.js +1 -235
  69. package/dist/components/ui/otp-input/index.js +1 -62
  70. package/dist/components/ui/paper/index.js +1 -8
  71. package/dist/components/ui/paper-collapsible/index.js +1 -24
  72. package/dist/components/ui/popover/index.js +1 -55
  73. package/dist/components/ui/progress/index.js +1 -66
  74. package/dist/components/ui/qr-code/index.js +1 -27
  75. package/dist/components/ui/radio-group/index.js +1 -48
  76. package/dist/components/ui/scroll-area/index.js +1 -49
  77. package/dist/components/ui/select/index.js +1 -119
  78. package/dist/components/ui/separator/index.js +1 -43
  79. package/dist/components/ui/sheet/index.js +1 -136
  80. package/dist/components/ui/sidebar/index.js +1 -27
  81. package/dist/components/ui/sidebar/next-router.cjs +1 -119
  82. package/dist/components/ui/sidebar/sidebar-back-button.js +1 -8
  83. package/dist/components/ui/sidebar/sidebar-components.js +1 -23
  84. package/dist/components/ui/sidebar/sidebar-expand-button.js +1 -49
  85. package/dist/components/ui/sidebar/sidebar-item-button.js +1 -21
  86. package/dist/components/ui/sidebar/sidebar-item-collapsible.js +1 -52
  87. package/dist/components/ui/sidebar/sidebar-item-icon-button.js +1 -18
  88. package/dist/components/ui/sidebar/sidebar-item.js +1 -44
  89. package/dist/components/ui/sidebar/sidebar-provider.js +1 -201
  90. package/dist/components/ui/sidebar/sidebar-root.js +1 -130
  91. package/dist/components/ui/sidebar/sidebar-router.js +1 -126
  92. package/dist/components/ui/sidebar/sidebar-trigger.js +1 -57
  93. package/dist/components/ui/skeleton/index.js +1 -8
  94. package/dist/components/ui/stepper/index.js +1 -29
  95. package/dist/components/ui/switch/index.js +1 -43
  96. package/dist/components/ui/table/index.js +1 -56
  97. package/dist/components/ui/tabs/index.js +1 -55
  98. package/dist/components/ui/tabs/styles.css +1 -1
  99. package/dist/components/ui/textarea/index.js +1 -8
  100. package/dist/components/ui/time-picker/index.js +1 -85
  101. package/dist/components/ui/toast/index.js +1 -3
  102. package/dist/components/ui/toast/toaster.js +1 -16
  103. package/dist/components/ui/toggle-group/index.js +1 -156
  104. package/dist/components/ui/tooltip/index.js +1 -81
  105. package/dist/domain/blotter/index.js +1 -20
  106. package/dist/domain/delinquency-aging/aging-buckets.js +1 -120
  107. package/dist/domain/delinquency-aging/index.js +1 -222
  108. package/dist/domain/figure/index.js +1 -19
  109. package/dist/domain/format.js +1 -137
  110. package/dist/domain/index.js +1 -43
  111. package/dist/domain/key-id/index.js +1 -174
  112. package/dist/domain/ledger-sheet/index.js +1 -28
  113. package/dist/domain/money-diff.js +1 -48
  114. package/dist/domain/money-math.js +1 -104
  115. package/dist/domain/money-text/index.js +1 -123
  116. package/dist/domain/section-label/index.js +1 -17
  117. package/dist/domain/status-rail/index.js +1 -76
  118. package/dist/domain/threshold-gauge/index.js +1 -161
  119. package/dist/enterprise/alert-banner/index.js +1 -24
  120. package/dist/enterprise/app-shell/index.js +1 -87
  121. package/dist/enterprise/cursor-pager/index.js +1 -26
  122. package/dist/enterprise/data-table/column-size.js +1 -103
  123. package/dist/enterprise/data-table/index.js +1 -345
  124. package/dist/enterprise/date-range-picker/index.js +1 -115
  125. package/dist/enterprise/detail-panel/index.js +1 -20
  126. package/dist/enterprise/empty-state/index.js +1 -14
  127. package/dist/enterprise/index.js +1 -39
  128. package/dist/enterprise/number-input/index.js +1 -252
  129. package/dist/enterprise/search-input/index.js +1 -121
  130. package/dist/enterprise/stat-card/index.js +1 -75
  131. package/dist/enterprise/status-badge/index.js +1 -120
  132. package/dist/enterprise/use-is-mobile.js +1 -68
  133. package/dist/enterprise/virtualized-table/index.js +1 -141
  134. package/dist/esm/charts/chart.js +4 -190
  135. package/dist/esm/charts/index.js +1 -3
  136. package/dist/esm/components/breadcrumb/get-breadcrumb-paths.js +1 -12
  137. package/dist/esm/components/breadcrumb/index.js +1 -30
  138. package/dist/esm/components/card/account-card/index.js +1 -53
  139. package/dist/esm/components/card/basic-card/index.js +1 -14
  140. package/dist/esm/components/card/dashboard-card/index.js +1 -14
  141. package/dist/esm/components/card/entity-card/index.js +1 -52
  142. package/dist/esm/components/card/index.js +1 -4
  143. package/dist/esm/components/dialog/confirmation-dialog/index.js +1 -60
  144. package/dist/esm/components/dialog/confirmation-dialog/use-confirm-dialog.js +1 -49
  145. package/dist/esm/components/dialog/index.js +1 -3
  146. package/dist/esm/components/dialog/large-dialog/index.js +1 -16
  147. package/dist/esm/components/entity-box/index.js +1 -56
  148. package/dist/esm/components/entity-data-table/index.js +1 -17
  149. package/dist/esm/components/form/combo-box-field/index.js +1 -28
  150. package/dist/esm/components/form/country-field/index.js +1 -7
  151. package/dist/esm/components/form/date-picker-field/index.js +1 -43
  152. package/dist/esm/components/form/date-range-field/index.js +1 -18
  153. package/dist/esm/components/form/date-time-picker-field/index.js +1 -74
  154. package/dist/esm/components/form/file-upload-field/index.js +1 -65
  155. package/dist/esm/components/form/index.js +1 -15
  156. package/dist/esm/components/form/input-field/index.js +1 -92
  157. package/dist/esm/components/form/otp-field/index.js +1 -15
  158. package/dist/esm/components/form/pagination-limit-field/index.js +1 -6
  159. package/dist/esm/components/form/password-field/index.js +1 -10
  160. package/dist/esm/components/form/radio-group-field/index.js +1 -32
  161. package/dist/esm/components/form/renderable-label.js +1 -54
  162. package/dist/esm/components/form/select-field/index.js +1 -64
  163. package/dist/esm/components/form/state-field/index.js +1 -35
  164. package/dist/esm/components/form/switch-field/index.js +1 -12
  165. package/dist/esm/components/form/textarea-field/index.js +1 -19
  166. package/dist/esm/components/page/index.js +1 -15
  167. package/dist/esm/components/page-header/index.js +1 -71
  168. package/dist/esm/components/pagination/index.js +1 -6
  169. package/dist/esm/components/table/id-table-cell.js +1 -105
  170. package/dist/esm/components/table/index.js +1 -3
  171. package/dist/esm/components/table/locked-table-actions.js +1 -37
  172. package/dist/esm/components/table/name-table-cell.js +1 -54
  173. package/dist/esm/components/ui/accordion/index.js +1 -24
  174. package/dist/esm/components/ui/alert/index.js +1 -38
  175. package/dist/esm/components/ui/alert-dialog/index.js +1 -39
  176. package/dist/esm/components/ui/autocomplete/index.js +1 -392
  177. package/dist/esm/components/ui/autosize-textarea/index.js +1 -51
  178. package/dist/esm/components/ui/avatar/index.js +1 -14
  179. package/dist/esm/components/ui/badge/index.js +1 -79
  180. package/dist/esm/components/ui/breadcrumb/index.js +1 -27
  181. package/dist/esm/components/ui/button/index.js +1 -60
  182. package/dist/esm/components/ui/calendar/index.js +1 -82
  183. package/dist/esm/components/ui/card/index.js +1 -24
  184. package/dist/esm/components/ui/checkbox/index.js +1 -9
  185. package/dist/esm/components/ui/collapsible/index.js +1 -13
  186. package/dist/esm/components/ui/command/index.js +1 -51
  187. package/dist/esm/components/ui/copy-field/index.js +1 -127
  188. package/dist/esm/components/ui/dialog/index.js +1 -36
  189. package/dist/esm/components/ui/dropdown-menu/index.js +1 -60
  190. package/dist/esm/components/ui/field/index.js +1 -71
  191. package/dist/esm/components/ui/file-upload/index.js +1 -536
  192. package/dist/esm/components/ui/form.js +1 -118
  193. package/dist/esm/components/ui/hover-card/index.js +1 -14
  194. package/dist/esm/components/ui/icon-button/index.js +1 -31
  195. package/dist/esm/components/ui/input/adornment.js +1 -17
  196. package/dist/esm/components/ui/input/index.js +1 -60
  197. package/dist/esm/components/ui/label/index.js +1 -10
  198. package/dist/esm/components/ui/lerian-wordmark/index.js +1 -4
  199. package/dist/esm/components/ui/loading-button/index.js +1 -7
  200. package/dist/esm/components/ui/multiple-select/index.js +1 -196
  201. package/dist/esm/components/ui/otp-input/index.js +1 -21
  202. package/dist/esm/components/ui/paper/index.js +1 -5
  203. package/dist/esm/components/ui/paper-collapsible/index.js +1 -19
  204. package/dist/esm/components/ui/popover/index.js +1 -17
  205. package/dist/esm/components/ui/progress/index.js +1 -31
  206. package/dist/esm/components/ui/qr-code/index.js +1 -24
  207. package/dist/esm/components/ui/radio-group/index.js +1 -12
  208. package/dist/esm/components/ui/scroll-area/index.js +1 -13
  209. package/dist/esm/components/ui/select/index.js +1 -74
  210. package/dist/esm/components/ui/separator/index.js +1 -8
  211. package/dist/esm/components/ui/sheet/index.js +1 -92
  212. package/dist/esm/components/ui/sidebar/index.js +1 -11
  213. package/dist/esm/components/ui/sidebar/next-router.cjs +1 -119
  214. package/dist/esm/components/ui/sidebar/sidebar-back-button.js +1 -5
  215. package/dist/esm/components/ui/sidebar/sidebar-components.js +1 -15
  216. package/dist/esm/components/ui/sidebar/sidebar-expand-button.js +1 -42
  217. package/dist/esm/components/ui/sidebar/sidebar-item-button.js +1 -18
  218. package/dist/esm/components/ui/sidebar/sidebar-item-collapsible.js +1 -44
  219. package/dist/esm/components/ui/sidebar/sidebar-item-icon-button.js +1 -14
  220. package/dist/esm/components/ui/sidebar/sidebar-item.js +1 -40
  221. package/dist/esm/components/ui/sidebar/sidebar-provider.js +1 -193
  222. package/dist/esm/components/ui/sidebar/sidebar-root.js +1 -126
  223. package/dist/esm/components/ui/sidebar/sidebar-router.js +1 -89
  224. package/dist/esm/components/ui/sidebar/sidebar-trigger.js +1 -53
  225. package/dist/esm/components/ui/skeleton/index.js +1 -6
  226. package/dist/esm/components/ui/stepper/index.js +1 -20
  227. package/dist/esm/components/ui/switch/index.js +1 -8
  228. package/dist/esm/components/ui/table/index.js +1 -44
  229. package/dist/esm/components/ui/tabs/index.js +1 -17
  230. package/dist/esm/components/ui/textarea/index.js +1 -6
  231. package/dist/esm/components/ui/time-picker/index.js +1 -49
  232. package/dist/esm/components/ui/toast/index.js +1 -2
  233. package/dist/esm/components/ui/toast/toaster.js +1 -13
  234. package/dist/esm/components/ui/toggle-group/index.js +1 -120
  235. package/dist/esm/components/ui/tooltip/index.js +1 -43
  236. package/dist/esm/domain/blotter/index.js +1 -16
  237. package/dist/esm/domain/delinquency-aging/aging-buckets.js +1 -115
  238. package/dist/esm/domain/delinquency-aging/index.js +1 -218
  239. package/dist/esm/domain/figure/index.js +1 -15
  240. package/dist/esm/domain/format.js +1 -128
  241. package/dist/esm/domain/index.js +1 -19
  242. package/dist/esm/domain/key-id/index.js +1 -169
  243. package/dist/esm/domain/ledger-sheet/index.js +1 -24
  244. package/dist/esm/domain/money-diff.js +1 -45
  245. package/dist/esm/domain/money-math.js +1 -98
  246. package/dist/esm/domain/money-text/index.js +1 -118
  247. package/dist/esm/domain/section-label/index.js +1 -14
  248. package/dist/esm/domain/status-rail/index.js +1 -71
  249. package/dist/esm/domain/threshold-gauge/index.js +1 -157
  250. package/dist/esm/enterprise/alert-banner/index.js +1 -21
  251. package/dist/esm/enterprise/app-shell/index.js +1 -51
  252. package/dist/esm/enterprise/cursor-pager/index.js +1 -23
  253. package/dist/esm/enterprise/data-table/column-size.js +1 -97
  254. package/dist/esm/enterprise/data-table/index.js +1 -342
  255. package/dist/esm/enterprise/date-range-picker/index.js +1 -112
  256. package/dist/esm/enterprise/detail-panel/index.js +1 -17
  257. package/dist/esm/enterprise/empty-state/index.js +1 -11
  258. package/dist/esm/enterprise/index.js +1 -22
  259. package/dist/esm/enterprise/number-input/index.js +1 -214
  260. package/dist/esm/enterprise/search-input/index.js +1 -85
  261. package/dist/esm/enterprise/stat-card/index.js +1 -72
  262. package/dist/esm/enterprise/status-badge/index.js +1 -116
  263. package/dist/esm/enterprise/use-is-mobile.js +1 -31
  264. package/dist/esm/enterprise/virtualized-table/index.js +1 -138
  265. package/dist/esm/hooks/use-click-away.js +1 -22
  266. package/dist/esm/hooks/use-pagination.js +1 -38
  267. package/dist/esm/hooks/use-stepper.js +1 -22
  268. package/dist/esm/hooks/use-time.js +1 -13
  269. package/dist/esm/hooks/use-toast.js +1 -107
  270. package/dist/esm/index.js +1 -77
  271. package/dist/esm/lib/storage/get-storage-object.js +1 -17
  272. package/dist/esm/lib/storage/get-storage.js +1 -14
  273. package/dist/esm/lib/storage/index.js +1 -2
  274. package/dist/esm/lib/typography.js +1 -31
  275. package/dist/esm/lib/utils.js +1 -41
  276. package/dist/esm/theme/get-theme-script.js +1 -41
  277. package/dist/esm/theme/index.js +1 -4
  278. package/dist/esm/theme/mode-toggle.js +1 -45
  279. package/dist/esm/theme/theme-provider.js +1 -122
  280. package/dist/esm/toast/helpers.js +1 -36
  281. package/dist/esm/toast/index.js +1 -4
  282. package/dist/esm/types/metadata-type.js +1 -1
  283. package/dist/esm/utils/countries.cjs +1 -17
  284. package/dist/esm/utils/country-utils.js +1 -18
  285. package/dist/esm/utils/currency-codes.js +1 -181
  286. package/dist/hooks/use-click-away.js +1 -29
  287. package/dist/hooks/use-pagination.js +1 -41
  288. package/dist/hooks/use-stepper.js +1 -26
  289. package/dist/hooks/use-time.js +1 -20
  290. package/dist/hooks/use-toast.js +1 -111
  291. package/dist/index.js +1 -96
  292. package/dist/lib/storage/get-storage-object.js +1 -23
  293. package/dist/lib/storage/get-storage.js +1 -17
  294. package/dist/lib/storage/index.js +1 -18
  295. package/dist/lib/typography.js +1 -34
  296. package/dist/lib/utils.js +1 -45
  297. package/dist/theme/get-theme-script.js +1 -44
  298. package/dist/theme/index.js +1 -11
  299. package/dist/theme/mode-toggle.js +1 -48
  300. package/dist/theme/theme-provider.js +1 -160
  301. package/dist/toast/helpers.js +1 -41
  302. package/dist/toast/index.js +1 -10
  303. package/dist/types/metadata-type.js +1 -2
  304. package/dist/utils/countries.cjs +1 -17
  305. package/dist/utils/country-utils.js +1 -25
  306. package/dist/utils/currency-codes.js +1 -184
  307. package/package.json +4 -3
@@ -1,160 +1 @@
1
- 'use client';
2
- "use strict";
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
- Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.ThemeProvider = ThemeProvider;
38
- exports.useTheme = useTheme;
39
- exports.useOptionalTheme = useOptionalTheme;
40
- const jsx_runtime_1 = require("react/jsx-runtime");
41
- /**
42
- * ThemeProvider — owns theme preference ('light' | 'dark' | 'system'),
43
- * persists it to localStorage, applies the `.dark` class on
44
- * `document.documentElement`, and resolves 'system' via
45
- * `prefers-color-scheme`.
46
- *
47
- * SSR-safe: state initializes to `defaultTheme` and never reads
48
- * window/localStorage during render. The persisted value is read inside an
49
- * effect on mount, so first paint uses `defaultTheme`. Pair with
50
- * `getThemeScript` in the document <head> to remove the flash before paint.
51
- *
52
- * Same-tab sync is handled by React context (every consumer reads the same
53
- * provider state); cross-tab sync rides the native `storage` event. While the
54
- * preference is 'system', `matchMedia('change')` keeps the resolved value live.
55
- * Theme switches are instant by design — no global color transition.
56
- */
57
- const React = __importStar(require("react"));
58
- const DARK_QUERY = '(prefers-color-scheme: dark)';
59
- function isThemePreference(value) {
60
- return value === 'light' || value === 'dark' || value === 'system';
61
- }
62
- function systemPrefersDark() {
63
- if (typeof window === 'undefined' ||
64
- typeof window.matchMedia !== 'function') {
65
- return false;
66
- }
67
- return window.matchMedia(DARK_QUERY).matches;
68
- }
69
- const ThemeContext = React.createContext(null);
70
- function ThemeProvider({ children, storageKey = 'sindarian.theme', defaultTheme = 'system' }) {
71
- const [theme, setThemeState] = React.useState(defaultTheme);
72
- const [resolvedTheme, setResolvedTheme] = React.useState(defaultTheme === 'dark' ? 'dark' : 'light');
73
- const setTheme = React.useCallback((next) => {
74
- setThemeState(next);
75
- if (typeof window === 'undefined')
76
- return;
77
- try {
78
- window.localStorage.setItem(storageKey, next);
79
- }
80
- catch {
81
- // Storage unavailable (private mode, quota). In-memory state still works.
82
- }
83
- }, [storageKey]);
84
- // Read the persisted preference once on mount (effect, never render).
85
- React.useEffect(() => {
86
- if (typeof window === 'undefined')
87
- return;
88
- try {
89
- const stored = window.localStorage.getItem(storageKey);
90
- if (isThemePreference(stored))
91
- setThemeState(stored);
92
- }
93
- catch {
94
- // Ignore; keep defaultTheme.
95
- }
96
- }, [storageKey]);
97
- // Apply the resolved class; while 'system', track prefers-color-scheme live.
98
- React.useEffect(() => {
99
- if (typeof document === 'undefined')
100
- return;
101
- const apply = (dark) => {
102
- document.documentElement.classList.toggle('dark', dark);
103
- setResolvedTheme(dark ? 'dark' : 'light');
104
- };
105
- apply(theme === 'system' ? systemPrefersDark() : theme === 'dark');
106
- if (theme !== 'system' || typeof window.matchMedia !== 'function') {
107
- return;
108
- }
109
- const media = window.matchMedia(DARK_QUERY);
110
- const onChange = (event) => apply(event.matches);
111
- media.addEventListener('change', onChange);
112
- return () => media.removeEventListener('change', onChange);
113
- }, [theme]);
114
- // Cross-tab sync: the native `storage` event only fires in OTHER tabs.
115
- React.useEffect(() => {
116
- if (typeof window === 'undefined')
117
- return;
118
- const onStorage = (event) => {
119
- // WHICH STORE first, then which key. Only the store the preference lives
120
- // in may change it: a sessionStorage event carrying the SAME key would
121
- // otherwise mutate a localStorage-backed preference. `storageArea` is
122
- // absent only on a hand-dispatched synthetic event — apps use those for
123
- // same-tab sync — and one of those is not attributable to any store, so it
124
- // is allowed through rather than silently dropped.
125
- if (event.storageArea != null &&
126
- event.storageArea !== window.localStorage)
127
- return;
128
- // A null key means another tab called `clear()` on the whole store, so the
129
- // stored preference is gone even though it is not named. Returning early
130
- // on that left the provider holding a deleted preference — and the wrong
131
- // `dark` class on the document. Fall through with newValue null, which
132
- // lands on the fallback.
133
- if (event.key !== null && event.key !== storageKey)
134
- return;
135
- setThemeState(isThemePreference(event.newValue) ? event.newValue : defaultTheme);
136
- };
137
- window.addEventListener('storage', onStorage);
138
- return () => window.removeEventListener('storage', onStorage);
139
- }, [storageKey, defaultTheme]);
140
- const value = React.useMemo(() => ({ theme, setTheme, resolvedTheme }), [theme, setTheme, resolvedTheme]);
141
- return (0, jsx_runtime_1.jsx)(ThemeContext.Provider, { value: value, children: children });
142
- }
143
- /** Reads the theme context. Throws if used outside a ThemeProvider. */
144
- function useTheme() {
145
- const context = React.useContext(ThemeContext);
146
- if (context === null) {
147
- throw new Error('useTheme must be used within a ThemeProvider');
148
- }
149
- return context;
150
- }
151
- /**
152
- * Reads the theme context without requiring a provider — `undefined` when
153
- * there is none. For library components that should follow the theme when one
154
- * exists but must not force every consumer to mount a ThemeProvider (Toaster).
155
- * Not re-exported from the package barrel: consumers use `useTheme`, whose
156
- * throw is the intended signal that the provider is missing.
157
- */
158
- function useOptionalTheme() {
159
- return React.useContext(ThemeContext) ?? undefined;
160
- }
1
+ "use client";"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(n,e,r,t){if(t===void 0)t=r;var i=Object.getOwnPropertyDescriptor(e,r);if(!i||("get"in i?!e.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return e[r]}}}Object.defineProperty(n,t,i)}):(function(n,e,r,t){if(t===void 0)t=r;n[t]=e[r]}));var __setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:true,value:e})}):function(n,e){n["default"]=e});var __importStar=this&&this.__importStar||(function(){var n=function(e){n=Object.getOwnPropertyNames||function(r){var t=[];for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i))t[t.length]=i;return t};return n(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null){for(var t=n(e),i=0;i<t.length;i++)if(t[i]!=="default")__createBinding(r,e,t[i])}__setModuleDefault(r,e);return r}})();Object.defineProperty(exports,"__esModule",{value:true});exports.ThemeProvider=ThemeProvider;exports.useTheme=useTheme;exports.useOptionalTheme=useOptionalTheme;const jsx_runtime_1=require("react/jsx-runtime");const React=__importStar(require("react"));const DARK_QUERY="(prefers-color-scheme: dark)";function isThemePreference(n){return n==="light"||n==="dark"||n==="system"}function systemPrefersDark(){if(typeof window==="undefined"||typeof window.matchMedia!=="function"){return false}return window.matchMedia(DARK_QUERY).matches}const ThemeContext=React.createContext(null);function ThemeProvider({children:n,storageKey:e="sindarian.theme",defaultTheme:r="system"}){const[t,i]=React.useState(r);const[c,d]=React.useState(r==="dark"?"dark":"light");const a=React.useCallback(o=>{i(o);if(typeof window==="undefined")return;try{window.localStorage.setItem(e,o)}catch{}},[e]);React.useEffect(()=>{if(typeof window==="undefined")return;try{const o=window.localStorage.getItem(e);if(isThemePreference(o))i(o)}catch{}},[e]);React.useEffect(()=>{if(typeof document==="undefined")return;const o=s=>{document.documentElement.classList.toggle("dark",s);d(s?"dark":"light")};o(t==="system"?systemPrefersDark():t==="dark");if(t!=="system"||typeof window.matchMedia!=="function"){return}const u=window.matchMedia(DARK_QUERY);const f=s=>o(s.matches);u.addEventListener("change",f);return()=>u.removeEventListener("change",f)},[t]);React.useEffect(()=>{if(typeof window==="undefined")return;const o=u=>{if(u.storageArea!=null&&u.storageArea!==window.localStorage)return;if(u.key!==null&&u.key!==e)return;i(isThemePreference(u.newValue)?u.newValue:r)};window.addEventListener("storage",o);return()=>window.removeEventListener("storage",o)},[e,r]);const l=React.useMemo(()=>({theme:t,setTheme:a,resolvedTheme:c}),[t,a,c]);return(0,jsx_runtime_1.jsx)(ThemeContext.Provider,{value:l,children:n})}function useTheme(){const n=React.useContext(ThemeContext);if(n===null){throw new Error("useTheme must be used within a ThemeProvider")}return n}function useOptionalTheme(){return React.useContext(ThemeContext)??void 0}
@@ -1,41 +1 @@
1
- 'use client';
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.successToast = successToast;
5
- exports.errorToast = errorToast;
6
- exports.warningToast = warningToast;
7
- /**
8
- * Severity toast helpers — thin wrappers over sindarian-ui's own toast
9
- * machinery (`@/hooks/use-toast`), which renders through `<Toaster />`.
10
- *
11
- * The bare `toast` is deliberately NOT re-exported here: sindarian-ui already
12
- * exports it from the main barrel, and one name must resolve to one function.
13
- * Call `toast({ title, description, variant })` directly when a helper does not
14
- * fit.
15
- *
16
- * Variant mapping — one helper per severity, onto sindarian-ui's own variants:
17
- *
18
- * successToast → 'success' (green)
19
- * errorToast → 'destructive' (red)
20
- * warningToast → 'warning' (amber)
21
- */
22
- const use_toast_1 = require("../hooks/use-toast");
23
- function raise(variant, title, description, opts) {
24
- (0, use_toast_1.toast)({
25
- action: opts?.action,
26
- variant,
27
- title,
28
- description,
29
- duration: opts?.duration,
30
- id: opts?.id
31
- });
32
- }
33
- function successToast(title, description, opts) {
34
- raise('success', title, description, opts);
35
- }
36
- function errorToast(title, description, opts) {
37
- raise('destructive', title, description, opts);
38
- }
39
- function warningToast(title, description, opts) {
40
- raise('warning', title, description, opts);
41
- }
1
+ "use client";"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.successToast=successToast;exports.errorToast=errorToast;exports.warningToast=warningToast;const use_toast_1=require("../hooks/use-toast");function raise(t,s,e,o){(0,use_toast_1.toast)({action:o?.action,variant:t,title:s,description:e,duration:o?.duration,id:o?.id})}function successToast(t,s,e){raise("success",t,s,e)}function errorToast(t,s,e){raise("destructive",t,s,e)}function warningToast(t,s,e){raise("warning",t,s,e)}
@@ -1,10 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.warningToast = exports.errorToast = exports.successToast = void 0;
4
- // Owned by lane theme-toasts-charts — see docs/plans/2026-08-26-sindarian-x-retirement/
5
- // NOTE: the bare `toast` is NOT re-exported here — sindarian-ui's main barrel
6
- // already exports it from `@/hooks/use-toast`.
7
- var helpers_1 = require("./helpers");
8
- Object.defineProperty(exports, "successToast", { enumerable: true, get: function () { return helpers_1.successToast; } });
9
- Object.defineProperty(exports, "errorToast", { enumerable: true, get: function () { return helpers_1.errorToast; } });
10
- Object.defineProperty(exports, "warningToast", { enumerable: true, get: function () { return helpers_1.warningToast; } });
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.warningToast=exports.errorToast=exports.successToast=void 0;var helpers_1=require("./helpers");Object.defineProperty(exports,"successToast",{enumerable:true,get:function(){return helpers_1.successToast}});Object.defineProperty(exports,"errorToast",{enumerable:true,get:function(){return helpers_1.errorToast}});Object.defineProperty(exports,"warningToast",{enumerable:true,get:function(){return helpers_1.warningToast}});
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});
@@ -1,17 +1 @@
1
- 'use strict'
2
-
3
- /**
4
- * The country/state dataset, loaded through CommonJS on purpose.
5
- *
6
- * A plain `import ... from './countries.json'` compiles fine, but Node's ESM
7
- * loader rejects it without an `with { type: 'json' }` attribute — and that
8
- * attribute cannot be written once for a dual build: TypeScript refuses it in
9
- * any file that compiles to a `require` call (TS2856). Since a JSON `require`
10
- * needs no attribute in either output, the one-line load lives here, in a
11
- * `.cjs` file that is CommonJS inside `dist/` and inside `dist/esm/` alike.
12
- *
13
- * Without this, `import '@lerianstudio/sindarian-ui'` throws
14
- * ERR_IMPORT_ATTRIBUTE_MISSING under any native-ESM consumer — Vitest, which
15
- * externalises ESM dependencies, being the one the apps actually hit.
16
- */
17
- module.exports = require('../public/countries.json')
1
+ "use strict";module.exports=require("../public/countries.json");
@@ -1,25 +1 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getStateCountry = exports.getCountries = void 0;
7
- const countries_cjs_1 = __importDefault(require("./countries.cjs"));
8
- const getCountries = () => {
9
- return countries_cjs_1.default.map((country) => ({
10
- code: country.code2,
11
- name: country.name,
12
- states: country.states.map((state) => ({
13
- name: state.name,
14
- code: state.code
15
- }))
16
- }));
17
- };
18
- exports.getCountries = getCountries;
19
- const getStateCountry = (country) => {
20
- const selectedCountry = getCountries().find((countryItem) => countryItem.code === country || countryItem.name === country);
21
- if (!selectedCountry)
22
- return [];
23
- return selectedCountry.states || [];
24
- };
25
- exports.getStateCountry = getStateCountry;
1
+ "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(exports,"__esModule",{value:true});exports.getStateCountry=exports.getCountries=void 0;const countries_cjs_1=__importDefault(require("./countries.cjs"));const getCountries=()=>{return countries_cjs_1.default.map(e=>({code:e.code2,name:e.name,states:e.states.map(t=>({name:t.name,code:t.code}))}))};exports.getCountries=getCountries;const getStateCountry=e=>{const t=getCountries().find(s=>s.code===e||s.name===e);if(!t)return[];return t.states||[]};exports.getStateCountry=getStateCountry;
@@ -1,184 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.currencyObjects = exports.currencyCodes = void 0;
4
- exports.currencyCodes = [
5
- 'AED',
6
- 'AFN',
7
- 'ALL',
8
- 'AMD',
9
- 'ANG',
10
- 'AOA',
11
- 'ARS',
12
- 'AUD',
13
- 'AWG',
14
- 'AZN',
15
- 'BAM',
16
- 'BBD',
17
- 'BDT',
18
- 'BGN',
19
- 'BHD',
20
- 'BIF',
21
- 'BMD',
22
- 'BND',
23
- 'BOB',
24
- 'BOV',
25
- 'BRL',
26
- 'BSD',
27
- 'BTN',
28
- 'BWP',
29
- 'BYR',
30
- 'BZD',
31
- 'CAD',
32
- 'CDF',
33
- 'CHE',
34
- 'CHF',
35
- 'CHW',
36
- 'CLF',
37
- 'CLP',
38
- 'CNY',
39
- 'COP',
40
- 'COU',
41
- 'CRC',
42
- 'CUC',
43
- 'CUP',
44
- 'CVE',
45
- 'CZK',
46
- 'DJF',
47
- 'DKK',
48
- 'DOP',
49
- 'DZD',
50
- 'EGP',
51
- 'ERN',
52
- 'ETB',
53
- 'EUR',
54
- 'FJD',
55
- 'FKP',
56
- 'GBP',
57
- 'GEL',
58
- 'GHS',
59
- 'GIP',
60
- 'GMD',
61
- 'GNF',
62
- 'GTQ',
63
- 'GYD',
64
- 'HKD',
65
- 'HNL',
66
- 'HRK',
67
- 'HTG',
68
- 'HUF',
69
- 'IDR',
70
- 'ILS',
71
- 'INR',
72
- 'IQD',
73
- 'IRR',
74
- 'ISK',
75
- 'JMD',
76
- 'JOD',
77
- 'JPY',
78
- 'KES',
79
- 'KGS',
80
- 'KHR',
81
- 'KMF',
82
- 'KPW',
83
- 'KRW',
84
- 'KWD',
85
- 'KYD',
86
- 'KZT',
87
- 'LAK',
88
- 'LBP',
89
- 'LKR',
90
- 'LRD',
91
- 'LSL',
92
- 'LTL',
93
- 'LVL',
94
- 'LYD',
95
- 'MAD',
96
- 'MDL',
97
- 'MGA',
98
- 'MKD',
99
- 'MMK',
100
- 'MNT',
101
- 'MOP',
102
- 'MRO',
103
- 'MUR',
104
- 'MVR',
105
- 'MWK',
106
- 'MXN',
107
- 'MXV',
108
- 'MYR',
109
- 'MZN',
110
- 'NAD',
111
- 'NGN',
112
- 'NIO',
113
- 'NOK',
114
- 'NPR',
115
- 'NZD',
116
- 'OMR',
117
- 'PAB',
118
- 'PEN',
119
- 'PGK',
120
- 'PHP',
121
- 'PKR',
122
- 'PLN',
123
- 'PYG',
124
- 'QAR',
125
- 'RON',
126
- 'RSD',
127
- 'RUB',
128
- 'RWF',
129
- 'SAR',
130
- 'SBD',
131
- 'SCR',
132
- 'SDG',
133
- 'SEK',
134
- 'SGD',
135
- 'SHP',
136
- 'SLL',
137
- 'SOS',
138
- 'SRD',
139
- 'SSP',
140
- 'STD',
141
- 'SYP',
142
- 'SZL',
143
- 'THB',
144
- 'TJS',
145
- 'TMT',
146
- 'TND',
147
- 'TOP',
148
- 'TRY',
149
- 'TTD',
150
- 'TWD',
151
- 'TZS',
152
- 'UAH',
153
- 'UGX',
154
- 'USD',
155
- 'USN',
156
- 'USS',
157
- 'UYI',
158
- 'UYU',
159
- 'UZS',
160
- 'VEF',
161
- 'VND',
162
- 'VUV',
163
- 'WST',
164
- 'XAF',
165
- 'XAG',
166
- 'XAU',
167
- 'XBA',
168
- 'XBB',
169
- 'XBC',
170
- 'XBD',
171
- 'XCD',
172
- 'XDR',
173
- 'XFU',
174
- 'XOF',
175
- 'XPD',
176
- 'XPF',
177
- 'XPT',
178
- 'XTS',
179
- 'XXX',
180
- 'YER',
181
- 'ZAR',
182
- 'ZMW'
183
- ];
184
- exports.currencyObjects = exports.currencyCodes.map((code) => ({ code }));
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.currencyObjects=exports.currencyCodes=void 0;exports.currencyCodes=["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYR","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HRK","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LTL","LVL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRO","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLL","SOS","SRD","SSP","STD","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","USS","UYI","UYU","UZS","VEF","VND","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XFU","XOF","XPD","XPF","XPT","XTS","XXX","YER","ZAR","ZMW"];exports.currencyObjects=exports.currencyCodes.map(D=>({code:D}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lerianstudio/sindarian-ui",
3
- "version": "2.0.0-beta.25",
3
+ "version": "2.0.0-beta.27",
4
4
  "description": "Sindarian UI - A UI library for Midaz Console",
5
5
  "license": "Elastic-2.0",
6
6
  "author": {
@@ -38,9 +38,9 @@
38
38
  ],
39
39
  "scripts": {
40
40
  "check-types": "tsc --noEmit && tsc -p tsconfig.storybook.json",
41
- "build": "npm run build:cjs && npm run build:esm && npm run copy:assets && npm run copy:styles",
41
+ "build": "npm run build:cjs && npm run build:esm && node scripts/minify-dist.mjs && node scripts/check-esm-output.mjs && npm run copy:assets && npm run copy:styles",
42
42
  "build:cjs": "tsc && tsc-alias -p tsconfig.json && copyfiles -u 1 \"src/**/*.cjs\" \"src/**/*.d.cts\" \"src/**/*.json\" dist",
43
- "build:esm": "tsc -p tsconfig.esm.json && tsc-alias -p tsconfig.esm.json --resolve-full-paths && copyfiles -u 1 \"src/**/*.cjs\" \"src/**/*.d.cts\" \"src/**/*.json\" dist/esm && node -e \"require('fs').writeFileSync('dist/esm/package.json',JSON.stringify({type:'module'}))\" && node scripts/check-esm-output.mjs",
43
+ "build:esm": "tsc -p tsconfig.esm.json && tsc-alias -p tsconfig.esm.json --resolve-full-paths && copyfiles -u 1 \"src/**/*.cjs\" \"src/**/*.d.cts\" \"src/**/*.json\" dist/esm && node -e \"require('fs').writeFileSync('dist/esm/package.json',JSON.stringify({type:'module'}))\"",
44
44
  "copy:assets": "copyfiles -f \"src/public/**/*\" dist/public && copyfiles -u 1 \"src/fonts/*\" dist",
45
45
  "copy:styles": "copyfiles -u 1 \"src/**/*.css\" dist",
46
46
  "lint": "eslint .",
@@ -111,6 +111,7 @@
111
111
  "@storybook/nextjs": "^10.4.6",
112
112
  "@types/react": "^19.2.17",
113
113
  "@types/react-dom": "^19.2.5",
114
+ "esbuild": "^0.27.7",
114
115
  "next": "^16.2.6",
115
116
  "storybook": "^10.4.6"
116
117
  },