@konstructio/ui 0.1.2-alpha.4 → 0.1.2-alpha.41

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 (179) hide show
  1. package/dist/{Combination-VYaRRJBZ.js → Combination-BtmnusWq.js} +141 -138
  2. package/dist/DatePicker.css +1 -1
  3. package/dist/Modal-CtAG97Ts.js +99 -0
  4. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  5. package/dist/chevron-down-DgT-uSF9.js +5 -0
  6. package/dist/chevron-left-C4LEg1fH.js +7 -0
  7. package/dist/chevron-up-CRyLc5Ml.js +54 -0
  8. package/dist/chevron-up-DrQr2Fwd.js +5 -0
  9. package/dist/components/Alert/Alert.js +2 -2
  10. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  11. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  12. package/dist/components/AlertDialog/components/index.js +1 -1
  13. package/dist/components/Badge/Badge.js +42 -44
  14. package/dist/components/Badge/Badge.variants.js +8 -6
  15. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  16. package/dist/components/Breadcrumb/components/Item/Item.js +24 -23
  17. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  18. package/dist/components/Button/Button.js +1 -1
  19. package/dist/components/Button/Button.variants.js +1 -1
  20. package/dist/components/Card/Card.variants.js +5 -9
  21. package/dist/components/Checkbox/Checkbox.js +6 -6
  22. package/dist/components/Command/Command.js +2 -2
  23. package/dist/components/Command/components/Command.js +1 -1
  24. package/dist/components/Command/components/CommandEmpty.js +1 -1
  25. package/dist/components/Command/components/CommandGroup.js +1 -1
  26. package/dist/components/Command/components/CommandInput.js +2 -2
  27. package/dist/components/Command/components/CommandItem.js +1 -1
  28. package/dist/components/Command/components/CommandList.js +1 -1
  29. package/dist/components/Command/components/CommandSeparator.js +1 -1
  30. package/dist/components/Command/components/DialogContent.js +2 -2
  31. package/dist/components/Command/components/DialogOverlay.js +1 -1
  32. package/dist/components/Datepicker/DatePicker.js +1243 -1191
  33. package/dist/components/Divider/Divider.variants.js +1 -1
  34. package/dist/components/Dropdown/Dropdown.js +37 -31
  35. package/dist/components/Dropdown/Dropdown.variants.js +9 -4
  36. package/dist/components/Dropdown/components/List/List.js +128 -59
  37. package/dist/components/Dropdown/components/ListItem/ListItem.js +90 -39
  38. package/dist/components/Dropdown/components/Wrapper.js +141 -134
  39. package/dist/components/Dropdown/constants/index.js +4 -0
  40. package/dist/components/Dropdown/constants/pagination.js +4 -0
  41. package/dist/components/Dropdown/contexts/dropdown.context.js +17 -0
  42. package/dist/components/Dropdown/contexts/dropdown.provider.js +48 -20
  43. package/dist/components/Dropdown/hooks/useDropdown.js +74 -29
  44. package/dist/components/Dropdown/hooks/useNavigationList.js +27 -39
  45. package/dist/components/DropdownButton/DropdownButton.js +1 -1
  46. package/dist/components/Filter/Filter.variants.js +2 -2
  47. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
  48. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
  49. package/dist/components/Input/Input.js +1 -1
  50. package/dist/components/Input/Input.variants.js +2 -1
  51. package/dist/components/Loading/Loading.js +1 -7
  52. package/dist/components/Modal/Modal.js +2 -2
  53. package/dist/components/Modal/components/Body/Body.js +1 -1
  54. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  55. package/dist/components/Modal/components/Header/Header.js +1 -1
  56. package/dist/components/Modal/components/Wrapper/Wrapper.js +4 -4
  57. package/dist/components/Modal/components/index.js +1 -1
  58. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +34 -0
  59. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +34 -0
  60. package/dist/components/MultiSelectDropdown/components/Item/Item.js +38 -0
  61. package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +38 -0
  62. package/dist/components/MultiSelectDropdown/components/List/List.js +37 -0
  63. package/dist/components/MultiSelectDropdown/components/List/List.variants.js +23 -0
  64. package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +105 -0
  65. package/dist/components/MultiSelectDropdown/components/index.js +8 -0
  66. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +21 -0
  67. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.hook.js +13 -0
  68. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +138 -0
  69. package/dist/components/MultiSelectDropdown/contexts/index.js +6 -0
  70. package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +32 -0
  71. package/dist/components/NumberInput/NumberInput.js +2 -2
  72. package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
  73. package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +46 -0
  74. package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +27 -0
  75. package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +629 -0
  76. package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +36 -0
  77. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
  78. package/dist/components/PhoneNumberInput/components/Wrapper.js +625 -0
  79. package/dist/components/PhoneNumberInput/components/index.js +6 -0
  80. package/dist/components/PhoneNumberInput/contexts/index.js +8 -0
  81. package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +28 -0
  82. package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +13 -0
  83. package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +6144 -0
  84. package/dist/components/PhoneNumberInput/utils/index.js +11 -0
  85. package/dist/components/PieChart/PieChart.js +647 -664
  86. package/dist/components/RadioCard/RadioCard.variants.js +1 -6
  87. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  88. package/dist/components/Range/Range.js +1 -1
  89. package/dist/components/Sidebar/Sidebar.variants.js +2 -2
  90. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +29 -28
  91. package/dist/components/Slider/Slider.js +1 -1
  92. package/dist/components/Switch/Switch.js +8 -8
  93. package/dist/components/Switch/Switch.variants.js +4 -4
  94. package/dist/components/Tabs/Tabs.js +1 -1
  95. package/dist/components/Tabs/Tabs.variants.js +1 -1
  96. package/dist/components/Tabs/components/Content.js +1 -1
  97. package/dist/components/Tabs/components/List.js +1 -1
  98. package/dist/components/Tabs/components/Trigger.js +1 -1
  99. package/dist/components/Tag/Tag.js +1 -1
  100. package/dist/components/Tag/Tag.variants.js +1 -0
  101. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +49 -98
  102. package/dist/components/TimePicker/TimePicker.variants.js +2 -2
  103. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +2 -2
  104. package/dist/components/Toast/Toast.js +283 -255
  105. package/dist/components/Toast/Toast.variants.js +37 -24
  106. package/dist/components/Tooltip/Tooltip.js +15 -14
  107. package/dist/components/Tooltip/Tooltip.variants.js +5 -4
  108. package/dist/components/Typography/Typography.variants.js +18 -23
  109. package/dist/components/VirtualizedTable/VirtualizedTable.js +121 -0
  110. package/dist/components/VirtualizedTable/VirtualizedTable.variants.js +5 -0
  111. package/dist/components/VirtualizedTable/assets/chevron-down.js +25 -0
  112. package/dist/components/VirtualizedTable/assets/chevron-up.js +25 -0
  113. package/dist/components/VirtualizedTable/assets/index.js +6 -0
  114. package/dist/components/VirtualizedTable/components/Actions/Actions.js +72 -0
  115. package/dist/components/VirtualizedTable/components/Body/Body.js +51 -0
  116. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +165 -0
  117. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +34 -0
  118. package/dist/components/VirtualizedTable/components/Filter/Filter.js +93 -0
  119. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +48 -0
  120. package/dist/components/VirtualizedTable/components/Header/Header.js +84 -0
  121. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +53 -0
  122. package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +67 -0
  123. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +34 -0
  124. package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
  125. package/dist/components/VirtualizedTable/components/index.js +16 -0
  126. package/dist/components/VirtualizedTable/constants/index.js +5 -0
  127. package/dist/components/VirtualizedTable/constants/pagination.js +5 -0
  128. package/dist/components/VirtualizedTable/contexts/index.js +8 -0
  129. package/dist/components/VirtualizedTable/contexts/table.context.js +32 -0
  130. package/dist/components/VirtualizedTable/contexts/table.hook.js +11 -0
  131. package/dist/components/VirtualizedTable/contexts/table.provider.js +85 -0
  132. package/dist/components/index.js +88 -80
  133. package/dist/contexts/theme.provider.js +0 -1
  134. package/dist/{createLucideIcon-DbC6TvM5.js → createLucideIcon-D4r5Phnh.js} +0 -24
  135. package/dist/debounce-BFejQm9P.js +200 -0
  136. package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
  137. package/dist/{index-h-Ul0anl.js → index--V_ZsiQe.js} +1 -22
  138. package/dist/index-2hB40Iuc.js +1873 -0
  139. package/dist/index-BZPx6jYI.js +8 -0
  140. package/dist/{index-bwWKd82e.js → index-BbQkJE5L.js} +1 -1
  141. package/dist/index-BtQfgaSF.js +60 -0
  142. package/dist/index-C3tHPg8y.js +662 -0
  143. package/dist/index-C65LtGuU.js +137 -0
  144. package/dist/index-CIAmiWcw.js +200 -0
  145. package/dist/index-CSFe9uC5.js +14 -0
  146. package/dist/index-CSWGJT-v.js +1722 -0
  147. package/dist/{index-D3xzCzcO.js → index-CdwPV0FE.js} +4 -4
  148. package/dist/index-CigKKiZS.js +91 -0
  149. package/dist/{index-BAraV3ai.js → index-DH2Fnov1.js} +11 -12
  150. package/dist/index-DLcqcWxM.js +29 -0
  151. package/dist/index-Dbt2vBmS.js +136 -0
  152. package/dist/{index-DB2XhXHn.js → index-DpW9ExsS.js} +7 -7
  153. package/dist/index-DrWQH0QF.js +55 -0
  154. package/dist/index-Ds6U2x4Z.js +479 -0
  155. package/dist/{index-C1g_chDT.js → index-mPY_8Y5v.js} +2 -2
  156. package/dist/index-ohdbKsws.js +27 -0
  157. package/dist/index.d.ts +232 -23
  158. package/dist/index.js +112 -102
  159. package/dist/libphonenumber-_7ZyKWA7.js +11549 -0
  160. package/dist/loader-juvMSJ9L.js +5 -0
  161. package/dist/package.json +48 -34
  162. package/dist/styles.css +1 -1
  163. package/dist/ui/civo-theme.css +191 -167
  164. package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
  165. package/dist/utils/index.js +534 -501
  166. package/dist/{x-BPcqkRZd.js → x-DPU9OdYH.js} +1 -1
  167. package/package.json +48 -34
  168. package/dist/Modal-V67Uz78z.js +0 -98
  169. package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
  170. package/dist/chevron-down-BLZPftpV.js +0 -11
  171. package/dist/index-BXuxPoz7.js +0 -435
  172. package/dist/index-BfXxHr_2.js +0 -125
  173. package/dist/index-C9T9HQaa.js +0 -423
  174. package/dist/index-CZnD2QxM.js +0 -32
  175. package/dist/index-CrBonFvu.js +0 -144
  176. package/dist/index-Cvx4lqTq.js +0 -47
  177. package/dist/index-DQH6odE9.js +0 -82
  178. package/dist/index-Oq5GlCHP.js +0 -131
  179. package/dist/index-iXyXtdgP.js +0 -31
@@ -1,5 +1,5 @@
1
1
  import l, { forwardRef as c } from "react";
2
- import { P as a } from "./index-h-Ul0anl.js";
2
+ import { P as a } from "./index--V_ZsiQe.js";
3
3
  function f() {
4
4
  return f = Object.assign || function(e) {
5
5
  for (var o = 1; o < arguments.length; o++) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@konstructio/ui",
3
3
  "description": "A set of reusable and customizable React components built for konstruct.io",
4
4
  "private": false,
5
- "version": "0.1.2-alpha.4",
5
+ "version": "0.1.2-alpha.41",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",
@@ -59,26 +59,34 @@
59
59
  "@radix-ui/react-checkbox": "^1.3.3",
60
60
  "@radix-ui/react-dialog": "^1.1.15",
61
61
  "@radix-ui/react-slider": "^1.3.6",
62
- "@radix-ui/react-slot": "^1.2.3",
62
+ "@radix-ui/react-slot": "^1.2.4",
63
63
  "@radix-ui/react-switch": "^1.2.6",
64
64
  "@radix-ui/react-tabs": "^1.1.13",
65
65
  "@radix-ui/react-toast": "^1.2.15",
66
- "@radix-ui/react-visually-hidden": "^1.2.3",
67
- "chart.js": "^4.5.0",
66
+ "@radix-ui/react-tooltip": "^1.2.8",
67
+ "@radix-ui/react-visually-hidden": "^1.2.4",
68
+ "@react-input/mask": "^2.0.4",
69
+ "@tanstack/react-table": "^8.21.3",
70
+ "@tanstack/react-virtual": "^3.13.12",
71
+ "chart.js": "^4.5.1",
68
72
  "class-variance-authority": "^0.7.1",
69
73
  "clsx": "^2.1.1",
70
74
  "cmdk": "^1.1.1",
71
75
  "countries-and-timezones": "^3.8.0",
76
+ "country-flag-icons": "^1.6.4",
77
+ "google-libphonenumber": "^3.2.43",
78
+ "i18n-iso-countries": "^7.14.0",
72
79
  "js-cookie": "^3.0.5",
73
- "lucide-react": "^0.544.0",
74
- "react-chartjs-2": "^5.3.0",
75
- "react-day-picker": "^9.11.0",
80
+ "lucide-react": "^0.555.0",
81
+ "react-chartjs-2": "^5.3.1",
82
+ "react-day-picker": "^9.11.3",
76
83
  "react-feather": "^2.0.10",
77
- "react-focus-lock": "^2.13.6",
78
- "react-remove-scroll": "^2.7.1",
79
- "tailwind-merge": "^3.3.1"
84
+ "react-focus-lock": "^2.13.7",
85
+ "react-remove-scroll": "^2.7.2",
86
+ "tailwind-merge": "^3.4.0"
80
87
  },
81
88
  "peerDependencies": {
89
+ "@tanstack/react-query": "^5.90",
82
90
  "@types/react": "*",
83
91
  "@types/react-dom": "*",
84
92
  "react": "^16.8 || ^17.0 || ^18.0 || ^19.0",
@@ -104,46 +112,52 @@
104
112
  },
105
113
  "@types/react-router-dom": {
106
114
  "optional": true
115
+ },
116
+ "@tanstack/react-query": {
117
+ "optional": false
107
118
  }
108
119
  },
109
120
  "devDependencies": {
110
- "@rollup/plugin-alias": "^5.1.1",
111
- "@storybook/addon-docs": "^9.1.10",
112
- "@storybook/addon-links": "^9.1.10",
113
- "@storybook/react-vite": "^9.1.10",
114
- "@tailwindcss/vite": "^4.1.13",
115
- "@testing-library/jest-dom": "^6.9.0",
121
+ "@faker-js/faker": "^10.1.0",
122
+ "@rollup/plugin-alias": "^6.0.0",
123
+ "@storybook/addon-docs": "^10.1.2",
124
+ "@storybook/addon-links": "^10.1.2",
125
+ "@storybook/react-vite": "^10.1.2",
126
+ "@tailwindcss/vite": "^4.1.17",
127
+ "@tanstack/react-query": "^5.90.11",
128
+ "@testing-library/jest-dom": "^6.9.1",
116
129
  "@testing-library/react": "^16.3.0",
117
130
  "@testing-library/user-event": "^14.6.1",
131
+ "@types/google-libphonenumber": "^7.4.30",
118
132
  "@types/jest-axe": "^3.5.9",
119
133
  "@types/js-cookie": "^3.0.6",
120
- "@types/lodash": "^4.17.20",
121
- "@types/react": "^19.1.16",
122
- "@types/react-dom": "^19.1.9",
123
- "@typescript-eslint/eslint-plugin": "^8.45.0",
124
- "@typescript-eslint/parser": "^8.45.0",
125
- "@vitejs/plugin-react": "^5.0.4",
134
+ "@types/lodash": "^4.17.21",
135
+ "@types/react": "^19.2.7",
136
+ "@types/react-dom": "^19.2.3",
137
+ "@typescript-eslint/eslint-plugin": "^8.48.0",
138
+ "@typescript-eslint/parser": "^8.48.0",
139
+ "@vitejs/plugin-react": "^5.1.1",
126
140
  "@vitest/coverage-v8": "^3.2.4",
127
- "autoprefixer": "^10.4.21",
128
- "eslint": "^9.36.0",
141
+ "autoprefixer": "^10.4.22",
142
+ "eslint": "^9.39.1",
129
143
  "eslint-plugin-react": "^7.37.5",
130
- "eslint-plugin-react-hooks": "^5.2.0",
131
- "eslint-plugin-react-refresh": "^0.4.22",
132
- "eslint-plugin-storybook": "^9.1.10",
144
+ "eslint-plugin-react-hooks": "^6.1.1",
145
+ "eslint-plugin-react-refresh": "^0.4.23",
146
+ "eslint-plugin-storybook": "^9.1.13",
133
147
  "eslint-plugin-vitest": "^0.5.4",
134
- "glob": "^11.0.3",
148
+ "glob": "^13.0.0",
135
149
  "husky": "^9.1.7",
136
150
  "jest-axe": "^10.0.0",
137
- "jsdom": "^27.0.0",
151
+ "jsdom": "^27.2.0",
138
152
  "lodash": "^4.17.21",
139
153
  "postcss": "^8.5.6",
140
- "prettier": "^3.6.2",
141
- "rimraf": "^6.0.1",
142
- "storybook": "^9.1.10",
143
- "tailwindcss": "^4.1.13",
154
+ "prettier": "^3.7.3",
155
+ "rimraf": "^6.1.2",
156
+ "storybook": "^10.1.2",
157
+ "tailwindcss": "^4.1.17",
144
158
  "ts-node": "^10.9.2",
145
159
  "typescript": "^5.9.3",
146
- "vite": "^7.1.7",
160
+ "vite": "^7.2.6",
147
161
  "vite-plugin-dts": "^4.5.4",
148
162
  "vite-plugin-lib-inject-css": "^2.2.2",
149
163
  "vite-plugin-svgr": "^4.5.0",
@@ -1,98 +0,0 @@
1
- import { Body as b } from "./components/Modal/components/Body/Body.js";
2
- import { Footer as g } from "./components/Modal/components/Footer/Footer.js";
3
- import { Header as v } from "./components/Modal/components/Header/Header.js";
4
- import { jsx as n, jsxs as p } from "react/jsx-runtime";
5
- import { Children as i, isValidElement as s, useEffect as w } from "react";
6
- import { r as x } from "./index-C9T9HQaa.js";
7
- import { R as A } from "./index-iXyXtdgP.js";
8
- import { R as E } from "./Combination-VYaRRJBZ.js";
9
- import { cn as f } from "./utils/index.js";
10
- import { buttonCloseVariants as N, modalVariants as R } from "./components/Modal/components/Wrapper/Wrapper.variants.js";
11
- import { X as k } from "./x-BPcqkRZd.js";
12
- const B = ({
13
- children: e,
14
- theme: t,
15
- className: m,
16
- buttonCloseClassName: d,
17
- onClose: a
18
- }) => {
19
- const l = i.toArray(e).find(
20
- (o) => s(o) && o.type === r.Header
21
- ), c = i.toArray(e).find(
22
- (o) => s(o) && o.type === r.Body
23
- ), y = i.toArray(e).find(
24
- (o) => s(o) && o.type === r.Footer
25
- ), u = i.toArray(e).filter(
26
- (o) => !s(o) || ![r.Header, r.Body, r.Footer].includes(
27
- o.type
28
- )
29
- );
30
- return /* @__PURE__ */ n(E, { children: /* @__PURE__ */ p(
31
- "div",
32
- {
33
- className: "fixed inset-0 grid place-content-center",
34
- "data-theme": t,
35
- children: [
36
- /* @__PURE__ */ n(
37
- "div",
38
- {
39
- className: "absolute inset-0 bg-black opacity-75 animate-in fade-in-0",
40
- onClick: a,
41
- role: "presentation"
42
- }
43
- ),
44
- /* @__PURE__ */ p(
45
- "div",
46
- {
47
- className: f(
48
- R({
49
- className: m
50
- })
51
- ),
52
- role: "dialog",
53
- "aria-modal": "true",
54
- children: [
55
- l,
56
- /* @__PURE__ */ p(
57
- "button",
58
- {
59
- className: f(
60
- N({
61
- className: d
62
- })
63
- ),
64
- onClick: a,
65
- children: [
66
- /* @__PURE__ */ n(k, {}),
67
- /* @__PURE__ */ n(A, { children: "Dismiss modal" })
68
- ]
69
- }
70
- ),
71
- c ?? u,
72
- y
73
- ]
74
- }
75
- )
76
- ]
77
- }
78
- ) });
79
- }, r = ({ isOpen: e, onClose: t, container: m, ...d }) => (w(() => {
80
- const a = new AbortController(), l = (c) => {
81
- c.code === "Escape" && t?.();
82
- };
83
- return window.addEventListener("keydown", l, {
84
- signal: a.signal
85
- }), () => {
86
- a.abort();
87
- };
88
- }, [t]), e ? x.createPortal(
89
- /* @__PURE__ */ n(B, { ...d, onClose: t }),
90
- m || document.body
91
- ) : null);
92
- r.Header = v;
93
- r.Body = b;
94
- r.Footer = g;
95
- export {
96
- r as M,
97
- B as W
98
- };
@@ -1,6 +0,0 @@
1
- function e(t) {
2
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
3
- }
4
- export {
5
- e as g
6
- };
@@ -1,11 +0,0 @@
1
- import { c as o } from "./createLucideIcon-DbC6TvM5.js";
2
- /**
3
- * @license lucide-react v0.544.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */
8
- const n = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], e = o("chevron-down", n);
9
- export {
10
- e as C
11
- };
@@ -1,435 +0,0 @@
1
- import * as i from "react";
2
- import { a as Ee, c as he, b as _, d as ye } from "./index-BfXxHr_2.js";
3
- import { u as S, c as De } from "./index-DQH6odE9.js";
4
- import { u as w } from "./index-bwWKd82e.js";
5
- import { P as be, D as Ce } from "./index-CrBonFvu.js";
6
- import { P as N } from "./index-C9T9HQaa.js";
7
- import { u as j } from "./index-0ioNhtNM.js";
8
- import { jsx as l, jsxs as q, Fragment as B } from "react/jsx-runtime";
9
- import { P as U } from "./index-C1g_chDT.js";
10
- import { R as Ae } from "./Combination-VYaRRJBZ.js";
11
- var x = "focusScope.autoFocusOnMount", L = "focusScope.autoFocusOnUnmount", V = { bubbles: !1, cancelable: !0 }, Re = "FocusScope", Q = i.forwardRef((e, o) => {
12
- const {
13
- loop: t = !1,
14
- trapped: n = !1,
15
- onMountAutoFocus: r,
16
- onUnmountAutoFocus: a,
17
- ...d
18
- } = e, [s, y] = i.useState(null), g = j(r), E = j(a), c = i.useRef(null), f = S(o, (u) => y(u)), p = i.useRef({
19
- paused: !1,
20
- pause() {
21
- this.paused = !0;
22
- },
23
- resume() {
24
- this.paused = !1;
25
- }
26
- }).current;
27
- i.useEffect(() => {
28
- if (n) {
29
- let u = function(D) {
30
- if (p.paused || !s) return;
31
- const h = D.target;
32
- s.contains(h) ? c.current = h : C(c.current, { select: !0 });
33
- }, b = function(D) {
34
- if (p.paused || !s) return;
35
- const h = D.relatedTarget;
36
- h !== null && (s.contains(h) || C(c.current, { select: !0 }));
37
- }, v = function(D) {
38
- if (document.activeElement === document.body)
39
- for (const $ of D)
40
- $.removedNodes.length > 0 && C(s);
41
- };
42
- document.addEventListener("focusin", u), document.addEventListener("focusout", b);
43
- const O = new MutationObserver(v);
44
- return s && O.observe(s, { childList: !0, subtree: !0 }), () => {
45
- document.removeEventListener("focusin", u), document.removeEventListener("focusout", b), O.disconnect();
46
- };
47
- }
48
- }, [n, s, p.paused]), i.useEffect(() => {
49
- if (s) {
50
- Z.add(p);
51
- const u = document.activeElement;
52
- if (!s.contains(u)) {
53
- const v = new CustomEvent(x, V);
54
- s.addEventListener(x, g), s.dispatchEvent(v), v.defaultPrevented || (Ne(Fe(X(s)), { select: !0 }), document.activeElement === u && C(s));
55
- }
56
- return () => {
57
- s.removeEventListener(x, g), setTimeout(() => {
58
- const v = new CustomEvent(L, V);
59
- s.addEventListener(L, E), s.dispatchEvent(v), v.defaultPrevented || C(u ?? document.body, { select: !0 }), s.removeEventListener(L, E), Z.remove(p);
60
- }, 0);
61
- };
62
- }
63
- }, [s, g, E, p]);
64
- const P = i.useCallback(
65
- (u) => {
66
- if (!t && !n || p.paused) return;
67
- const b = u.key === "Tab" && !u.altKey && !u.ctrlKey && !u.metaKey, v = document.activeElement;
68
- if (b && v) {
69
- const O = u.currentTarget, [D, h] = Oe(O);
70
- D && h ? !u.shiftKey && v === h ? (u.preventDefault(), t && C(D, { select: !0 })) : u.shiftKey && v === D && (u.preventDefault(), t && C(h, { select: !0 })) : v === O && u.preventDefault();
71
- }
72
- },
73
- [t, n, p.paused]
74
- );
75
- return /* @__PURE__ */ l(N.div, { tabIndex: -1, ...d, ref: f, onKeyDown: P });
76
- });
77
- Q.displayName = Re;
78
- function Ne(e, { select: o = !1 } = {}) {
79
- const t = document.activeElement;
80
- for (const n of e)
81
- if (C(n, { select: o }), document.activeElement !== t) return;
82
- }
83
- function Oe(e) {
84
- const o = X(e), t = Y(o, e), n = Y(o.reverse(), e);
85
- return [t, n];
86
- }
87
- function X(e) {
88
- const o = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
89
- acceptNode: (n) => {
90
- const r = n.tagName === "INPUT" && n.type === "hidden";
91
- return n.disabled || n.hidden || r ? NodeFilter.FILTER_SKIP : n.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
92
- }
93
- });
94
- for (; t.nextNode(); ) o.push(t.currentNode);
95
- return o;
96
- }
97
- function Y(e, o) {
98
- for (const t of e)
99
- if (!_e(t, { upTo: o })) return t;
100
- }
101
- function _e(e, { upTo: o }) {
102
- if (getComputedStyle(e).visibility === "hidden") return !0;
103
- for (; e; ) {
104
- if (o !== void 0 && e === o) return !1;
105
- if (getComputedStyle(e).display === "none") return !0;
106
- e = e.parentElement;
107
- }
108
- return !1;
109
- }
110
- function Pe(e) {
111
- return e instanceof HTMLInputElement && "select" in e;
112
- }
113
- function C(e, { select: o = !1 } = {}) {
114
- if (e && e.focus) {
115
- const t = document.activeElement;
116
- e.focus({ preventScroll: !0 }), e !== t && Pe(e) && o && e.select();
117
- }
118
- }
119
- var Z = Te();
120
- function Te() {
121
- let e = [];
122
- return {
123
- add(o) {
124
- const t = e[0];
125
- o !== t && t?.pause(), e = z(e, o), e.unshift(o);
126
- },
127
- remove(o) {
128
- e = z(e, o), e[0]?.resume();
129
- }
130
- };
131
- }
132
- function z(e, o) {
133
- const t = [...e], n = t.indexOf(o);
134
- return n !== -1 && t.splice(n, 1), t;
135
- }
136
- function Fe(e) {
137
- return e.filter((o) => o.tagName !== "A");
138
- }
139
- var k = 0;
140
- function Ie() {
141
- i.useEffect(() => {
142
- const e = document.querySelectorAll("[data-radix-focus-guard]");
143
- return document.body.insertAdjacentElement("afterbegin", e[0] ?? J()), document.body.insertAdjacentElement("beforeend", e[1] ?? J()), k++, () => {
144
- k === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((o) => o.remove()), k--;
145
- };
146
- }, []);
147
- }
148
- function J() {
149
- const e = document.createElement("span");
150
- return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
151
- }
152
- var Se = function(e) {
153
- if (typeof document > "u")
154
- return null;
155
- var o = Array.isArray(e) ? e[0] : e;
156
- return o.ownerDocument.body;
157
- }, R = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), F = {}, W = 0, ee = function(e) {
158
- return e && (e.host || ee(e.parentNode));
159
- }, Me = function(e, o) {
160
- return o.map(function(t) {
161
- if (e.contains(t))
162
- return t;
163
- var n = ee(t);
164
- return n && e.contains(n) ? n : (console.error("aria-hidden", t, "in not contained inside", e, ". Doing nothing"), null);
165
- }).filter(function(t) {
166
- return !!t;
167
- });
168
- }, we = function(e, o, t, n) {
169
- var r = Me(o, Array.isArray(e) ? e : [e]);
170
- F[t] || (F[t] = /* @__PURE__ */ new WeakMap());
171
- var a = F[t], d = [], s = /* @__PURE__ */ new Set(), y = new Set(r), g = function(c) {
172
- !c || s.has(c) || (s.add(c), g(c.parentNode));
173
- };
174
- r.forEach(g);
175
- var E = function(c) {
176
- !c || y.has(c) || Array.prototype.forEach.call(c.children, function(f) {
177
- if (s.has(f))
178
- E(f);
179
- else
180
- try {
181
- var p = f.getAttribute(n), P = p !== null && p !== "false", u = (R.get(f) || 0) + 1, b = (a.get(f) || 0) + 1;
182
- R.set(f, u), a.set(f, b), d.push(f), u === 1 && P && T.set(f, !0), b === 1 && f.setAttribute(t, "true"), P || f.setAttribute(n, "true");
183
- } catch (v) {
184
- console.error("aria-hidden: cannot operate on ", f, v);
185
- }
186
- });
187
- };
188
- return E(o), s.clear(), W++, function() {
189
- d.forEach(function(c) {
190
- var f = R.get(c) - 1, p = a.get(c) - 1;
191
- R.set(c, f), a.set(c, p), f || (T.has(c) || c.removeAttribute(n), T.delete(c)), p || c.removeAttribute(t);
192
- }), W--, W || (R = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), F = {});
193
- };
194
- }, xe = function(e, o, t) {
195
- t === void 0 && (t = "data-aria-hidden");
196
- var n = Array.from(Array.isArray(e) ? e : [e]), r = Se(e);
197
- return r ? (n.push.apply(n, Array.from(r.querySelectorAll("[aria-live]"))), we(n, r, t, "aria-hidden")) : function() {
198
- return null;
199
- };
200
- }, M = "Dialog", [te, et] = he(M), [Le, m] = te(M), oe = (e) => {
201
- const {
202
- __scopeDialog: o,
203
- children: t,
204
- open: n,
205
- defaultOpen: r,
206
- onOpenChange: a,
207
- modal: d = !0
208
- } = e, s = i.useRef(null), y = i.useRef(null), [g, E] = Ee({
209
- prop: n,
210
- defaultProp: r ?? !1,
211
- onChange: a,
212
- caller: M
213
- });
214
- return /* @__PURE__ */ l(
215
- Le,
216
- {
217
- scope: o,
218
- triggerRef: s,
219
- contentRef: y,
220
- contentId: w(),
221
- titleId: w(),
222
- descriptionId: w(),
223
- open: g,
224
- onOpenChange: E,
225
- onOpenToggle: i.useCallback(() => E((c) => !c), [E]),
226
- modal: d,
227
- children: t
228
- }
229
- );
230
- };
231
- oe.displayName = M;
232
- var ne = "DialogTrigger", re = i.forwardRef(
233
- (e, o) => {
234
- const { __scopeDialog: t, ...n } = e, r = m(ne, t), a = S(o, r.triggerRef);
235
- return /* @__PURE__ */ l(
236
- N.button,
237
- {
238
- type: "button",
239
- "aria-haspopup": "dialog",
240
- "aria-expanded": r.open,
241
- "aria-controls": r.contentId,
242
- "data-state": H(r.open),
243
- ...n,
244
- ref: a,
245
- onClick: _(e.onClick, r.onOpenToggle)
246
- }
247
- );
248
- }
249
- );
250
- re.displayName = ne;
251
- var K = "DialogPortal", [ke, ae] = te(K, {
252
- forceMount: void 0
253
- }), se = (e) => {
254
- const { __scopeDialog: o, forceMount: t, children: n, container: r } = e, a = m(K, o);
255
- return /* @__PURE__ */ l(ke, { scope: o, forceMount: t, children: i.Children.map(n, (d) => /* @__PURE__ */ l(U, { present: t || a.open, children: /* @__PURE__ */ l(be, { asChild: !0, container: r, children: d }) })) });
256
- };
257
- se.displayName = K;
258
- var I = "DialogOverlay", ie = i.forwardRef(
259
- (e, o) => {
260
- const t = ae(I, e.__scopeDialog), { forceMount: n = t.forceMount, ...r } = e, a = m(I, e.__scopeDialog);
261
- return a.modal ? /* @__PURE__ */ l(U, { present: n || a.open, children: /* @__PURE__ */ l(Ue, { ...r, ref: o }) }) : null;
262
- }
263
- );
264
- ie.displayName = I;
265
- var We = De("DialogOverlay.RemoveScroll"), Ue = i.forwardRef(
266
- (e, o) => {
267
- const { __scopeDialog: t, ...n } = e, r = m(I, t);
268
- return (
269
- // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
270
- // ie. when `Overlay` and `Content` are siblings
271
- /* @__PURE__ */ l(Ae, { as: We, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ l(
272
- N.div,
273
- {
274
- "data-state": H(r.open),
275
- ...n,
276
- ref: o,
277
- style: { pointerEvents: "auto", ...n.style }
278
- }
279
- ) })
280
- );
281
- }
282
- ), A = "DialogContent", ce = i.forwardRef(
283
- (e, o) => {
284
- const t = ae(A, e.__scopeDialog), { forceMount: n = t.forceMount, ...r } = e, a = m(A, e.__scopeDialog);
285
- return /* @__PURE__ */ l(U, { present: n || a.open, children: a.modal ? /* @__PURE__ */ l(Ke, { ...r, ref: o }) : /* @__PURE__ */ l(Ge, { ...r, ref: o }) });
286
- }
287
- );
288
- ce.displayName = A;
289
- var Ke = i.forwardRef(
290
- (e, o) => {
291
- const t = m(A, e.__scopeDialog), n = i.useRef(null), r = S(o, t.contentRef, n);
292
- return i.useEffect(() => {
293
- const a = n.current;
294
- if (a) return xe(a);
295
- }, []), /* @__PURE__ */ l(
296
- ue,
297
- {
298
- ...e,
299
- ref: r,
300
- trapFocus: t.open,
301
- disableOutsidePointerEvents: !0,
302
- onCloseAutoFocus: _(e.onCloseAutoFocus, (a) => {
303
- a.preventDefault(), t.triggerRef.current?.focus();
304
- }),
305
- onPointerDownOutside: _(e.onPointerDownOutside, (a) => {
306
- const d = a.detail.originalEvent, s = d.button === 0 && d.ctrlKey === !0;
307
- (d.button === 2 || s) && a.preventDefault();
308
- }),
309
- onFocusOutside: _(
310
- e.onFocusOutside,
311
- (a) => a.preventDefault()
312
- )
313
- }
314
- );
315
- }
316
- ), Ge = i.forwardRef(
317
- (e, o) => {
318
- const t = m(A, e.__scopeDialog), n = i.useRef(!1), r = i.useRef(!1);
319
- return /* @__PURE__ */ l(
320
- ue,
321
- {
322
- ...e,
323
- ref: o,
324
- trapFocus: !1,
325
- disableOutsidePointerEvents: !1,
326
- onCloseAutoFocus: (a) => {
327
- e.onCloseAutoFocus?.(a), a.defaultPrevented || (n.current || t.triggerRef.current?.focus(), a.preventDefault()), n.current = !1, r.current = !1;
328
- },
329
- onInteractOutside: (a) => {
330
- e.onInteractOutside?.(a), a.defaultPrevented || (n.current = !0, a.detail.originalEvent.type === "pointerdown" && (r.current = !0));
331
- const d = a.target;
332
- t.triggerRef.current?.contains(d) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && r.current && a.preventDefault();
333
- }
334
- }
335
- );
336
- }
337
- ), ue = i.forwardRef(
338
- (e, o) => {
339
- const { __scopeDialog: t, trapFocus: n, onOpenAutoFocus: r, onCloseAutoFocus: a, ...d } = e, s = m(A, t), y = i.useRef(null), g = S(o, y);
340
- return Ie(), /* @__PURE__ */ q(B, { children: [
341
- /* @__PURE__ */ l(
342
- Q,
343
- {
344
- asChild: !0,
345
- loop: !0,
346
- trapped: n,
347
- onMountAutoFocus: r,
348
- onUnmountAutoFocus: a,
349
- children: /* @__PURE__ */ l(
350
- Ce,
351
- {
352
- role: "dialog",
353
- id: s.contentId,
354
- "aria-describedby": s.descriptionId,
355
- "aria-labelledby": s.titleId,
356
- "data-state": H(s.open),
357
- ...d,
358
- ref: g,
359
- onDismiss: () => s.onOpenChange(!1)
360
- }
361
- )
362
- }
363
- ),
364
- /* @__PURE__ */ q(B, { children: [
365
- /* @__PURE__ */ l(He, { titleId: s.titleId }),
366
- /* @__PURE__ */ l(je, { contentRef: y, descriptionId: s.descriptionId })
367
- ] })
368
- ] });
369
- }
370
- ), G = "DialogTitle", le = i.forwardRef(
371
- (e, o) => {
372
- const { __scopeDialog: t, ...n } = e, r = m(G, t);
373
- return /* @__PURE__ */ l(N.h2, { id: r.titleId, ...n, ref: o });
374
- }
375
- );
376
- le.displayName = G;
377
- var fe = "DialogDescription", de = i.forwardRef(
378
- (e, o) => {
379
- const { __scopeDialog: t, ...n } = e, r = m(fe, t);
380
- return /* @__PURE__ */ l(N.p, { id: r.descriptionId, ...n, ref: o });
381
- }
382
- );
383
- de.displayName = fe;
384
- var pe = "DialogClose", ve = i.forwardRef(
385
- (e, o) => {
386
- const { __scopeDialog: t, ...n } = e, r = m(pe, t);
387
- return /* @__PURE__ */ l(
388
- N.button,
389
- {
390
- type: "button",
391
- ...n,
392
- ref: o,
393
- onClick: _(e.onClick, () => r.onOpenChange(!1))
394
- }
395
- );
396
- }
397
- );
398
- ve.displayName = pe;
399
- function H(e) {
400
- return e ? "open" : "closed";
401
- }
402
- var me = "DialogTitleWarning", [tt, ge] = ye(me, {
403
- contentName: A,
404
- titleName: G,
405
- docsSlug: "dialog"
406
- }), He = ({ titleId: e }) => {
407
- const o = ge(me), t = `\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users.
408
-
409
- If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
410
-
411
- For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;
412
- return i.useEffect(() => {
413
- e && (document.getElementById(e) || console.error(t));
414
- }, [t, e]), null;
415
- }, $e = "DialogDescriptionWarning", je = ({ contentRef: e, descriptionId: o }) => {
416
- const n = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ge($e).contentName}}.`;
417
- return i.useEffect(() => {
418
- const r = e.current?.getAttribute("aria-describedby");
419
- o && r && (document.getElementById(o) || console.warn(n));
420
- }, [n, e, o]), null;
421
- }, ot = oe, nt = re, rt = se, at = ie, st = ce, it = le, ct = de, ut = ve;
422
- export {
423
- st as C,
424
- le as D,
425
- at as O,
426
- rt as P,
427
- ot as R,
428
- it as T,
429
- tt as W,
430
- se as a,
431
- ut as b,
432
- et as c,
433
- ct as d,
434
- nt as e
435
- };