@cryptlex/web-components 5.1.1 → 5.3.0-alpha

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 (209) hide show
  1. package/dist/components/data-table/data-table-filter.d.ts +27 -0
  2. package/dist/components/data-table/data-table-filter.js +2 -0
  3. package/dist/components/data-table/data-table-filter.js.map +1 -0
  4. package/dist/components/data-table/data-table.d.ts +72 -0
  5. package/dist/components/data-table/data-table.js +2 -0
  6. package/dist/components/data-table/data-table.js.map +1 -0
  7. package/dist/components/data-table/table-commons.d.ts +56 -0
  8. package/dist/components/data-table/table-commons.js +2 -0
  9. package/dist/components/data-table/table-commons.js.map +1 -0
  10. package/dist/components/inputs/checkbox.d.ts +8 -0
  11. package/dist/components/inputs/checkbox.js +2 -0
  12. package/dist/components/inputs/checkbox.js.map +1 -0
  13. package/dist/components/inputs/date-picker.d.ts +11 -0
  14. package/dist/components/inputs/date-picker.js +2 -0
  15. package/dist/components/inputs/date-picker.js.map +1 -0
  16. package/dist/components/inputs/datefield.d.ts +14 -0
  17. package/dist/components/inputs/datefield.js +2 -0
  18. package/dist/components/inputs/datefield.js.map +1 -0
  19. package/dist/components/inputs/field.d.ts +20 -0
  20. package/dist/components/inputs/field.js +2 -0
  21. package/dist/components/inputs/field.js.map +1 -0
  22. package/dist/components/inputs/id-search.d.ts +20 -0
  23. package/dist/components/inputs/id-search.js +2 -0
  24. package/dist/components/inputs/id-search.js.map +1 -0
  25. package/dist/components/inputs/input-otp.d.ts +7 -0
  26. package/dist/components/inputs/input-otp.js +2 -0
  27. package/dist/components/inputs/input-otp.js.map +1 -0
  28. package/dist/components/inputs/multi-select.d.ts +16 -0
  29. package/dist/components/inputs/multi-select.js +2 -0
  30. package/dist/components/inputs/multi-select.js.map +1 -0
  31. package/dist/components/inputs/numberfield.d.ts +6 -0
  32. package/dist/components/inputs/numberfield.js +2 -0
  33. package/dist/components/inputs/numberfield.js.map +1 -0
  34. package/dist/components/inputs/searchfield.d.ts +5 -0
  35. package/dist/components/inputs/searchfield.js +2 -0
  36. package/dist/components/inputs/searchfield.js.map +1 -0
  37. package/dist/components/inputs/select-options.d.ts +8 -0
  38. package/dist/components/inputs/select-options.js +2 -0
  39. package/dist/components/inputs/select-options.js.map +1 -0
  40. package/dist/components/inputs/select.d.ts +17 -0
  41. package/dist/components/inputs/select.js +2 -0
  42. package/dist/components/inputs/select.js.map +1 -0
  43. package/dist/components/inputs/textfield.d.ts +7 -0
  44. package/dist/components/inputs/textfield.js +2 -0
  45. package/dist/components/inputs/textfield.js.map +1 -0
  46. package/dist/components/key-value-card/key-value-card.d.ts +17 -0
  47. package/dist/components/key-value-card/key-value-card.js +2 -0
  48. package/dist/components/key-value-card/key-value-card.js.map +1 -0
  49. package/dist/components/ui/alert.d.ts +8 -0
  50. package/dist/components/ui/alert.js +2 -0
  51. package/dist/components/ui/alert.js.map +1 -0
  52. package/dist/components/ui/avatar.d.ts +7 -0
  53. package/dist/components/ui/avatar.js +2 -0
  54. package/dist/components/ui/avatar.js.map +1 -0
  55. package/dist/components/ui/badge.d.ts +1 -0
  56. package/dist/components/ui/badge.js +2 -0
  57. package/dist/components/ui/badge.js.map +1 -0
  58. package/dist/components/ui/breadcrumbs.d.ts +10 -0
  59. package/dist/components/ui/breadcrumbs.js +2 -0
  60. package/dist/components/ui/breadcrumbs.js.map +1 -0
  61. package/dist/components/ui/button.d.ts +11 -0
  62. package/dist/components/ui/button.js +2 -0
  63. package/dist/components/ui/button.js.map +1 -0
  64. package/dist/components/ui/calendar.d.ts +16 -0
  65. package/dist/components/ui/calendar.js +2 -0
  66. package/dist/components/ui/calendar.js.map +1 -0
  67. package/dist/components/ui/card.d.ts +7 -0
  68. package/dist/components/ui/card.js +2 -0
  69. package/dist/components/ui/card.js.map +1 -0
  70. package/dist/components/ui/dialog.d.ts +18 -0
  71. package/dist/components/ui/dialog.js +2 -0
  72. package/dist/components/ui/dialog.js.map +1 -0
  73. package/dist/components/ui/disclosure.d.ts +18 -0
  74. package/dist/components/ui/disclosure.js +2 -0
  75. package/dist/components/ui/disclosure.js.map +1 -0
  76. package/dist/components/ui/list-box.d.ts +5 -0
  77. package/dist/components/ui/list-box.js +2 -0
  78. package/dist/components/ui/list-box.js.map +1 -0
  79. package/dist/components/ui/loader.d.ts +5 -0
  80. package/dist/components/ui/loader.js +2 -0
  81. package/dist/components/ui/loader.js.map +1 -0
  82. package/dist/components/ui/menu.d.ts +24 -0
  83. package/dist/components/ui/menu.js +2 -0
  84. package/dist/components/ui/menu.js.map +1 -0
  85. package/dist/components/ui/popover.d.ts +4 -0
  86. package/dist/components/ui/popover.js +2 -0
  87. package/dist/components/ui/popover.js.map +1 -0
  88. package/dist/components/ui/sidebar.d.ts +52 -0
  89. package/dist/components/ui/sidebar.js +2 -0
  90. package/dist/components/ui/sidebar.js.map +1 -0
  91. package/dist/components/ui/skeleton.d.ts +1 -0
  92. package/dist/components/ui/skeleton.js +2 -0
  93. package/dist/components/ui/skeleton.js.map +1 -0
  94. package/dist/components/ui/sonner.d.ts +4 -0
  95. package/dist/components/ui/sonner.js +2 -0
  96. package/dist/components/ui/sonner.js.map +1 -0
  97. package/dist/components/ui/table.d.ts +8 -0
  98. package/dist/components/ui/table.js +2 -0
  99. package/dist/components/ui/table.js.map +1 -0
  100. package/dist/components/ui/tabs.d.ts +5 -0
  101. package/dist/components/ui/tabs.js +2 -0
  102. package/dist/components/ui/tabs.js.map +1 -0
  103. package/dist/components/ui/timeline.d.ts +15 -0
  104. package/dist/components/ui/timeline.js +2 -0
  105. package/dist/components/ui/timeline.js.map +1 -0
  106. package/dist/components/ui/tooltip.d.ts +4 -0
  107. package/dist/components/ui/tooltip.js +2 -0
  108. package/dist/components/ui/tooltip.js.map +1 -0
  109. package/dist/utils/form-context.d.ts +4 -0
  110. package/dist/utils/form-context.js +2 -0
  111. package/dist/utils/form-context.js.map +1 -0
  112. package/dist/utils/form-hook.d.ts +23 -0
  113. package/dist/utils/form-hook.js +2 -0
  114. package/dist/utils/form-hook.js.map +1 -0
  115. package/dist/utils/primitives.d.ts +44 -0
  116. package/dist/utils/primitives.js +2 -0
  117. package/dist/utils/primitives.js.map +1 -0
  118. package/dist/utils/resource-names.d.ts +11 -0
  119. package/dist/utils/resource-names.js +2 -0
  120. package/dist/utils/resource-names.js.map +1 -0
  121. package/dist/utils/use-mobile.d.ts +1 -0
  122. package/dist/utils/use-mobile.js +2 -0
  123. package/dist/utils/use-mobile.js.map +1 -0
  124. package/package.json +33 -35
  125. package/dist/components/data-table/data-table-filter.es.js +0 -132
  126. package/dist/components/data-table/data-table-filter.es.js.map +0 -1
  127. package/dist/components/data-table/data-table.es.js +0 -412
  128. package/dist/components/data-table/data-table.es.js.map +0 -1
  129. package/dist/components/data-table/table-commons.es.js +0 -136
  130. package/dist/components/data-table/table-commons.es.js.map +0 -1
  131. package/dist/components/inputs/checkbox.es.js +0 -61
  132. package/dist/components/inputs/checkbox.es.js.map +0 -1
  133. package/dist/components/inputs/date-picker.es.js +0 -124
  134. package/dist/components/inputs/date-picker.es.js.map +0 -1
  135. package/dist/components/inputs/datefield.es.js +0 -90
  136. package/dist/components/inputs/datefield.es.js.map +0 -1
  137. package/dist/components/inputs/field.es.js +0 -91
  138. package/dist/components/inputs/field.es.js.map +0 -1
  139. package/dist/components/inputs/id-search.es.js +0 -61
  140. package/dist/components/inputs/id-search.es.js.map +0 -1
  141. package/dist/components/inputs/input-otp.es.js +0 -60
  142. package/dist/components/inputs/input-otp.es.js.map +0 -1
  143. package/dist/components/inputs/multi-select.es.js +0 -47
  144. package/dist/components/inputs/multi-select.es.js.map +0 -1
  145. package/dist/components/inputs/numberfield.es.js +0 -101
  146. package/dist/components/inputs/numberfield.es.js.map +0 -1
  147. package/dist/components/inputs/searchfield.es.js +0 -80
  148. package/dist/components/inputs/searchfield.es.js.map +0 -1
  149. package/dist/components/inputs/select-options.es.js +0 -286
  150. package/dist/components/inputs/select-options.es.js.map +0 -1
  151. package/dist/components/inputs/select.es.js +0 -113
  152. package/dist/components/inputs/select.es.js.map +0 -1
  153. package/dist/components/inputs/textfield.es.js +0 -86
  154. package/dist/components/inputs/textfield.es.js.map +0 -1
  155. package/dist/components/key-value-card/key-value-card.es.js +0 -53
  156. package/dist/components/key-value-card/key-value-card.es.js.map +0 -1
  157. package/dist/components/ui/alert.es.js +0 -29
  158. package/dist/components/ui/alert.es.js.map +0 -1
  159. package/dist/components/ui/avatar.es.js +0 -19
  160. package/dist/components/ui/avatar.es.js.map +0 -1
  161. package/dist/components/ui/badge.es.js +0 -19
  162. package/dist/components/ui/badge.es.js.map +0 -1
  163. package/dist/components/ui/breadcrumbs.es.js +0 -104
  164. package/dist/components/ui/breadcrumbs.es.js.map +0 -1
  165. package/dist/components/ui/button.es.js +0 -58
  166. package/dist/components/ui/button.es.js.map +0 -1
  167. package/dist/components/ui/calendar.es.js +0 -163
  168. package/dist/components/ui/calendar.es.js.map +0 -1
  169. package/dist/components/ui/card.es.js +0 -53
  170. package/dist/components/ui/card.es.js.map +0 -1
  171. package/dist/components/ui/dialog.es.js +0 -156
  172. package/dist/components/ui/dialog.es.js.map +0 -1
  173. package/dist/components/ui/disclosure.es.js +0 -90
  174. package/dist/components/ui/disclosure.es.js.map +0 -1
  175. package/dist/components/ui/list-box.es.js +0 -76
  176. package/dist/components/ui/list-box.es.js.map +0 -1
  177. package/dist/components/ui/loader.es.js +0 -10
  178. package/dist/components/ui/loader.es.js.map +0 -1
  179. package/dist/components/ui/menu.es.js +0 -129
  180. package/dist/components/ui/menu.es.js.map +0 -1
  181. package/dist/components/ui/popover.es.js +0 -32
  182. package/dist/components/ui/popover.es.js.map +0 -1
  183. package/dist/components/ui/sidebar.es.js +0 -456
  184. package/dist/components/ui/sidebar.es.js.map +0 -1
  185. package/dist/components/ui/skeleton.es.js +0 -9
  186. package/dist/components/ui/skeleton.es.js.map +0 -1
  187. package/dist/components/ui/sonner.es.js +0 -24
  188. package/dist/components/ui/sonner.es.js.map +0 -1
  189. package/dist/components/ui/table.es.js +0 -88
  190. package/dist/components/ui/table.es.js.map +0 -1
  191. package/dist/components/ui/tabs.es.js +0 -83
  192. package/dist/components/ui/tabs.es.js.map +0 -1
  193. package/dist/components/ui/timeline.es.js +0 -46
  194. package/dist/components/ui/timeline.es.js.map +0 -1
  195. package/dist/components/ui/tooltip.es.js +0 -28
  196. package/dist/components/ui/tooltip.es.js.map +0 -1
  197. package/dist/index.es.d.ts +0 -861
  198. package/dist/index.es.js +0 -218
  199. package/dist/index.es.js.map +0 -1
  200. package/dist/utils/form-context.es.js +0 -8
  201. package/dist/utils/form-context.es.js.map +0 -1
  202. package/dist/utils/form-hook.es.js +0 -30
  203. package/dist/utils/form-hook.es.js.map +0 -1
  204. package/dist/utils/primitives.es.js +0 -31
  205. package/dist/utils/primitives.es.js.map +0 -1
  206. package/dist/utils/resource-names.es.js +0 -182
  207. package/dist/utils/resource-names.es.js.map +0 -1
  208. package/dist/utils/use-mobile.es.js +0 -17
  209. package/dist/utils/use-mobile.es.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import{jsx as s}from"react/jsx-runtime";import{convertCamelCaseToTitleCase as n}from"./primitives.js";import{createContext as i,use as l}from"react";import"clsx";const t={"product.displayName":"Product"},f=["access-token","account","activation","activation-log","admin-role","audit-log","automated-email","automated-email-event-log","card","feature-flag","invoice","license","license-template","maintenance-policy","organization","plan","product","product-version","profile","release","release-channel","release-file","release-platform","report","role","role-claim","saml-configuration","segment","sending-domain","setting","tag","team-member","trial","trial-policy","user","user-group","webhook","webhook-event-log","webhook-trigger","reseller","oidc-configuration","organization-claim","reseller-claim"],y={account:"Your organization account.",product:"Products are the software products you want to license",license:"Licenses represent a purchase of your software. These can be linked to customers, and the license key is required to use the product.","access-token":"Access Tokens are used to authenticate your API requests.",activation:"Activations, also known as devices/machines/seats are the devices consuming licenses.","activation-log":"Activation Log is a log entry of activation/deactivation of a particular license.",trial:"Trial/Trial Activation is a device that has activated a trial of your product.","audit-log":"Audit logs contain all the changes made to your account.","automated-email":"Automated Email allow you to send marketing emails based on events on the linked product.","automated-email-event-log":"Automated email event log is the log of all the automated email events for your product.",card:"The payment card for your account.","feature-flag":"Feature flags define features that make up tiers for your products.",invoice:"","license-template":"License templates are a blueprint for the licenses you create for your customers and prevent repetition when creating licenses.","maintenance-policy":"Maintenance policies represent support contracts and can be linked to licenses.",plan:"","product-version":"Product Versions are sets of Feature Flags that define the tiers of your products.","release-channel":"Release channel is the release channel for your product.","release-file":"Release files are files within your created releases.","release-platform":'Release Platforms differentiate the target platform for your release. Common platforms include "Windows", "macOS", and "Linux".',release:"Releases help you to manage different versions of your app, and secure distribute it to licensed users.",report:"Analytics data for your account","role-claim":"",role:"Roles define permissions for your team.","saml-configuration":"",segment:"Sets of filters that can be saved to filter resources.","trial-policy":"Trial policies are templates for creating trials for your products.","webhook-event-log":"Webhook Event Logs are logs of events that have occured on webhooks.","webhook-trigger":"",webhook:"Webhooks are HTTP callbacks which are triggered by specific events.",organization:"",profile:"",setting:"",tag:"Tags allow you to manage your licenses and customers on the dashboard.","team-member":"Team members can access the account based on their roles.",user:"A user refers to your customer whom you want to license your product.","sending-domain":"Allows Cryptlex to send emails on your behalf using your From Email address","admin-role":"Roles that have type admin","user-group":"Groups of users that you can assign licenses to.",reseller:"Resellers allow you to delegate user management to third parties or partners","oidc-configuration":"","organization-claim":"","reseller-claim":""},a={id:"ID",createdAt:"Creation Date",scopes:"Permissions",updatedAt:"Last Updated",expiresAt:"Expiration Date",lastSeenAt:"Last Seen",os:"OS",osVersion:"OS Version",key:"License Key",vmName:"VM Name",container:"Container",allowedIpRange:"Allowed IP Range",allowedIpRanges:"Allowed IP Ranges",allowedIpAddresses:"Allowed IP Addresses",disallowedIpAddresses:"Disallowed IP Addresses",allowVmActivation:"Allow VM Activation",disableGeoLocation:"Disable Geolocation","user.id":"User ID",userId:"User",productId:"Product",downloads:"Total Downloads",claims:"Permissions",googleSsoEnabled:"Google Login Enabled",lastAttemptedAt:"Last Attempt Date",url:"URL","trialPolicy.name":"Trial Policy Name","licensePolicy.name":"License Template Name",licensePolicy:"License Template",eventLog:"Audit Log",cc:"CC Recepients",bcc:"BCC Recepients",ipAddress:"IP Address",resellerId:"Reseller",productVersionId:"Product Version",releaseId:"Release",maintenancePolicyId:"Maintenance Policy",webhookId:"Webhook",automatedEmailId:"Automated Email","location.countryName":"Country","location.ipAddress":"IP Address","location.countryCode":"Country",organizationId:"Organization","address.country":"Country","address.addressLine1":"Address Line 1","address.addressLine2":"Address Line 2",responseStatusCode:"HTTP Status Code",resourceId:"Resource ID",Sso:"SAML SSO 2.0","reseller.name":"Reseller",sendingDomain:"Email Sending Domain"};function c(e,o){return o!=="admin-portal"&&e in t?t[e]:e in a?a[e]:n(e)}const r=i("admin-portal");function h({projectName:e,children:o}){return s(r.Provider,{value:e,children:o})}function d(){return l(r)}function A(){const e=d();return o=>c(o,e)}export{h as ProjectProvider,y as RESOURCE_DEFINITIONS,f as RESOURCE_NAMES,d as useProjectName,A as useResourceFormatter};
2
+ //# sourceMappingURL=resource-names.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-names.js","sources":["../../lib/utils/resource-names.tsx"],"sourcesContent":["import { convertCamelCaseToTitleCase, type CtxPortals } from \"lib/utils/primitives\";\nimport { createContext, use } from \"react\";\n\n// Display names specific to customer and reseller portal\nconst OTHER_PORTALS_DISPLAY_NAME: Record<string, string> = {\n \"product.displayName\": \"Product\",\n};\n\n/** Resource Name should ALWAYS be in singular form */\nexport const RESOURCE_NAMES = [\n \"access-token\",\n \"account\",\n \"activation\",\n \"activation-log\",\n \"admin-role\",\n \"audit-log\",\n \"automated-email\",\n \"automated-email-event-log\",\n \"card\",\n \"feature-flag\",\n \"invoice\",\n \"license\",\n \"license-template\",\n \"maintenance-policy\",\n \"organization\",\n \"plan\",\n \"product\",\n \"product-version\",\n \"profile\",\n \"release\",\n \"release-channel\",\n \"release-file\",\n \"release-platform\",\n \"report\",\n \"role\",\n \"role-claim\",\n \"saml-configuration\",\n \"segment\",\n \"sending-domain\",\n \"setting\",\n \"tag\",\n \"team-member\",\n \"trial\",\n \"trial-policy\",\n \"user\",\n \"user-group\",\n \"webhook\",\n \"webhook-event-log\",\n \"webhook-trigger\",\n \"reseller\",\n \"oidc-configuration\",\n \"organization-claim\",\n \"reseller-claim\",\n] as const;\nexport type ResourceName = (typeof RESOURCE_NAMES)[number];\nexport const RESOURCE_DEFINITIONS: Record<ResourceName, string> = {\n account: \"Your organization account.\",\n product: \"Products are the software products you want to license\",\n license:\n \"Licenses represent a purchase of your software. These can be linked to customers, and the license key is required to use the product.\",\n \"access-token\": \"Access Tokens are used to authenticate your API requests.\",\n activation:\n \"Activations, also known as devices/machines/seats are the devices consuming licenses.\",\n \"activation-log\":\n \"Activation Log is a log entry of activation/deactivation of a particular license.\",\n trial:\n \"Trial/Trial Activation is a device that has activated a trial of your product.\",\n \"audit-log\": \"Audit logs contain all the changes made to your account.\",\n \"automated-email\":\n \"Automated Email allow you to send marketing emails based on events on the linked product.\",\n \"automated-email-event-log\":\n \"Automated email event log is the log of all the automated email events for your product.\",\n card: \"The payment card for your account.\",\n \"feature-flag\":\n \"Feature flags define features that make up tiers for your products.\",\n invoice: \"\",\n \"license-template\":\n \"License templates are a blueprint for the licenses you create for your customers and prevent repetition when creating licenses.\",\n \"maintenance-policy\":\n \"Maintenance policies represent support contracts and can be linked to licenses.\",\n plan: \"\",\n \"product-version\":\n \"Product Versions are sets of Feature Flags that define the tiers of your products.\",\n \"release-channel\": \"Release channel is the release channel for your product.\",\n \"release-file\": \"Release files are files within your created releases.\",\n \"release-platform\":\n 'Release Platforms differentiate the target platform for your release. Common platforms include \"Windows\", \"macOS\", and \"Linux\".',\n release:\n \"Releases help you to manage different versions of your app, and secure distribute it to licensed users.\",\n report: \"Analytics data for your account\",\n \"role-claim\": \"\",\n role: \"Roles define permissions for your team.\",\n \"saml-configuration\": \"\",\n segment: \"Sets of filters that can be saved to filter resources.\",\n \"trial-policy\":\n \"Trial policies are templates for creating trials for your products.\",\n \"webhook-event-log\":\n \"Webhook Event Logs are logs of events that have occured on webhooks.\",\n \"webhook-trigger\": \"\",\n webhook:\n \"Webhooks are HTTP callbacks which are triggered by specific events.\",\n organization: \"\",\n profile: \"\",\n setting: \"\",\n tag: \"Tags allow you to manage your licenses and customers on the dashboard.\",\n \"team-member\": \"Team members can access the account based on their roles.\",\n user: \"A user refers to your customer whom you want to license your product.\",\n \"sending-domain\":\n \"Allows Cryptlex to send emails on your behalf using your From Email address\",\n \"admin-role\": \"Roles that have type admin\",\n \"user-group\": \"Groups of users that you can assign licenses to.\",\n reseller:\n \"Resellers allow you to delegate user management to third parties or partners\",\n \"oidc-configuration\": \"\",\n \"organization-claim\": \"\",\n \"reseller-claim\": \"\",\n};\n\nconst RESOURCE_DISPLAY_NAMES: Record<string, string> = {\n id: \"ID\",\n createdAt: \"Creation Date\",\n scopes: \"Permissions\",\n updatedAt: \"Last Updated\",\n expiresAt: \"Expiration Date\",\n lastSeenAt: \"Last Seen\",\n os: \"OS\",\n osVersion: \"OS Version\",\n key: \"License Key\",\n vmName: \"VM Name\",\n container: \"Container\",\n allowedIpRange: \"Allowed IP Range\",\n allowedIpRanges: \"Allowed IP Ranges\",\n allowedIpAddresses: \"Allowed IP Addresses\",\n disallowedIpAddresses: \"Disallowed IP Addresses\",\n allowVmActivation: \"Allow VM Activation\",\n disableGeoLocation: \"Disable Geolocation\",\n \"user.id\": \"User ID\",\n userId: \"User\",\n productId: \"Product\",\n downloads: \"Total Downloads\",\n claims: \"Permissions\",\n googleSsoEnabled: \"Google Login Enabled\",\n lastAttemptedAt: \"Last Attempt Date\",\n url: \"URL\",\n \"trialPolicy.name\": \"Trial Policy Name\",\n \"licensePolicy.name\": \"License Template Name\",\n licensePolicy: \"License Template\",\n eventLog: \"Audit Log\",\n cc: \"CC Recepients\",\n bcc: \"BCC Recepients\",\n ipAddress: \"IP Address\",\n resellerId: \"Reseller\",\n productVersionId: \"Product Version\",\n releaseId: \"Release\",\n maintenancePolicyId: \"Maintenance Policy\",\n webhookId: \"Webhook\",\n automatedEmailId: \"Automated Email\",\n \"location.countryName\": \"Country\",\n \"location.ipAddress\": \"IP Address\",\n \"location.countryCode\": \"Country\",\n organizationId: \"Organization\",\n \"address.country\": \"Country\",\n \"address.addressLine1\": \"Address Line 1\",\n \"address.addressLine2\": \"Address Line 2\",\n responseStatusCode: \"HTTP Status Code\",\n resourceId: \"Resource ID\",\n Sso: \"SAML SSO 2.0\",\n \"reseller.name\": \"Reseller\",\n sendingDomain: \"Email Sending Domain\",\n};\n\nfunction getResourceDisplayName(\n resourceName: string,\n portal: CtxPortals,\n) {\n if (portal !== \"admin-portal\" && resourceName in OTHER_PORTALS_DISPLAY_NAME) {\n return OTHER_PORTALS_DISPLAY_NAME[resourceName];\n } else if (resourceName in RESOURCE_DISPLAY_NAMES) {\n return RESOURCE_DISPLAY_NAMES[resourceName];\n } else {\n return convertCamelCaseToTitleCase(resourceName);\n }\n}\n\nconst ProjectContext = createContext<CtxPortals>('admin-portal');\n\nexport function ProjectProvider({ projectName, children }: { projectName: CtxPortals; children: React.ReactNode; }) {\n return (\n <ProjectContext.Provider value={projectName}>\n {children}\n </ProjectContext.Provider>\n );\n}\n\nexport function useProjectName(): CtxPortals {\n return use(ProjectContext);\n}\n\nexport function useResourceFormatter(): (resourceName: string) => string {\n const portal = useProjectName();\n return (resourceName: string) => getResourceDisplayName(resourceName, portal);\n}"],"names":["OTHER_PORTALS_DISPLAY_NAME","RESOURCE_NAMES","RESOURCE_DEFINITIONS","RESOURCE_DISPLAY_NAMES","getResourceDisplayName","resourceName","portal","convertCamelCaseToTitleCase","ProjectContext","createContext","ProjectProvider","projectName","children","useProjectName","use","useResourceFormatter"],"mappings":"kKAIA,MAAMA,EAAqD,CACvD,sBAAuB,SAC3B,EAGaC,EAAiB,CAC1B,eACA,UACA,aACA,iBACA,aACA,YACA,kBACA,4BACA,OACA,eACA,UACA,UACA,mBACA,qBACA,eACA,OACA,UACA,kBACA,UACA,UACA,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wB,UACxB,eAAgB,eAChB,kBAAmB,UACnB,uBAAwB,iBACxB,uBAAwB,iBACxB,mBAAoB,mBACpB,WAAY,cACZ,IAAK,eACL,gBAAiB,WACjB,cAAe,sBACnB,EAEA,SAASC,EACLC,EACAC,EACF,CACE,OAAIA,IAAW,gBAAkBD,KAAgBL,EACtCA,EAA2BK,CAAY,EACvCA,KAAgBF,EAChBA,EAAuBE,CAAY,EAEnCE,EAA4BF,CAAY,CAEvD,CAEA,MAAMG,EAAiBC,EAA0B,cAAc,EAExD,SAASC,EAAgB,CAAE,YAAAC,EAAa,SAAAC,GAAqE,CAChH,SACKJ,EAAe,SAAf,CAAwB,MAAOG,EAC3B,SAAAC,EACL,CAER,CAEO,SAASC,GAA6B,CACzC,OAAOC,EAAIN,CAAc,CAC7B,CAEO,SAASO,GAAyD,CACrE,MAAMT,EAASO,EAAA,EACf,OAAQR,GAAyBD,EAAuBC,EAAcC,CAAM,CAChF"}
@@ -0,0 +1 @@
1
+ export declare function useIsMobile(): boolean;
@@ -0,0 +1,2 @@
1
+ import{useState as s,useEffect as r}from"react";const e=768;function c(){const[o,n]=s(void 0);return r(()=>{const t=window.matchMedia(`(max-width: ${e-1}px)`),i=()=>{n(window.innerWidth<e)};return t.addEventListener("change",i),n(window.innerWidth<e),()=>t.removeEventListener("change",i)},[]),!!o}export{c as useIsMobile};
2
+ //# sourceMappingURL=use-mobile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-mobile.js","sources":["../../lib/utils/use-mobile.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile() {\n\tconst [isMobile, setIsMobile] = useState<boolean | undefined>(\n\t\tundefined,\n\t);\n\n\tuseEffect(() => {\n\t\tconst mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n\t\tconst onChange = () => {\n\t\t\tsetIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n\t\t};\n\t\tmql.addEventListener(\"change\", onChange);\n\t\tsetIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n\t\treturn () => mql.removeEventListener(\"change\", onChange);\n\t}, []);\n\n\treturn !!isMobile;\n}\n"],"names":["MOBILE_BREAKPOINT","useIsMobile","isMobile","setIsMobile","useState","useEffect","mql","onChange"],"mappings":"gDAEA,MAAMA,EAAoB,IAEnB,SAASC,GAAc,CAC7B,KAAM,CAACC,EAAUC,CAAW,EAAIC,EAC/B,MAAA,EAGD,OAAAC,EAAU,IAAM,CACf,MAAMC,EAAM,OAAO,WAAW,eAAeN,EAAoB,CAAC,KAAK,EACjEO,EAAW,IAAM,CACtBJ,EAAY,OAAO,WAAaH,CAAiB,CAClD,EACA,OAAAM,EAAI,iBAAiB,SAAUC,CAAQ,EACvCJ,EAAY,OAAO,WAAaH,CAAiB,EAC1C,IAAMM,EAAI,oBAAoB,SAAUC,CAAQ,CACxD,EAAG,CAAA,CAAE,EAEE,CAAC,CAACL,CACV"}
package/package.json CHANGED
@@ -1,17 +1,16 @@
1
1
  {
2
2
  "name": "@cryptlex/web-components",
3
- "version": "5.1.1",
3
+ "version": "5.3.0-alpha",
4
4
  "description": "React component library for Cryptlex web applications",
5
5
  "author": "Cryptlex",
6
6
  "type": "module",
7
7
  "private": false,
8
- "main": "./dist/index.es.js",
9
- "module": "./dist/index.es.js",
10
- "types": "./dist/index.es.d.ts",
11
8
  "exports": {
12
- ".": {
13
- "types": "./dist/index.es.d.ts",
14
- "import": "./dist/index.es.js"
9
+ "./components/*": {
10
+ "import": "./dist/components/*"
11
+ },
12
+ "./utils/*": {
13
+ "import": "./dist/utils/*"
15
14
  },
16
15
  "./index.css": "./lib/index.css",
17
16
  "./tokens.css": "./lib/tokens.css",
@@ -21,12 +20,11 @@
21
20
  },
22
21
  "files": [
23
22
  "dist",
24
- "lib/index.css",
25
- "lib/theme.css",
26
- "lib/base.css",
27
- "lib/utilities.css",
28
- "lib/tokens.css",
29
- "lib/index.css"
23
+ "./lib/index.css",
24
+ "./lib/tokens.css",
25
+ "./lib/theme.css",
26
+ "./lib/base.css",
27
+ "./lib/utilities.css"
30
28
  ],
31
29
  "repository": {
32
30
  "type": "git",
@@ -39,10 +37,7 @@
39
37
  "design-system",
40
38
  "cryptlex"
41
39
  ],
42
- "sideEffects": [
43
- "**/*.css",
44
- "**/*.tsx"
45
- ],
40
+ "sideEffects": false,
46
41
  "publishConfig": {
47
42
  "access": "public"
48
43
  },
@@ -51,6 +46,7 @@
51
46
  "@dnd-kit/core": "6.3.1",
52
47
  "@dnd-kit/sortable": "10.0.0",
53
48
  "@dnd-kit/utilities": "3.2.2",
49
+ "@internationalized/date": "3.8.2",
54
50
  "@tanstack/react-form": "1.6.3",
55
51
  "@tanstack/react-query": "5.62.3",
56
52
  "@tanstack/react-table": "8.20.5",
@@ -62,32 +58,33 @@
62
58
  "lucide-react": "0.453.0",
63
59
  "openapi-fetch": "0.14.0",
64
60
  "react": "^19.1.0",
65
- "react-dom": "^19.1.0",
66
61
  "react-aria-components": "1.11.0",
67
- "@internationalized/date": "^3.8.2",
62
+ "react-dom": "^19.1.0",
68
63
  "recharts": "2.15.3",
69
64
  "sonner": "1.7.0",
70
65
  "tailwindcss": "^4.0.6",
71
66
  "tw-animate-css": "1.3.0"
72
67
  },
73
68
  "devDependencies": {
74
- "@storybook/addon-docs": "^9.0.16",
75
- "@storybook/addon-links": "^9.0.16",
76
- "@storybook/addon-onboarding": "^9.0.16",
77
- "@storybook/react-vite": "^9.0.16",
78
- "@tailwindcss/vite": "^4.0.6",
79
- "@types/lodash-es": "^4.17.12",
69
+ "@rollup/plugin-node-resolve": "16.0.1",
70
+ "@storybook/addon-docs": "9.0.18",
71
+ "@storybook/addon-links": "9.0.18",
72
+ "@storybook/addon-onboarding": "9.0.18",
73
+ "@storybook/react-vite": "9.0.18",
74
+ "@tailwindcss/vite": "^4.1.11",
75
+ "@types/lodash-es": "4.17.12",
80
76
  "@types/node": "^22.7.8",
81
- "@types/react": "19.1.0",
82
- "@types/react-dom": "19.1.0",
83
- "@vitejs/plugin-react": "^4.3.2",
77
+ "@types/react": "^19.1.0",
78
+ "@types/react-dom": "^19.1.0",
79
+ "@vitejs/plugin-react": "4.7.0",
84
80
  "rollup-preserve-directives": "1.1.3",
85
- "sass": "^1.80.6",
86
- "storybook": "^9.0.16",
87
- "typescript": "^5.5.3",
88
- "typescript-eslint": "^8.7.0",
89
- "vite": "^5.4.8",
90
- "vite-plugin-dts": "^4.2.4",
81
+ "sass": "1.80.6",
82
+ "storybook": "9.0.18",
83
+ "typescript": "5.8.3",
84
+ "typescript-eslint": "8.38.0",
85
+ "vite": "7.0.6",
86
+ "vite-plugin-dts": "4.5.4",
87
+ "vite-tsconfig-paths": "5.1.4",
91
88
  "zod": "3.25.20"
92
89
  },
93
90
  "scripts": {
@@ -95,6 +92,7 @@
95
92
  "lint": "eslint .",
96
93
  "storybook": "storybook dev -p 6006 --no-open",
97
94
  "build:storybook": "storybook build",
98
- "build:tokens": "sass --no-source-map ./lib/tokens.scss ./lib/tokens.css"
95
+ "build:tokens": "sass --no-source-map ./lib/tokens.scss ./lib/tokens.css",
96
+ "build-storybook": "storybook build"
99
97
  }
100
98
  }
@@ -1,132 +0,0 @@
1
- import { jsx as e, jsxs as s, Fragment as m } from "react/jsx-runtime";
2
- import { useDataTable as T } from "./data-table.es.js";
3
- import { SelectItem as w } from "../inputs/select.es.js";
4
- import { EasyMenu as S, MenuItem as x } from "../ui/menu.es.js";
5
- import { useResourceFormatter as O } from "../../utils/resource-names.es.js";
6
- import { Filter as R, Trash as P } from "lucide-react";
7
- import { useRef as d } from "react";
8
- import { useAppForm as q } from "../../utils/form-hook.es.js";
9
- import { TfDatePicker as D } from "../inputs/date-picker.es.js";
10
- import { TfIdSearchInput as E } from "../inputs/id-search.es.js";
11
- import { cn as N } from "../../utils/primitives.es.js";
12
- import { PopoverTrigger as $, Popover as I } from "../ui/popover.es.js";
13
- import { Button as c } from "../ui/button.es.js";
14
- const X = [
15
- "eq",
16
- "ne",
17
- "cn",
18
- "nc",
19
- "sw",
20
- "ew",
21
- "in",
22
- "nin",
23
- "gt",
24
- "gte",
25
- "lt",
26
- "lte"
27
- ], _ = {
28
- eq: "equal to",
29
- ne: "not equal to",
30
- cn: "contains",
31
- nc: "does not contain",
32
- sw: "starts with",
33
- ew: "ends with",
34
- in: "includes",
35
- nin: "does not include",
36
- gt: "greater than",
37
- gte: "greater than or equal to",
38
- lt: "less than",
39
- lte: "less than or equal to"
40
- }, h = {
41
- bool: ["eq"],
42
- enum: ["in", "nin"],
43
- id: ["in", "nin"],
44
- "id-search": ["in", "nin"],
45
- string: ["eq", "ne", "cn", "nc", "sw", "ew", "in", "nin"],
46
- date: ["lt", "gt"]
47
- };
48
- function Y({ className: f, ...g }) {
49
- const { filters: F, query: y, setFilters: v, filterConfig: o } = T();
50
- d([]);
51
- const A = d(null), p = O(), a = q({
52
- defaultValues: {
53
- // TODO, initialize with filters from tableState
54
- filters: []
55
- },
56
- onSubmit: ({ value: i }) => {
57
- v(i.filters.map((t) => ({ [t.property]: { [t.operator]: [t.value] } })));
58
- }
59
- }), u = Object.keys(o).sort();
60
- return /* @__PURE__ */ e("section", { ...g, className: N("flex gap-icon items-center", f), children: /* @__PURE__ */ s($, { onOpenChange: (i) => {
61
- var t;
62
- i ? (t = A.current) == null || t.focus() : a.handleSubmit();
63
- }, children: [
64
- /* @__PURE__ */ e(c, { active: F.length > 0, isDisabled: y.isPending || u.length === 0, type: "button", size: "icon", variant: "neutral", children: /* @__PURE__ */ e(R, {}) }),
65
- /* @__PURE__ */ e(I, { className: "w-full p-icon", children: /* @__PURE__ */ e("form", { onSubmit: (i) => {
66
- i.preventDefault();
67
- }, className: "flex flex-col gap-icon max-h-table overflow-auto ", children: /* @__PURE__ */ e(a.Field, { mode: "array", name: "filters", children: (i) => /* @__PURE__ */ s(m, { children: [
68
- i.state.value.map((t, n) => /* @__PURE__ */ s("div", { className: "flex gap-icon items-center justify-normal", children: [
69
- /* @__PURE__ */ e("span", { className: "text-sm", children: p(t.property) }),
70
- /* @__PURE__ */ e(
71
- a.AppField,
72
- {
73
- name: `filters[${n}].operator`,
74
- children: (r) => /* @__PURE__ */ e(r.TfSingleSelect, { items: h[t.type].map((l) => ({ id: l, label: /* @__PURE__ */ e(m, { children: _[l] }) })), children: (l) => /* @__PURE__ */ e(w, { id: l.id, children: l.label }) })
75
- },
76
- t.id
77
- ),
78
- t.type === "bool" && /* @__PURE__ */ e(a.AppField, { name: `filters[${n}].value`, children: (r) => /* @__PURE__ */ e(r.TfCheckbox, {}) }),
79
- t.type === "date" && /* @__PURE__ */ e(a.AppField, { name: `filters[${n}].value`, children: (r) => /* @__PURE__ */ e(D, {}) }),
80
- t.type === "id" && /* @__PURE__ */ e(a.AppField, { name: `filters[${n}].value`, children: (r) => /* @__PURE__ */ e(r.TfTextField, {}) }),
81
- t.type === "string" && /* @__PURE__ */ e(a.AppField, { name: `filters[${n}].value`, children: (r) => /* @__PURE__ */ e(r.TfTextField, {}) }),
82
- t.type === "enum" && /* @__PURE__ */ e(a.AppField, { name: `filters[${n}].value`, children: (r) => /* @__PURE__ */ e(r.TfMultiSelect, { items: o[t.property].options }) }),
83
- t.type === "id-search" && /* @__PURE__ */ e(a.AppField, { name: `filters[${n}].value`, children: (r) => /* @__PURE__ */ e(E, { multiple: !0, accessor: "id", searchFn: o[t.property].search }) }),
84
- /* @__PURE__ */ e(c, { type: "button", variant: "destructive", size: "icon", onPress: () => i.removeValue(n), children: /* @__PURE__ */ e(P, {}) })
85
- ] }, t.id)),
86
- /* @__PURE__ */ s("div", { className: "flex w-full items-center justify-end gap-2 not-first:mt-icon", children: [
87
- /* @__PURE__ */ e(S, { label: "Add Filter", children: u.map((t) => /* @__PURE__ */ e(x, { onAction: () => {
88
- const n = o[t].type, r = (b) => {
89
- switch (b) {
90
- case "bool":
91
- return !0;
92
- case "string":
93
- return "";
94
- case "date":
95
- return (/* @__PURE__ */ new Date()).toISOString();
96
- case "id":
97
- return "";
98
- case "id-search":
99
- return [];
100
- case "enum":
101
- return [];
102
- }
103
- }, l = {
104
- id: `${t}-${Date.now()}`,
105
- operator: h[n][0],
106
- value: r(n),
107
- type: n,
108
- property: t
109
- };
110
- i.pushValue(l);
111
- }, className: "dropdown-item", children: p(t) }, t)) }),
112
- i.state.value.length > 0 ? /* @__PURE__ */ e(
113
- c,
114
- {
115
- type: "button",
116
- variant: "neutral",
117
- onPress: () => {
118
- i.setValue([]);
119
- },
120
- children: "Reset filters"
121
- }
122
- ) : null
123
- ] })
124
- ] }) }) }) })
125
- ] }) });
126
- }
127
- export {
128
- _ as COMPARISON_OPERATOR_LABELS,
129
- Y as DataTableFilter,
130
- X as FILTER_COMPARISON_OPERATORS
131
- };
132
- //# sourceMappingURL=data-table-filter.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-table-filter.es.js","sources":["../../../lib/components/data-table/data-table-filter.tsx"],"sourcesContent":["import { useDataTable, type OperationKeys } from \"@/components/data-table/data-table\";\nimport { type ApiFilters } from \"@/components/data-table/table-commons\";\nimport { TfDatePicker, TfIdSearchInput, type MultiSelectProps } from \"@/components/inputs\";\nimport { SelectItem } from \"@/components/inputs/select\";\nimport { Button, Popover, PopoverTrigger, } from \"@/components/ui\";\nimport { EasyMenu, MenuItem } from \"@/components/ui/menu\";\nimport { cn, useAppForm } from \"@/utils\";\nimport { useResourceFormatter } from \"@/utils/resource-names\";\nimport type { CalendarDateTime } from \"@internationalized/date\";\nimport { Filter, Trash } from \"lucide-react\";\nimport { useRef } from \"react\";\n\nexport const FILTER_COMPARISON_OPERATORS = [\n 'eq',\n 'ne',\n 'cn',\n 'nc',\n 'sw',\n 'ew',\n 'in',\n 'nin',\n 'gt',\n 'gte',\n 'lt',\n 'lte',\n] as const;\nexport type FilterComparisonOperator =\n (typeof FILTER_COMPARISON_OPERATORS)[number];\n\nexport const COMPARISON_OPERATOR_LABELS: Record<\n FilterComparisonOperator,\n string\n> = {\n eq: 'equal to',\n ne: 'not equal to',\n cn: 'contains',\n nc: 'does not contain',\n sw: 'starts with',\n ew: 'ends with',\n in: 'includes',\n nin: 'does not include',\n gt: 'greater than',\n gte: 'greater than or equal to',\n lt: 'less than',\n lte: 'less than or equal to',\n};\n\ntype BaseLocalFilter<T extends FilterType, V> = {\n id: string;\n type: T;\n property: string;\n operator: FilterComparisonOperator;\n value: V | undefined;\n displayValue?: string;\n};\ntype EnumLocalFilter = BaseLocalFilter<'enum', Set<string | number>>;\ntype IdLocalFilter = BaseLocalFilter<'id', string>;\ntype BoolLocalFilter = BaseLocalFilter<'bool', boolean>;\ntype StringLocalFilter = BaseLocalFilter<'string', string>;\ntype DateLocalFilter = BaseLocalFilter<'date', CalendarDateTime>;\ntype IdSearchLocalFilter = BaseLocalFilter<'id-search', Set<string | number>>;\n\ntype LocalFilter = EnumLocalFilter\n | IdLocalFilter\n | BoolLocalFilter\n | StringLocalFilter\n | DateLocalFilter\n | IdSearchLocalFilter;\n\nexport type FilterConfig =\n | { type: 'enum'; options: MultiSelectProps['items'] }\n | { type: 'id-search'; search: () => Promise<{ id: string; name: string }[]> }\n | { type: 'id' }\n | { type: 'bool' }\n | { type: 'string' }\n | { type: 'date' }\n\nexport type FilterType = FilterConfig['type'];\n\nconst FilterOperations: Record<FilterType, FilterComparisonOperator[]> = {\n 'bool': ['eq'],\n 'enum': ['in', 'nin'],\n 'id': ['in', 'nin'],\n 'id-search': ['in', 'nin'],\n 'string': ['eq', 'ne', 'cn', 'nc', 'sw', 'ew', 'in', 'nin'],\n 'date': ['lt', 'gt'],\n}\n\nexport type FiltersConfig<TOperation extends OperationKeys> = Required<Record<keyof ApiFilters<TOperation>, FilterConfig>>\n\nexport function DataTableFilter({ className, ...props }: React.ComponentProps<'section'>) {\n const { filters, query, setFilters, filterConfig } = useDataTable();\n const localFilterRefs = useRef([]);\n const addFilterButtonRef = useRef<HTMLButtonElement>(null);\n\n const resourceFormatter = useResourceFormatter();\n\n const DEFAULT_VALUES: { filters: LocalFilter[] } = {\n // TODO, initialize with filters from tableState\n filters: []\n };\n const form = useAppForm({\n defaultValues: DEFAULT_VALUES,\n onSubmit: ({ value }) => {\n // TODO, instead of generic transformation, use type based tranform()\n setFilters(value.filters.map(lf => { return { [lf.property]: { [lf.operator]: [lf.value] } } }))\n }\n })\n\n // More reason to hate TS https://github.com/Microsoft/TypeScript/issues/12870\n const filterKeys = Object.keys(filterConfig).sort();\n\n return (\n <section {...props} className={cn(\"flex gap-icon items-center\", className)}>\n <PopoverTrigger onOpenChange={(o) => {\n // Set filters when the popover closes\n if (!o) {\n form.handleSubmit();\n } else {\n addFilterButtonRef.current?.focus();\n }\n }}>\n <Button active={filters.length > 0} isDisabled={query.isPending || filterKeys.length === 0} type=\"button\" size={'icon'} variant={'neutral'}><Filter /></Button>\n {/* TODO, icon maps with dynamic imports? */}\n {/* TODO open popover with form for property specific filter */}\n {/* TODO, icons here??? */}\n <Popover className=\"w-full p-icon\">\n {/* const h3Styles = \"body mb-icon text-muted-foreground\"; */}\n {/* <h3 className={h3Styles}>{isFiltersActive ? \"Active filters\" : \"Add filters\"}</h3> */}\n <form onSubmit={(e) => { e.preventDefault(); }} className=\"flex flex-col gap-icon max-h-table overflow-auto \">\n <form.Field mode=\"array\" name={\"filters\"}>\n {\n (field) => {\n return <>\n {field.state.value.map((lf, i) => {\n return (\n <div key={lf.id} className=\"flex gap-icon items-center justify-normal\">\n <span className=\"text-sm\">{resourceFormatter(lf.property)}</span>\n <form.AppField\n key={lf.id}\n name={`filters[${i}].operator`}\n >\n {(sf) => (<sf.TfSingleSelect items={FilterOperations[lf.type].map(op => ({ id: op, label: <>{COMPARISON_OPERATOR_LABELS[op]}</> }))}>{(operator) => <SelectItem id={operator.id}>{operator.label}</SelectItem>}</sf.TfSingleSelect>)}\n </form.AppField>\n\n {lf.type === 'bool' && <form.AppField name={`filters[${i}].value`}>{(sf) => (<sf.TfCheckbox />)}</form.AppField>}\n {lf.type === 'date' && <form.AppField name={`filters[${i}].value`}>{(_) => (<TfDatePicker />)}</form.AppField>}\n {lf.type === 'id' && <form.AppField name={`filters[${i}].value`}>{(sf) => (<sf.TfTextField />)}</form.AppField>}\n {lf.type === 'string' && <form.AppField name={`filters[${i}].value`}>{(sf) => (<sf.TfTextField />)}</form.AppField>}\n {lf.type === 'enum' && <form.AppField name={`filters[${i}].value`}>{(sf) => (<sf.TfMultiSelect items={filterConfig[lf.property].options} />)}</form.AppField>}\n {lf.type === 'id-search' && <form.AppField name={`filters[${i}].value`}>{(_) => (<TfIdSearchInput multiple accessor=\"id\" searchFn={filterConfig[lf.property].search} />)}</form.AppField>}\n\n <Button type=\"button\" variant=\"destructive\" size=\"icon\" onPress={() => field.removeValue(i)}><Trash /></Button>\n </div>\n )\n })}\n <div className=\"flex w-full items-center justify-end gap-2 not-first:mt-icon\">\n <EasyMenu label=\"Add Filter\">\n {filterKeys.map(k => <MenuItem key={k} onAction={() => {\n const type = filterConfig[k].type as FilterType;\n\n const defaultValue = (t: FilterType) => {\n // TODO, ensure exhaustive???\n switch (t) {\n case 'bool':\n return true;\n case 'string':\n return '';\n case 'date':\n return new Date().toISOString();\n case 'id':\n return '';\n case 'id-search':\n return [] as string[];\n case 'enum':\n return [] as string[];\n }\n }\n\n const newFilter: LocalFilter = {\n id: `${k}-${Date.now()}`,\n operator: FilterOperations[type][0],\n value: defaultValue(type),\n type: type,\n property: k,\n };\n\n field.pushValue(newFilter);\n // TODO Focus to ref\n\n }} className=\"dropdown-item\">{resourceFormatter(k)}</MenuItem>)}\n </EasyMenu>\n {field.state.value.length > 0 ? (\n <Button\n type=\"button\"\n variant=\"neutral\"\n onPress={() => { field.setValue([]) }}\n >\n Reset filters\n </Button>\n ) : null}\n </div>\n </>\n }\n }\n </form.Field >\n </form>\n </Popover>\n </PopoverTrigger>\n </section>\n );\n};"],"names":["FILTER_COMPARISON_OPERATORS","COMPARISON_OPERATOR_LABELS","FilterOperations","DataTableFilter","className","props","filters","query","setFilters","filterConfig","useDataTable","useRef","addFilterButtonRef","resourceFormatter","useResourceFormatter","form","useAppForm","value","lf","filterKeys","jsx","cn","jsxs","PopoverTrigger","o","_a","Button","Filter","Popover","e","field","Fragment","i","sf","op","operator","SelectItem","_","TfDatePicker","TfIdSearchInput","Trash","EasyMenu","k","MenuItem","type","defaultValue","t","newFilter"],"mappings":";;;;;;;;;;;;;AAYO,MAAMA,IAA8B;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAIaC,IAGT;AAAA,EACA,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,KAAK;AACT,GAkCMC,IAAmE;AAAA,EACrE,MAAQ,CAAC,IAAI;AAAA,EACb,MAAQ,CAAC,MAAM,KAAK;AAAA,EACpB,IAAM,CAAC,MAAM,KAAK;AAAA,EAClB,aAAa,CAAC,MAAM,KAAK;AAAA,EACzB,QAAU,CAAC,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,KAAK;AAAA,EAC1D,MAAQ,CAAC,MAAM,IAAI;AACvB;AAIO,SAASC,EAAgB,EAAE,WAAAC,GAAW,GAAGC,KAA0C;AACtF,QAAM,EAAE,SAAAC,GAAS,OAAAC,GAAO,YAAAC,GAAY,cAAAC,EAAA,IAAiBC,EAAA;AAC7B,EAAAC,EAAO,CAAA,CAAE;AACjC,QAAMC,IAAqBD,EAA0B,IAAI,GAEnDE,IAAoBC,EAAA,GAMpBC,IAAOC,EAAW;AAAA,IACpB,eAL+C;AAAA;AAAA,MAE/C,SAAS,CAAA;AAAA,IAAC;AAAA,IAIV,UAAU,CAAC,EAAE,OAAAC,QAAY;AAErB,MAAAT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