@kubetail/ui 0.2.0 → 0.3.0-rc1

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 (120) hide show
  1. package/dist/elements/Alert.cjs.map +1 -1
  2. package/dist/elements/Alert.d.ts +1 -1
  3. package/dist/elements/Alert.js +7 -1
  4. package/dist/elements/Alert.js.map +1 -1
  5. package/dist/elements/Alert.stories.d.ts +11 -0
  6. package/dist/elements/Button.cjs.map +1 -1
  7. package/dist/elements/Button.d.ts +6 -6
  8. package/dist/elements/Button.js +24 -21
  9. package/dist/elements/Button.js.map +1 -1
  10. package/dist/elements/Button.stories.d.ts +15 -0
  11. package/dist/elements/Calendar.cjs +1 -1
  12. package/dist/elements/Calendar.cjs.map +1 -1
  13. package/dist/elements/Calendar.d.ts +4 -5
  14. package/dist/elements/Calendar.js +21 -31
  15. package/dist/elements/Calendar.js.map +1 -1
  16. package/dist/elements/Calendar.stories.d.ts +10 -0
  17. package/dist/elements/Container.cjs.map +1 -1
  18. package/dist/elements/Container.d.ts +1 -1
  19. package/dist/elements/Container.js +1 -1
  20. package/dist/elements/Container.js.map +1 -1
  21. package/dist/elements/Container.stories.d.ts +14 -0
  22. package/dist/elements/DataTable/Body.cjs.map +1 -1
  23. package/dist/elements/DataTable/Body.d.ts +1 -1
  24. package/dist/elements/DataTable/Body.js +1 -1
  25. package/dist/elements/DataTable/Body.js.map +1 -1
  26. package/dist/elements/DataTable/DataCell.cjs.map +1 -1
  27. package/dist/elements/DataTable/DataCell.d.ts +1 -1
  28. package/dist/elements/DataTable/DataCell.js +1 -1
  29. package/dist/elements/DataTable/DataCell.js.map +1 -1
  30. package/dist/elements/DataTable/Header.cjs.map +1 -1
  31. package/dist/elements/DataTable/Header.d.ts +2 -2
  32. package/dist/elements/DataTable/Header.js +8 -5
  33. package/dist/elements/DataTable/Header.js.map +1 -1
  34. package/dist/elements/DataTable/HeaderCell.cjs.map +1 -1
  35. package/dist/elements/DataTable/HeaderCell.d.ts +1 -1
  36. package/dist/elements/DataTable/HeaderCell.js +20 -4
  37. package/dist/elements/DataTable/HeaderCell.js.map +1 -1
  38. package/dist/elements/DataTable/Row.cjs.map +1 -1
  39. package/dist/elements/DataTable/Row.d.ts +1 -1
  40. package/dist/elements/DataTable/Row.js +1 -1
  41. package/dist/elements/DataTable/Row.js.map +1 -1
  42. package/dist/elements/DataTable/index.cjs.map +1 -1
  43. package/dist/elements/DataTable/index.d.ts +9 -9
  44. package/dist/elements/DataTable/index.js +1 -1
  45. package/dist/elements/DataTable/index.js.map +1 -1
  46. package/dist/elements/DataTable/shared.cjs.map +1 -1
  47. package/dist/elements/DataTable/shared.d.ts +1 -1
  48. package/dist/elements/DataTable/shared.js.map +1 -1
  49. package/dist/elements/DataTable.stories.d.ts +11 -0
  50. package/dist/elements/DropdownMenu.cjs.map +1 -1
  51. package/dist/elements/DropdownMenu.d.ts +17 -17
  52. package/dist/elements/DropdownMenu.js +93 -9
  53. package/dist/elements/DropdownMenu.js.map +1 -1
  54. package/dist/elements/DropdownMenu.stories.d.ts +9 -0
  55. package/dist/elements/Form.cjs.map +1 -1
  56. package/dist/elements/Form.d.ts +10 -10
  57. package/dist/elements/Form.js +3 -1
  58. package/dist/elements/Form.js.map +1 -1
  59. package/dist/elements/Form.stories.d.ts +11 -0
  60. package/dist/elements/FormCheck.cjs +1 -1
  61. package/dist/elements/FormCheck.cjs.map +1 -1
  62. package/dist/elements/FormCheck.d.ts +2 -2
  63. package/dist/elements/FormCheck.js +9 -4
  64. package/dist/elements/FormCheck.js.map +1 -1
  65. package/dist/elements/FormCheck.stories.d.ts +14 -0
  66. package/dist/elements/FormControl.cjs.map +1 -1
  67. package/dist/elements/FormControl.d.ts +2 -2
  68. package/dist/elements/FormControl.js +6 -4
  69. package/dist/elements/FormControl.js.map +1 -1
  70. package/dist/elements/FormControlFeedback.cjs.map +1 -1
  71. package/dist/elements/FormControlFeedback.js +1 -1
  72. package/dist/elements/FormControlFeedback.js.map +1 -1
  73. package/dist/elements/FormFeedback.cjs.map +1 -1
  74. package/dist/elements/FormFeedback.js +1 -1
  75. package/dist/elements/FormFeedback.js.map +1 -1
  76. package/dist/elements/FormFieldset.cjs.map +1 -1
  77. package/dist/elements/FormFieldset.d.ts +1 -1
  78. package/dist/elements/FormFieldset.js +3 -1
  79. package/dist/elements/FormFieldset.js.map +1 -1
  80. package/dist/elements/FormGroup.cjs.map +1 -1
  81. package/dist/elements/FormGroup.d.ts +2 -2
  82. package/dist/elements/FormGroup.js +1 -1
  83. package/dist/elements/FormGroup.js.map +1 -1
  84. package/dist/elements/FormLabel.cjs.map +1 -1
  85. package/dist/elements/FormLabel.d.ts +1 -1
  86. package/dist/elements/FormLabel.js +6 -4
  87. package/dist/elements/FormLabel.js.map +1 -1
  88. package/dist/elements/FormOption.cjs.map +1 -1
  89. package/dist/elements/FormOption.d.ts +1 -1
  90. package/dist/elements/FormOption.js +3 -1
  91. package/dist/elements/FormOption.js.map +1 -1
  92. package/dist/elements/FormSelect.cjs.map +1 -1
  93. package/dist/elements/FormSelect.d.ts +1 -1
  94. package/dist/elements/FormSelect.js +1 -1
  95. package/dist/elements/FormSelect.js.map +1 -1
  96. package/dist/elements/Popover.cjs.map +1 -1
  97. package/dist/elements/Popover.d.ts +6 -6
  98. package/dist/elements/Popover.js +13 -1
  99. package/dist/elements/Popover.js.map +1 -1
  100. package/dist/elements/Popover.stories.d.ts +9 -0
  101. package/dist/elements/Spinner.cjs.map +1 -1
  102. package/dist/elements/Spinner.js +29 -1
  103. package/dist/elements/Spinner.js.map +1 -1
  104. package/dist/elements/Spinner.stories.d.ts +16 -0
  105. package/dist/elements/Tabs.cjs.map +1 -1
  106. package/dist/elements/Tabs.d.ts +5 -5
  107. package/dist/elements/Tabs.js +33 -3
  108. package/dist/elements/Tabs.js.map +1 -1
  109. package/dist/elements/Tabs.stories.d.ts +9 -0
  110. package/dist/index.css +106 -0
  111. package/dist/index.d.ts +1 -0
  112. package/dist/lib/utils.cjs.map +1 -1
  113. package/dist/lib/utils.d.ts +1 -1
  114. package/dist/lib/utils.js.map +1 -1
  115. package/package.json +92 -46
  116. package/dist/plugin.cjs +0 -2
  117. package/dist/plugin.cjs.map +0 -1
  118. package/dist/plugin.d.ts +0 -8
  119. package/dist/plugin.js +0 -168
  120. package/dist/plugin.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Header.js","sources":["../../../src/elements/DataTable/Header.tsx"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\n// Copyright 2024-2025 Andres Morey\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { createContext, useMemo } from 'react';\nimport { cn } from '@/lib/utils';\nconst baseCls = 'bg-chrome-50';\nconst noop = () => { };\nexport const Context = createContext({\n sortBy: null,\n onSortByChange: noop,\n});\nconst Header = ({ className, sortBy, onSortByChange, ...props }) => {\n const context = useMemo(() => ({\n sortBy: sortBy || null,\n onSortByChange: onSortByChange || noop,\n }), [sortBy, onSortByChange]);\n return (_jsx(Context.Provider, { value: context, children: _jsx(\"thead\", { ...props, className: cn(baseCls, className) }) }));\n};\nHeader.displayName = 'DataTableHeader';\nexport default Header;\n"],"names":["baseCls","noop","Context","createContext","Header","className","sortBy","onSortByChange","props","context","useMemo","_jsx","cn"],"mappings":";;;AAgBA,MAAMA,IAAU,gBACVC,IAAO,MAAM;AAAE,GACRC,IAAUC,EAAc;AAAA,EACjC,QAAQ;AAAA,EACR,gBAAgBF;AACpB,CAAC,GACKG,IAAS,CAAC,EAAE,WAAAC,GAAW,QAAAC,GAAQ,gBAAAC,GAAgB,GAAGC,QAAY;AAC1D,QAAAC,IAAUC,EAAQ,OAAO;AAAA,IAC3B,QAAQJ,KAAU;AAAA,IAClB,gBAAgBC,KAAkBN;AAAA,EAAA,IAClC,CAACK,GAAQC,CAAc,CAAC;AAC5B,SAAQI,EAAKT,EAAQ,UAAU,EAAE,OAAOO,GAAS,UAAUE,EAAK,SAAS,EAAE,GAAGH,GAAO,WAAWI,EAAGZ,GAASK,CAAS,EAAG,CAAA,GAAG;AAC/H;AACAD,EAAO,cAAc;"}
1
+ {"version":3,"file":"Header.js","sources":["../../../src/elements/DataTable/Header.tsx"],"sourcesContent":["// Copyright 2024-2025 Andres Morey\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { createContext, useMemo } from 'react';\nimport type { ComponentPropsWithoutRef } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst baseCls = 'bg-chrome-50';\nconst noop = () => {};\n\nexport type SortBy = {\n field: string;\n direction: 'ASC' | 'DESC';\n};\n\ntype OnSortByChange = (newSortBy: SortBy) => void;\n\ninterface Props extends ComponentPropsWithoutRef<'thead'> {\n sortBy?: SortBy;\n onSortByChange?: OnSortByChange;\n}\n\ntype SortByContext = {\n sortBy: SortBy | null;\n onSortByChange: OnSortByChange;\n};\n\nexport const Context = createContext<SortByContext>({\n sortBy: null,\n onSortByChange: noop,\n});\n\nconst Header = ({ className, sortBy, onSortByChange, ...props }: Props) => {\n const context = useMemo(\n () => ({\n sortBy: sortBy || null,\n onSortByChange: onSortByChange || noop,\n }),\n [sortBy, onSortByChange],\n );\n\n return (\n <Context.Provider value={context}>\n <thead {...props} className={cn(baseCls, className)} />\n </Context.Provider>\n );\n};\n\nHeader.displayName = 'DataTableHeader';\n\nexport default Header;\n"],"names":["baseCls","noop","Context","createContext","Header","className","sortBy","onSortByChange","props","context","useMemo","jsx","cn"],"mappings":";;;AAmBA,MAAMA,IAAU,gBACVC,IAAO,MAAM;AAAC,GAmBPC,IAAUC,EAA6B;AAAA,EAClD,QAAQ;AAAA,EACR,gBAAgBF;AAClB,CAAC,GAEKG,IAAS,CAAC,EAAE,WAAAC,GAAW,QAAAC,GAAQ,gBAAAC,GAAgB,GAAGC,QAAmB;AACzE,QAAMC,IAAUC;AAAA,IACd,OAAO;AAAA,MACL,QAAQJ,KAAU;AAAA,MAClB,gBAAgBC,KAAkBN;AAAA,IAAA;AAAA,IAEpC,CAACK,GAAQC,CAAc;AAAA,EAAA;AAGzB,SACE,gBAAAI,EAACT,EAAQ,UAAR,EAAiB,OAAOO,GACvB,UAAA,gBAAAE,EAAC,SAAA,EAAO,GAAGH,GAAO,WAAWI,EAAGZ,GAASK,CAAS,GAAG,GACvD;AAEJ;AAEAD,EAAO,cAAc;"}
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderCell.cjs","sources":["../../../src/elements/DataTable/HeaderCell.tsx"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n// Copyright 2024-2025 Andres Morey\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/20/solid';\nimport { useContext } from 'react';\nimport { cn } from '@/lib/utils';\nimport { Context as HeaderContext } from './Header';\nimport { Context as TableContext } from './shared';\nconst baseCN = 'text-left font-semibold text-chrome-900 select-none';\nconst sortIconCN = 'ml-2 flex-none text-chrome-400 group-hover:visible group-focus:visible';\nconst sizeCNMap = {\n xs: 'px-2 py-1.5',\n sm: 'px-2 py-1.5',\n md: 'px-3 py-3.5',\n lg: 'px-3 py-3.5',\n xl: 'px-3 py-3.5',\n};\nconst HeaderCell = ({ children, className, sortField, initialSortDirection = 'ASC', ...props }) => {\n const { size } = useContext(TableContext);\n const { sortBy, onSortByChange } = useContext(HeaderContext);\n const sortDirection = sortBy && sortBy.field === sortField\n ? sortBy.direction : initialSortDirection;\n const handleKeyPress = (event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n let newDirection = sortDirection;\n if (sortBy?.field === sortField)\n newDirection = newDirection === 'ASC' ? 'DESC' : 'ASC';\n if (sortField)\n onSortByChange({ field: sortField, direction: newDirection });\n }\n };\n return (_jsxs(\"th\", { ...props, className: cn(baseCN, sizeCNMap[size], className), children: [sortField && (_jsxs(\"span\", { className: \"group inline-flex cursor-pointer\", role: \"button\", tabIndex: 0, onClick: () => {\n let newDirection = sortDirection;\n if (sortBy?.field === sortField)\n newDirection = newDirection === 'ASC' ? 'DESC' : 'ASC';\n onSortByChange({ field: sortField, direction: newDirection });\n }, onKeyDown: handleKeyPress, children: [children, _jsx(\"span\", { className: cn(sortIconCN, sortBy?.field === sortField ? 'visible' : 'invisible'), children: sortDirection === 'ASC' ? _jsx(ChevronUpIcon, { className: \"h-5 w-5\" }) : _jsx(ChevronDownIcon, { className: \"h-5 w-5\" }) })] })), !sortField && children] }));\n};\nHeaderCell.displayName = 'DataTableHeaderCell';\nexport default HeaderCell;\n"],"names":["baseCN","sortIconCN","sizeCNMap","HeaderCell","children","className","sortField","initialSortDirection","props","size","useContext","TableContext","sortBy","onSortByChange","HeaderContext","sortDirection","handleKeyPress","event","newDirection","_jsxs","cn","_jsx","ChevronUpIcon","ChevronDownIcon"],"mappings":"iMAmBMA,EAAS,sDACTC,EAAa,yEACbC,EAAY,CACd,GAAI,cACJ,GAAI,cACJ,GAAI,cACJ,GAAI,cACJ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Cell.cjs","sources":["../../../src/elements/DataTable/HeaderCell.tsx"],"sourcesContent":["// Copyright 2024-2025 Andres Morey\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/20/solid';\nimport { useContext } from 'react';\nimport type { ComponentPropsWithoutRef } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Context as HeaderContext } from './Header';\nimport { Context as TableContext } from './shared';\nimport type { DataTableSize } from './shared';\n\nconst baseCN = 'text-left font-semibold text-chrome-900 select-none';\nconst sortIconCN = 'ml-2 flex-none text-chrome-400 group-hover:visible group-focus:visible';\n\nconst sizeCNMap: Record<DataTableSize, string> = {\n xs: 'px-2 py-1.5',\n sm: 'px-2 py-1.5',\n md: 'px-3 py-3.5',\n lg: 'px-3 py-3.5',\n xl: 'px-3 py-3.5',\n};\n\ninterface Props extends ComponentPropsWithoutRef<'th'> {\n sortField?: string;\n initialSortDirection?: 'ASC' | 'DESC';\n}\n\nconst HeaderCell = ({ children, className, sortField, initialSortDirection = 'ASC', ...props }: Props) => {\n const { size } = useContext(TableContext);\n\n const { sortBy, onSortByChange } = useContext(HeaderContext);\n\n const sortDirection = sortBy && sortBy.field === sortField ? sortBy.direction : initialSortDirection;\n\n const handleKeyPress = (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ') {\n let newDirection = sortDirection;\n if (sortBy?.field === sortField) newDirection = newDirection === 'ASC' ? 'DESC' : 'ASC';\n if (sortField) onSortByChange({ field: sortField, direction: newDirection });\n }\n };\n\n return (\n <th {...props} className={cn(baseCN, sizeCNMap[size], className)}>\n {sortField && (\n <span\n className=\"group inline-flex cursor-pointer\"\n role=\"button\"\n tabIndex={0}\n onClick={() => {\n let newDirection = sortDirection;\n if (sortBy?.field === sortField) newDirection = newDirection === 'ASC' ? 'DESC' : 'ASC';\n onSortByChange({ field: sortField, direction: newDirection });\n }}\n onKeyDown={handleKeyPress}\n >\n {children}\n <span className={cn(sortIconCN, sortBy?.field === sortField ? 'visible' : 'invisible')}>\n {sortDirection === 'ASC' ? <ChevronUpIcon className=\"h-5 w-5\" /> : <ChevronDownIcon className=\"h-5 w-5\" />}\n </span>\n </span>\n )}\n {!sortField && children}\n </th>\n );\n};\n\nHeaderCell.displayName = 'DataTableHeaderCell';\n\nexport default HeaderCell;\n"],"names":["baseCN","sortIconCN","sizeCNMap","HeaderCell","children","className","sortField","initialSortDirection","props","size","useContext","TableContext","sortBy","onSortByChange","HeaderContext","sortDirection","handleKeyPress","event","newDirection","jsxs","cn","jsx","ChevronUpIcon","ChevronDownIcon"],"mappings":"iMAwBMA,EAAS,sDACTC,EAAa,yEAEbC,EAA2C,CAC/C,GAAI,cACJ,GAAI,cACJ,GAAI,cACJ,GAAI,cACJ,GAAI,aACN,EAOMC,EAAa,CAAC,CAAE,SAAAC,EAAU,UAAAC,EAAW,UAAAC,EAAW,qBAAAC,EAAuB,MAAO,GAAGC,KAAmB,CACxG,KAAM,CAAE,KAAAC,CAAA,EAASC,EAAAA,WAAWC,SAAY,EAElC,CAAE,OAAAC,EAAQ,eAAAC,GAAmBH,EAAAA,WAAWI,EAAAA,OAAa,EAErDC,EAAgBH,GAAUA,EAAO,QAAUN,EAAYM,EAAO,UAAYL,EAE1ES,EAAkBC,GAA+B,CACrD,GAAIA,EAAM,MAAQ,SAAWA,EAAM,MAAQ,IAAK,CAC9C,IAAIC,EAAeH,GACfH,GAAA,YAAAA,EAAQ,SAAUN,IAAWY,EAAeA,IAAiB,MAAQ,OAAS,OAC9EZ,GAAWO,EAAe,CAAE,MAAOP,EAAW,UAAWY,EAAc,CAAA,CAC7E,EAGF,OACEC,EAAAA,KAAC,KAAA,CAAI,GAAGX,EAAO,UAAWY,EAAAA,GAAGpB,EAAQE,EAAUO,CAAI,EAAGJ,CAAS,EAC5D,SAAA,CAAAC,GACCa,EAAAA,KAAC,OAAA,CACC,UAAU,mCACV,KAAK,SACL,SAAU,EACV,QAAS,IAAM,CACb,IAAID,EAAeH,GACfH,GAAA,YAAAA,EAAQ,SAAUN,IAAWY,EAAeA,IAAiB,MAAQ,OAAS,OAClFL,EAAe,CAAE,MAAOP,EAAW,UAAWY,EAAc,CAAA,EAE9D,UAAWF,EAEV,SAAA,CAAAZ,EACDiB,EAAAA,IAAC,QAAK,UAAWD,EAAAA,GAAGnB,GAAYW,GAAA,YAAAA,EAAQ,SAAUN,EAAY,UAAY,WAAW,EAClF,aAAkB,MAAQe,EAAAA,IAACC,iBAAc,UAAU,SAAA,CAAU,EAAKD,EAAAA,IAACE,EAAAA,gBAAA,CAAgB,UAAU,SAAA,CAAU,CAAA,CAC1G,CAAA,CAAA,CAAA,EAGH,CAACjB,GAAaF,CAAA,EACjB,CAEJ,EAEAD,EAAW,YAAc"}
@@ -1,4 +1,4 @@
1
- import type { ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithoutRef } from 'react';
2
2
  interface Props extends ComponentPropsWithoutRef<'th'> {
3
3
  sortField?: string;
4
4
  initialSortDirection?: 'ASC' | 'DESC';
@@ -17,10 +17,26 @@ const S = "text-left font-semibold text-chrome-900 select-none", D = "ml-2 flex-
17
17
  (e == null ? void 0 : e.field) === n && (t = t === "ASC" ? "DESC" : "ASC"), n && l({ field: n, direction: t });
18
18
  }
19
19
  };
20
- return r("th", { ...C, className: p(S, v[x], m), children: [n && r("span", { className: "group inline-flex cursor-pointer", role: "button", tabIndex: 0, onClick: () => {
21
- let o = i;
22
- (e == null ? void 0 : e.field) === n && (o = o === "ASC" ? "DESC" : "ASC"), l({ field: n, direction: o });
23
- }, onKeyDown: h, children: [s, c("span", { className: p(D, (e == null ? void 0 : e.field) === n ? "visible" : "invisible"), children: i === "ASC" ? c(d, { className: "h-5 w-5" }) : c(b, { className: "h-5 w-5" }) })] }), !n && s] });
20
+ return /* @__PURE__ */ r("th", { ...C, className: p(S, v[x], m), children: [
21
+ n && /* @__PURE__ */ r(
22
+ "span",
23
+ {
24
+ className: "group inline-flex cursor-pointer",
25
+ role: "button",
26
+ tabIndex: 0,
27
+ onClick: () => {
28
+ let o = i;
29
+ (e == null ? void 0 : e.field) === n && (o = o === "ASC" ? "DESC" : "ASC"), l({ field: n, direction: o });
30
+ },
31
+ onKeyDown: h,
32
+ children: [
33
+ s,
34
+ /* @__PURE__ */ c("span", { className: p(D, (e == null ? void 0 : e.field) === n ? "visible" : "invisible"), children: i === "ASC" ? /* @__PURE__ */ c(d, { className: "h-5 w-5" }) : /* @__PURE__ */ c(b, { className: "h-5 w-5" }) })
35
+ ]
36
+ }
37
+ ),
38
+ !n && s
39
+ ] });
24
40
  };
25
41
  w.displayName = "DataTableHeaderCell";
26
42
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"HeaderCell.js","sources":["../../../src/elements/DataTable/HeaderCell.tsx"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n// Copyright 2024-2025 Andres Morey\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/20/solid';\nimport { useContext } from 'react';\nimport { cn } from '@/lib/utils';\nimport { Context as HeaderContext } from './Header';\nimport { Context as TableContext } from './shared';\nconst baseCN = 'text-left font-semibold text-chrome-900 select-none';\nconst sortIconCN = 'ml-2 flex-none text-chrome-400 group-hover:visible group-focus:visible';\nconst sizeCNMap = {\n xs: 'px-2 py-1.5',\n sm: 'px-2 py-1.5',\n md: 'px-3 py-3.5',\n lg: 'px-3 py-3.5',\n xl: 'px-3 py-3.5',\n};\nconst HeaderCell = ({ children, className, sortField, initialSortDirection = 'ASC', ...props }) => {\n const { size } = useContext(TableContext);\n const { sortBy, onSortByChange } = useContext(HeaderContext);\n const sortDirection = sortBy && sortBy.field === sortField\n ? sortBy.direction : initialSortDirection;\n const handleKeyPress = (event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n let newDirection = sortDirection;\n if (sortBy?.field === sortField)\n newDirection = newDirection === 'ASC' ? 'DESC' : 'ASC';\n if (sortField)\n onSortByChange({ field: sortField, direction: newDirection });\n }\n };\n return (_jsxs(\"th\", { ...props, className: cn(baseCN, sizeCNMap[size], className), children: [sortField && (_jsxs(\"span\", { className: \"group inline-flex cursor-pointer\", role: \"button\", tabIndex: 0, onClick: () => {\n let newDirection = sortDirection;\n if (sortBy?.field === sortField)\n newDirection = newDirection === 'ASC' ? 'DESC' : 'ASC';\n onSortByChange({ field: sortField, direction: newDirection });\n }, onKeyDown: handleKeyPress, children: [children, _jsx(\"span\", { className: cn(sortIconCN, sortBy?.field === sortField ? 'visible' : 'invisible'), children: sortDirection === 'ASC' ? _jsx(ChevronUpIcon, { className: \"h-5 w-5\" }) : _jsx(ChevronDownIcon, { className: \"h-5 w-5\" }) })] })), !sortField && children] }));\n};\nHeaderCell.displayName = 'DataTableHeaderCell';\nexport default HeaderCell;\n"],"names":["baseCN","sortIconCN","sizeCNMap","HeaderCell","children","className","sortField","initialSortDirection","props","size","useContext","TableContext","sortBy","onSortByChange","HeaderContext","sortDirection","handleKeyPress","event","newDirection","_jsxs","cn","_jsx","ChevronUpIcon","ChevronDownIcon"],"mappings":";;;;;;AAmBA,MAAMA,IAAS,uDACTC,IAAa,0EACbC,IAAY;AAAA,EACd,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAA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,"file":"HeaderCell.js","sources":["../../../src/elements/DataTable/HeaderCell.tsx"],"sourcesContent":["// Copyright 2024-2025 Andres Morey\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/20/solid';\nimport { useContext } from 'react';\nimport type { ComponentPropsWithoutRef } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Context as HeaderContext } from './Header';\nimport { Context as TableContext } from './shared';\nimport type { DataTableSize } from './shared';\n\nconst baseCN = 'text-left font-semibold text-chrome-900 select-none';\nconst sortIconCN = 'ml-2 flex-none text-chrome-400 group-hover:visible group-focus:visible';\n\nconst sizeCNMap: Record<DataTableSize, string> = {\n xs: 'px-2 py-1.5',\n sm: 'px-2 py-1.5',\n md: 'px-3 py-3.5',\n lg: 'px-3 py-3.5',\n xl: 'px-3 py-3.5',\n};\n\ninterface Props extends ComponentPropsWithoutRef<'th'> {\n sortField?: string;\n initialSortDirection?: 'ASC' | 'DESC';\n}\n\nconst HeaderCell = ({ children, className, sortField, initialSortDirection = 'ASC', ...props }: Props) => {\n const { size } = useContext(TableContext);\n\n const { sortBy, onSortByChange } = useContext(HeaderContext);\n\n const sortDirection = sortBy && sortBy.field === sortField ? sortBy.direction : initialSortDirection;\n\n const handleKeyPress = (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ') {\n let newDirection = sortDirection;\n if (sortBy?.field === sortField) newDirection = newDirection === 'ASC' ? 'DESC' : 'ASC';\n if (sortField) onSortByChange({ field: sortField, direction: newDirection });\n }\n };\n\n return (\n <th {...props} className={cn(baseCN, sizeCNMap[size], className)}>\n {sortField && (\n <span\n className=\"group inline-flex cursor-pointer\"\n role=\"button\"\n tabIndex={0}\n onClick={() => {\n let newDirection = sortDirection;\n if (sortBy?.field === sortField) newDirection = newDirection === 'ASC' ? 'DESC' : 'ASC';\n onSortByChange({ field: sortField, direction: newDirection });\n }}\n onKeyDown={handleKeyPress}\n >\n {children}\n <span className={cn(sortIconCN, sortBy?.field === sortField ? 'visible' : 'invisible')}>\n {sortDirection === 'ASC' ? <ChevronUpIcon className=\"h-5 w-5\" /> : <ChevronDownIcon className=\"h-5 w-5\" />}\n </span>\n </span>\n )}\n {!sortField && children}\n </th>\n );\n};\n\nHeaderCell.displayName = 'DataTableHeaderCell';\n\nexport default HeaderCell;\n"],"names":["baseCN","sortIconCN","sizeCNMap","HeaderCell","children","className","sortField","initialSortDirection","props","size","useContext","TableContext","sortBy","onSortByChange","HeaderContext","sortDirection","handleKeyPress","event","newDirection","jsxs","cn","jsx","ChevronUpIcon","ChevronDownIcon"],"mappings":";;;;;;AAwBA,MAAMA,IAAS,uDACTC,IAAa,0EAEbC,IAA2C;AAAA,EAC/C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAOMC,IAAa,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,WAAAC,GAAW,sBAAAC,IAAuB,OAAO,GAAGC,QAAmB;AACxG,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAWC,CAAY,GAElC,EAAE,QAAAC,GAAQ,gBAAAC,MAAmBH,EAAWI,CAAa,GAErDC,IAAgBH,KAAUA,EAAO,UAAUN,IAAYM,EAAO,YAAYL,GAE1ES,IAAiB,CAACC,MAA+B;AACrD,QAAIA,EAAM,QAAQ,WAAWA,EAAM,QAAQ,KAAK;AAC9C,UAAIC,IAAeH;AACnB,OAAIH,KAAA,gBAAAA,EAAQ,WAAUN,MAAWY,IAAeA,MAAiB,QAAQ,SAAS,QAC9EZ,KAAWO,EAAe,EAAE,OAAOP,GAAW,WAAWY,GAAc;AAAA,IAAA;AAAA,EAC7E;AAGF,SACE,gBAAAC,EAAC,MAAA,EAAI,GAAGX,GAAO,WAAWY,EAAGpB,GAAQE,EAAUO,CAAI,GAAGJ,CAAS,GAC5D,UAAA;AAAA,IAAAC,KACC,gBAAAa;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,MAAK;AAAA,QACL,UAAU;AAAA,QACV,SAAS,MAAM;AACb,cAAID,IAAeH;AACnB,WAAIH,KAAA,gBAAAA,EAAQ,WAAUN,MAAWY,IAAeA,MAAiB,QAAQ,SAAS,QAClFL,EAAe,EAAE,OAAOP,GAAW,WAAWY,GAAc;AAAA,QAAA;AAAA,QAE9D,WAAWF;AAAA,QAEV,UAAA;AAAA,UAAAZ;AAAA,UACD,gBAAAiB,EAAC,UAAK,WAAWD,EAAGnB,IAAYW,KAAA,gBAAAA,EAAQ,WAAUN,IAAY,YAAY,WAAW,GAClF,gBAAkB,QAAQ,gBAAAe,EAACC,KAAc,WAAU,UAAA,CAAU,IAAK,gBAAAD,EAACE,GAAA,EAAgB,WAAU,UAAA,CAAU,EAAA,CAC1G;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAGH,CAACjB,KAAaF;AAAA,EAAA,GACjB;AAEJ;AAEAD,EAAW,cAAc;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Row.cjs","sources":["../../../src/elements/DataTable/Row.tsx"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nconst Row = (props) => (_jsx(\"tr\", { ...props }));\nRow.displayName = 'DataTableRow';\nexport default Row;\n"],"names":["Row","props","_jsx"],"mappings":"kDACMA,EAAOC,GAAWC,EAAAA,IAAK,KAAM,CAAE,GAAGD,CAAO,CAAA,EAC/CD,EAAI,YAAc"}
1
+ {"version":3,"file":"Row.cjs","sources":["../../../src/elements/DataTable/Row.tsx"],"sourcesContent":["// Copyright 2024-2025 Andres Morey\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { ComponentPropsWithoutRef } from 'react';\n\nconst Row = (props: ComponentPropsWithoutRef<'tr'>) => <tr {...props} />;\n\nRow.displayName = 'DataTableRow';\n\nexport default Row;\n"],"names":["Row","props","jsx"],"mappings":"kDAgBMA,EAAOC,GAA0CC,EAAAA,IAAC,KAAA,CAAI,GAAGD,CAAA,CAAO,EAEtED,EAAI,YAAc"}
@@ -1,4 +1,4 @@
1
- import type { ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithoutRef } from 'react';
2
2
  declare const Row: {
3
3
  (props: ComponentPropsWithoutRef<"tr">): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
@@ -1,5 +1,5 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- const t = (a) => o("tr", { ...a });
2
+ const t = (a) => /* @__PURE__ */ o("tr", { ...a });
3
3
  t.displayName = "DataTableRow";
4
4
  export {
5
5
  t as default
@@ -1 +1 @@
1
- {"version":3,"file":"Row.js","sources":["../../../src/elements/DataTable/Row.tsx"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nconst Row = (props) => (_jsx(\"tr\", { ...props }));\nRow.displayName = 'DataTableRow';\nexport default Row;\n"],"names":["Row","props","_jsx"],"mappings":";AACM,MAAAA,IAAM,CAACC,MAAWC,EAAK,MAAM,EAAE,GAAGD,EAAO,CAAA;AAC/CD,EAAI,cAAc;"}
1
+ {"version":3,"file":"Row.js","sources":["../../../src/elements/DataTable/Row.tsx"],"sourcesContent":["// Copyright 2024-2025 Andres Morey\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { ComponentPropsWithoutRef } from 'react';\n\nconst Row = (props: ComponentPropsWithoutRef<'tr'>) => <tr {...props} />;\n\nRow.displayName = 'DataTableRow';\n\nexport default Row;\n"],"names":["Row","props","jsx"],"mappings":";AAgBA,MAAMA,IAAM,CAACC,MAA0C,gBAAAC,EAAC,MAAA,EAAI,GAAGD,EAAA,CAAO;AAEtED,EAAI,cAAc;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/elements/DataTable/index.tsx"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\n// Copyright 2024-2025 Andres Morey\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { useMemo } from 'react';\nimport { cn } from '@/lib/utils';\nimport Body from './Body';\nimport DataCell from './DataCell';\nimport Header from './Header';\nimport HeaderCell from './HeaderCell';\nimport Row from './Row';\nimport { Context } from './shared';\nconst baseCls = 'overflow-hidden shadow ring-1 ring-black ring-opacity-5 rounded-lg';\nconst sizeCNMap = {\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-sm',\n lg: 'text-base',\n xl: 'text-base',\n};\nconst DataTable = ({ className, children, size = 'md', }) => {\n const context = useMemo(() => ({ size }), [size]);\n return (_jsx(Context.Provider, { value: context, children: _jsx(\"div\", { className: cn(baseCls, className), children: _jsx(\"table\", { className: cn('min-w-full divide-y divide-chrome-300', size && sizeCNMap[size]), children: children }) }) }));\n};\nDataTable.displayName = 'DataTable';\nconst DataTableExport = Object.assign(DataTable, {\n Body,\n DataCell,\n Header,\n HeaderCell,\n Row,\n});\nexport default DataTableExport;\n"],"names":["baseCls","sizeCNMap","DataTable","className","children","size","context","useMemo","_jsx","Context","cn","DataTableExport","Body","DataCell","Header","HeaderCell","Row"],"mappings":"mQAsBMA,EAAU,qEACVC,EAAY,CACd,GAAI,UACJ,GAAI,UACJ,GAAI,UACJ,GAAI,YACJ,GAAI,WACR,EACMC,EAAY,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,KAAAC,EAAO,QAAY,CACnD,MAAAC,EAAUC,EAAAA,QAAQ,KAAO,CAAE,KAAAF,IAAS,CAACA,CAAI,CAAC,EAChD,OAAQG,EAAK,IAAAC,EAAA,QAAQ,SAAU,CAAE,MAAOH,EAAS,SAAUE,EAAAA,IAAK,MAAO,CAAE,UAAWE,EAAG,GAAAV,EAASG,CAAS,EAAG,SAAUK,EAAK,IAAA,QAAS,CAAE,UAAWE,EAAAA,GAAG,wCAAyCL,GAAQJ,EAAUI,CAAI,CAAC,EAAG,SAAAD,CAAmB,CAAC,CAAE,CAAC,EAAG,CACrP,EACAF,EAAU,YAAc,YAClB,MAAAS,EAAkB,OAAO,OAAOT,EAAW,CAC7C,KAAAU,EACA,SAAAC,EAAA,OACAC,EAAA,QACA,WAAAC,EACA,IAAAC,CACJ,CAAC"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/elements/DataTable/index.tsx"],"sourcesContent":["// Copyright 2024-2025 Andres Morey\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useMemo } from 'react';\nimport type { PropsWithChildren } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport Body from './Body';\nimport DataCell from './DataCell';\nimport Header from './Header';\nimport HeaderCell from './HeaderCell';\nimport Row from './Row';\nimport { Context } from './shared';\nimport type { DataTableSize } from './shared';\n\nconst baseCls = 'overflow-hidden shadow ring-1 ring-black ring-opacity-5 rounded-lg';\n\nconst sizeCNMap: Record<DataTableSize, string> = {\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-sm',\n lg: 'text-base',\n xl: 'text-base',\n};\n\ninterface Props extends PropsWithChildren {\n className?: string;\n size?: DataTableSize;\n}\n\nconst DataTable = ({ className, children, size = 'md' }: Props) => {\n const context = useMemo(() => ({ size }), [size]);\n\n return (\n <Context.Provider value={context}>\n <div className={cn(baseCls, className)}>\n <table className={cn('min-w-full divide-y divide-chrome-300', size && sizeCNMap[size])}>{children}</table>\n </div>\n </Context.Provider>\n );\n};\n\nDataTable.displayName = 'DataTable';\n\ntype DataTableType = typeof DataTable;\n\nexport interface DataTableExportType extends DataTableType {\n Body: typeof Body;\n DataCell: typeof DataCell;\n Header: typeof Header;\n HeaderCell: typeof HeaderCell;\n Row: typeof Row;\n}\n\nconst DataTableExport: DataTableExportType = Object.assign(DataTable, {\n Body,\n DataCell,\n Header,\n HeaderCell,\n Row,\n});\n\nexport default DataTableExport;\n"],"names":["baseCls","sizeCNMap","DataTable","className","children","size","context","useMemo","jsx","Context","cn","DataTableExport","Body","DataCell","Header","HeaderCell","Row"],"mappings":"mQA2BMA,EAAU,qEAEVC,EAA2C,CAC/C,GAAI,UACJ,GAAI,UACJ,GAAI,UACJ,GAAI,YACJ,GAAI,WACN,EAOMC,EAAY,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,KAAAC,EAAO,QAAkB,CACjE,MAAMC,EAAUC,EAAAA,QAAQ,KAAO,CAAE,KAAAF,IAAS,CAACA,CAAI,CAAC,EAEhD,OACEG,EAAAA,IAACC,EAAAA,QAAQ,SAAR,CAAiB,MAAOH,EACvB,SAAAE,EAAAA,IAAC,MAAA,CAAI,UAAWE,EAAAA,GAAGV,EAASG,CAAS,EACnC,SAAAK,EAAAA,IAAC,QAAA,CAAM,UAAWE,EAAAA,GAAG,wCAAyCL,GAAQJ,EAAUI,CAAI,CAAC,EAAI,SAAAD,CAAA,CAAS,CAAA,CACpG,CAAA,CACF,CAEJ,EAEAF,EAAU,YAAc,YAYxB,MAAMS,EAAuC,OAAO,OAAOT,EAAW,CACpE,KAAAU,EACA,SAAAC,EAAA,OACAC,EAAAA,QACA,WAAAC,EACA,IAAAC,CACF,CAAC"}
@@ -1,20 +1,20 @@
1
- import type { PropsWithChildren } from 'react';
2
- import Body from './Body';
3
- import DataCell from './DataCell';
4
- import Header from './Header';
5
- import HeaderCell from './HeaderCell';
6
- import Row from './Row';
7
- import type { DataTableSize } from './shared';
1
+ import { PropsWithChildren } from 'react';
2
+ import { default as Body } from './Body';
3
+ import { default as DataCell } from './DataCell';
4
+ import { default as Header } from './Header';
5
+ import { default as HeaderCell } from './HeaderCell';
6
+ import { default as Row } from './Row';
7
+ import { DataTableSize } from './shared';
8
8
  interface Props extends PropsWithChildren {
9
9
  className?: string;
10
10
  size?: DataTableSize;
11
11
  }
12
12
  declare const DataTable: {
13
- ({ className, children, size, }: Props): import("react/jsx-runtime").JSX.Element;
13
+ ({ className, children, size }: Props): import("react/jsx-runtime").JSX.Element;
14
14
  displayName: string;
15
15
  };
16
16
  type DataTableType = typeof DataTable;
17
- interface DataTableExportType extends DataTableType {
17
+ export interface DataTableExportType extends DataTableType {
18
18
  Body: typeof Body;
19
19
  DataCell: typeof DataCell;
20
20
  Header: typeof Header;
@@ -15,7 +15,7 @@ const f = "overflow-hidden shadow ring-1 ring-black ring-opacity-5 rounded-lg",
15
15
  xl: "text-base"
16
16
  }, r = ({ className: a, children: m, size: t = "md" }) => {
17
17
  const i = l(() => ({ size: t }), [t]);
18
- return e(x.Provider, { value: i, children: e("div", { className: o(f, a), children: e("table", { className: o("min-w-full divide-y divide-chrome-300", t && b[t]), children: m }) }) });
18
+ return /* @__PURE__ */ e(x.Provider, { value: i, children: /* @__PURE__ */ e("div", { className: o(f, a), children: /* @__PURE__ */ e("table", { className: o("min-w-full divide-y divide-chrome-300", t && b[t]), children: m }) }) });
19
19
  };
20
20
  r.displayName = "DataTable";
21
21
  const T = Object.assign(r, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/elements/DataTable/index.tsx"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\n// Copyright 2024-2025 Andres Morey\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { useMemo } from 'react';\nimport { cn } from '@/lib/utils';\nimport Body from './Body';\nimport DataCell from './DataCell';\nimport Header from './Header';\nimport HeaderCell from './HeaderCell';\nimport Row from './Row';\nimport { Context } from './shared';\nconst baseCls = 'overflow-hidden shadow ring-1 ring-black ring-opacity-5 rounded-lg';\nconst sizeCNMap = {\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-sm',\n lg: 'text-base',\n xl: 'text-base',\n};\nconst DataTable = ({ className, children, size = 'md', }) => {\n const context = useMemo(() => ({ size }), [size]);\n return (_jsx(Context.Provider, { value: context, children: _jsx(\"div\", { className: cn(baseCls, className), children: _jsx(\"table\", { className: cn('min-w-full divide-y divide-chrome-300', size && sizeCNMap[size]), children: children }) }) }));\n};\nDataTable.displayName = 'DataTable';\nconst DataTableExport = Object.assign(DataTable, {\n Body,\n DataCell,\n Header,\n HeaderCell,\n Row,\n});\nexport default DataTableExport;\n"],"names":["baseCls","sizeCNMap","DataTable","className","children","size","context","useMemo","_jsx","Context","cn","DataTableExport","Body","DataCell","Header","HeaderCell","Row"],"mappings":";;;;;;;;;AAsBA,MAAMA,IAAU,sEACVC,IAAY;AAAA,EACd,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACR,GACMC,IAAY,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,MAAAC,IAAO,WAAY;AACnD,QAAAC,IAAUC,EAAQ,OAAO,EAAE,MAAAF,MAAS,CAACA,CAAI,CAAC;AAChD,SAAQG,EAAKC,EAAQ,UAAU,EAAE,OAAOH,GAAS,UAAUE,EAAK,OAAO,EAAE,WAAWE,EAAGV,GAASG,CAAS,GAAG,UAAUK,EAAK,SAAS,EAAE,WAAWE,EAAG,yCAAyCL,KAAQJ,EAAUI,CAAI,CAAC,GAAG,UAAAD,EAAmB,CAAC,EAAE,CAAC,GAAG;AACrP;AACAF,EAAU,cAAc;AAClB,MAAAS,IAAkB,OAAO,OAAOT,GAAW;AAAA,EAC7C,MAAAU;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC;AAAA,EACA,KAAAC;AACJ,CAAC;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/elements/DataTable/index.tsx"],"sourcesContent":["// Copyright 2024-2025 Andres Morey\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useMemo } from 'react';\nimport type { PropsWithChildren } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport Body from './Body';\nimport DataCell from './DataCell';\nimport Header from './Header';\nimport HeaderCell from './HeaderCell';\nimport Row from './Row';\nimport { Context } from './shared';\nimport type { DataTableSize } from './shared';\n\nconst baseCls = 'overflow-hidden shadow ring-1 ring-black ring-opacity-5 rounded-lg';\n\nconst sizeCNMap: Record<DataTableSize, string> = {\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-sm',\n lg: 'text-base',\n xl: 'text-base',\n};\n\ninterface Props extends PropsWithChildren {\n className?: string;\n size?: DataTableSize;\n}\n\nconst DataTable = ({ className, children, size = 'md' }: Props) => {\n const context = useMemo(() => ({ size }), [size]);\n\n return (\n <Context.Provider value={context}>\n <div className={cn(baseCls, className)}>\n <table className={cn('min-w-full divide-y divide-chrome-300', size && sizeCNMap[size])}>{children}</table>\n </div>\n </Context.Provider>\n );\n};\n\nDataTable.displayName = 'DataTable';\n\ntype DataTableType = typeof DataTable;\n\nexport interface DataTableExportType extends DataTableType {\n Body: typeof Body;\n DataCell: typeof DataCell;\n Header: typeof Header;\n HeaderCell: typeof HeaderCell;\n Row: typeof Row;\n}\n\nconst DataTableExport: DataTableExportType = Object.assign(DataTable, {\n Body,\n DataCell,\n Header,\n HeaderCell,\n Row,\n});\n\nexport default DataTableExport;\n"],"names":["baseCls","sizeCNMap","DataTable","className","children","size","context","useMemo","jsx","Context","cn","DataTableExport","Body","DataCell","Header","HeaderCell","Row"],"mappings":";;;;;;;;;AA2BA,MAAMA,IAAU,sEAEVC,IAA2C;AAAA,EAC/C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAOMC,IAAY,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,MAAAC,IAAO,WAAkB;AACjE,QAAMC,IAAUC,EAAQ,OAAO,EAAE,MAAAF,MAAS,CAACA,CAAI,CAAC;AAEhD,SACE,gBAAAG,EAACC,EAAQ,UAAR,EAAiB,OAAOH,GACvB,UAAA,gBAAAE,EAAC,OAAA,EAAI,WAAWE,EAAGV,GAASG,CAAS,GACnC,UAAA,gBAAAK,EAAC,SAAA,EAAM,WAAWE,EAAG,yCAAyCL,KAAQJ,EAAUI,CAAI,CAAC,GAAI,UAAAD,EAAA,CAAS,EAAA,CACpG,EAAA,CACF;AAEJ;AAEAF,EAAU,cAAc;AAYxB,MAAMS,IAAuC,OAAO,OAAOT,GAAW;AAAA,EACpE,MAAAU;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC;AAAA,EACA,KAAAC;AACF,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"shared.cjs","sources":["../../../src/elements/DataTable/shared.tsx"],"sourcesContent":["// Copyright 2024-2025 Andres Morey\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { createContext } from 'react';\nexport const Context = createContext({\n size: 'md',\n});\n"],"names":["Context","createContext"],"mappings":"yGAcaA,EAAUC,EAAAA,cAAc,CACjC,KAAM,IACV,CAAC"}
1
+ {"version":3,"file":"shared.cjs","sources":["../../../src/elements/DataTable/shared.tsx"],"sourcesContent":["// Copyright 2024-2025 Andres Morey\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { createContext } from 'react';\n\nexport type DataTableSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\ntype DataTableContext = {\n size: DataTableSize;\n};\n\nexport const Context = createContext<DataTableContext>({\n size: 'md',\n});\n"],"names":["Context","createContext"],"mappings":"yGAsBaA,EAAUC,EAAAA,cAAgC,CACrD,KAAM,IACR,CAAC"}
@@ -2,5 +2,5 @@ export type DataTableSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
2
2
  type DataTableContext = {
3
3
  size: DataTableSize;
4
4
  };
5
- export declare const Context: import("react").Context<DataTableContext>;
5
+ export declare const Context: import('react').Context<DataTableContext>;
6
6
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sources":["../../../src/elements/DataTable/shared.tsx"],"sourcesContent":["// Copyright 2024-2025 Andres Morey\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { createContext } from 'react';\nexport const Context = createContext({\n size: 'md',\n});\n"],"names":["Context","createContext"],"mappings":";AAcO,MAAMA,IAAUC,EAAc;AAAA,EACjC,MAAM;AACV,CAAC;"}
1
+ {"version":3,"file":"shared.js","sources":["../../../src/elements/DataTable/shared.tsx"],"sourcesContent":["// Copyright 2024-2025 Andres Morey\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { createContext } from 'react';\n\nexport type DataTableSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\ntype DataTableContext = {\n size: DataTableSize;\n};\n\nexport const Context = createContext<DataTableContext>({\n size: 'md',\n});\n"],"names":["Context","createContext"],"mappings":";AAsBO,MAAMA,IAAUC,EAAgC;AAAA,EACrD,MAAM;AACR,CAAC;"}
@@ -0,0 +1,11 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ tags: string[];
5
+ component: import('./DataTable').DataTableExportType;
6
+ };
7
+ export default meta;
8
+ type Story = StoryObj<typeof meta>;
9
+ export declare const Default: Story;
10
+ export declare const Sortable: Story;
11
+ export declare const Dynamic: Story;
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenu.cjs","sources":["../../src/elements/DropdownMenu.tsx"],"sourcesContent":["'use client';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\nimport { forwardRef } from 'react';\nimport { cn } from '@/lib/utils';\nconst DropdownMenu = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\nconst DropdownMenuSubTrigger = forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn('flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-chrome-100 data-[state=open]:bg-chrome-100 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', inset && 'pl-8', className), ...props, children: [children, _jsx(ChevronRight, { className: \"ml-auto\" })] })));\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\nconst DropdownMenuSubContent = forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn('z-50 min-w-[8rem] overflow-hidden rounded-md border border-chrome-300 bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className), ...props })));\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\nconst DropdownMenuContent = forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn('z-50 min-w-[8rem] overflow-hidden rounded-md border border-chrome-300 bg-popover p-1 text-popover-foreground shadow-md', 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className), ...props }) })));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\nconst DropdownMenuItem = forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Item, { ref: ref, className: cn('relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0', inset && 'pl-8', className), ...props })));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\nconst DropdownMenuCheckboxItem = forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), checked: checked, ...props, children: [_jsx(\"span\", { className: \"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: \"h-4 w-4\" }) }) }), children] })));\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\nconst DropdownMenuRadioItem = forwardRef(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.RadioItem, { ref: ref, className: cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), ...props, children: [_jsx(\"span\", { className: \"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { className: \"h-2 w-2 fill-current\" }) }) }), children] })));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\nconst DropdownMenuLabel = forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Label, { ref: ref, className: cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className), ...props })));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\nconst DropdownMenuSeparator = forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Separator, { ref: ref, className: cn('-mx-1 my-1 h-px bg-chrome-300', className), ...props })));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\nconst DropdownMenuShortcut = ({ className, ...props }) => (_jsx(\"span\", { className: cn('ml-auto text-xs tracking-widest opacity-60', className), ...props }));\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\nexport { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };\n"],"names":["DropdownMenu","DropdownMenuPrimitive","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","forwardRef","className","inset","children","props","ref","_jsxs","cn","_jsx","ChevronRight","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","Check","DropdownMenuRadioItem","Circle","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"],"mappings":"qgBAMMA,EAAeC,EAAsB,KACrCC,EAAsBD,EAAsB,QAC5CE,EAAoBF,EAAsB,MAC1CG,EAAqBH,EAAsB,OAC3CI,EAAkBJ,EAAsB,IACxCK,EAAyBL,EAAsB,WAC/CM,EAAyBC,EAAW,WAAA,CAAC,CAAE,UAAAC,EAAW,MAAAC,EAAO,SAAAC,EAAU,GAAGC,CAAM,EAAGC,IAASC,EAAM,KAAAb,EAAsB,WAAY,CAAE,IAAAY,EAAU,UAAWE,EAAAA,GAAG,iNAAkNL,GAAS,OAAQD,CAAS,EAAG,GAAGG,EAAO,SAAU,CAACD,EAAUK,EAAK,IAAAC,EAAA,aAAc,CAAE,UAAW,SAAW,CAAA,CAAC,CAAA,CAAG,CAAE,EAC/dV,EAAuB,YAAcN,EAAsB,WAAW,YAChE,MAAAiB,EAAyBV,aAAW,CAAC,CAAE,UAAAC,EAAW,GAAGG,CAAS,EAAAC,IAASG,MAAKf,EAAsB,WAAY,CAAE,IAAAY,EAAU,UAAWE,EAAG,GAAA,0cAA2cN,CAAS,EAAG,GAAGG,EAAO,CAAE,EACjnBM,EAAu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,EAAAA,GAAG,2OAA4ON,CAAS,EAAG,GAAGG,EAAO,SAAU,CAACI,EAAAA,IAAK,OAAQ,CAAE,UAAW,+DAAgE,SAAUA,MAAKf,EAAsB,cAAe,CAAE,SAAUe,EAAAA,IAAKU,EAAA,OAAQ,CAAE,UAAW,sBAAA,CAAwB,CAAA,CAAG,CAAG,CAAA,EAAGf,CAAQ,EAAG,CAAE,EACtoBc,EAAsB,YAAcxB,EAAsB,UAAU,YAC9D,MAAA0B,EAAoBnB,EAAAA,WAAW,CAAC,CAAE,UAAAC,EAAW,MAAAC,EAAO,GAAGE,CAAS,EAAAC,IAASG,EAAAA,IAAKf,EAAsB,MAAO,CAAE,IAAAY,EAAU,UAAWE,EAAAA,GAAG,oCAAqCL,GAAS,OAAQD,CAAS,EAAG,GAAGG,EAAO,CAAE,EACzNe,EAAkB,YAAc1B,EAAsB,MAAM,YACtD,MAAA2B,EAAwBpB,aAAW,CAAC,CAAE,UAAAC,EAAW,GAAGG,CAAS,EAAAC,IAASG,MAAKf,EAAsB,UAAW,CAAE,IAAAY,EAAU,UAAWE,EAAG,GAAA,gCAAiCN,CAAS,EAAG,GAAGG,EAAO,CAAE,EACrMgB,EAAsB,YAAc3B,EAAsB,UAAU,YACpE,MAAM4B,EAAuB,CAAC,CAAE,UAAApB,EAAW,GAAGG,KAAaI,EAAAA,IAAK,OAAQ,CAAE,UAAWD,EAAAA,GAAG,6CAA8CN,CAAS,EAAG,GAAGG,CAAO,CAAA,EAC5JiB,EAAqB,YAAc"}
1
+ {"version":3,"file":"DropdownMenu.cjs","sources":["../../src/elements/DropdownMenu.tsx"],"sourcesContent":["import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\nimport { forwardRef } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-chrome-100 data-[state=open]:bg-chrome-100 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\n\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border border-chrome-300 bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...props}\n />\n));\n\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border border-chrome-300 bg-popover p-1 text-popover-foreground shadow-md',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\n\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\n\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\n\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\n\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}\n {...props}\n />\n));\n\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator ref={ref} className={cn('-mx-1 my-1 h-px bg-chrome-300', className)} {...props} />\n));\n\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => (\n <span className={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...props} />\n);\n\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n"],"names":["DropdownMenu","DropdownMenuPrimitive","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","forwardRef","className","inset","children","props","ref","jsxs","cn","jsx","ChevronRight","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","Check","DropdownMenuRadioItem","Circle","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"],"mappings":"qgBAMMA,EAAeC,EAAsB,KAErCC,EAAsBD,EAAsB,QAE5CE,EAAoBF,EAAsB,MAE1CG,EAAqBH,EAAsB,OAE3CI,EAAkBJ,EAAsB,IAExCK,EAAyBL,EAAsB,WAE/CM,EAAyBC,EAAAA,WAK7B,CAAC,CAAE,UAAAC,EAAW,MAAAC,EAAO,SAAAC,EAAU,GAAGC,GAASC,IAC3CC,EAAAA,KAACb,EAAsB,WAAtB,CACC,IAAAY,EACA,UAAWE,EAAAA,G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AA8CN,CAAS,EAAI,GAAGG,CAAA,CAAO,EAG3FiB,EAAqB,YAAc"}
@@ -1,24 +1,24 @@
1
1
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
2
- declare const DropdownMenu: import("react").FC<DropdownMenuPrimitive.DropdownMenuProps>;
3
- declare const DropdownMenuTrigger: import("react").ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
4
- declare const DropdownMenuGroup: import("react").ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & import("react").RefAttributes<HTMLDivElement>>;
5
- declare const DropdownMenuPortal: import("react").FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
6
- declare const DropdownMenuSub: import("react").FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
7
- declare const DropdownMenuRadioGroup: import("react").ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
8
- declare const DropdownMenuSubTrigger: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
2
+ declare const DropdownMenu: import('react').FC<DropdownMenuPrimitive.DropdownMenuProps>;
3
+ declare const DropdownMenuTrigger: import('react').ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
4
+ declare const DropdownMenuGroup: import('react').ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & import('react').RefAttributes<HTMLDivElement>>;
5
+ declare const DropdownMenuPortal: import('react').FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
6
+ declare const DropdownMenuSub: import('react').FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
7
+ declare const DropdownMenuRadioGroup: import('react').ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & import('react').RefAttributes<HTMLDivElement>>;
8
+ declare const DropdownMenuSubTrigger: import('react').ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
9
9
  inset?: boolean;
10
- } & import("react").RefAttributes<HTMLDivElement>>;
11
- declare const DropdownMenuSubContent: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
12
- declare const DropdownMenuContent: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
13
- declare const DropdownMenuItem: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
10
+ } & import('react').RefAttributes<HTMLDivElement>>;
11
+ declare const DropdownMenuSubContent: import('react').ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
12
+ declare const DropdownMenuContent: import('react').ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
13
+ declare const DropdownMenuItem: import('react').ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
14
14
  inset?: boolean;
15
- } & import("react").RefAttributes<HTMLDivElement>>;
16
- declare const DropdownMenuCheckboxItem: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
17
- declare const DropdownMenuRadioItem: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
18
- declare const DropdownMenuLabel: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
15
+ } & import('react').RefAttributes<HTMLDivElement>>;
16
+ declare const DropdownMenuCheckboxItem: import('react').ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
17
+ declare const DropdownMenuRadioItem: import('react').ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
18
+ declare const DropdownMenuLabel: import('react').ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
19
19
  inset?: boolean;
20
- } & import("react").RefAttributes<HTMLDivElement>>;
21
- declare const DropdownMenuSeparator: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
20
+ } & import('react').RefAttributes<HTMLDivElement>>;
21
+ declare const DropdownMenuSeparator: import('react').ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
22
22
  declare const DropdownMenuShortcut: {
23
23
  ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
24
24
  displayName: string;
@@ -3,23 +3,107 @@ import * as e from "@radix-ui/react-dropdown-menu";
3
3
  import { ChevronRight as m, Check as p, Circle as c } from "lucide-react";
4
4
  import { forwardRef as d } from "react";
5
5
  import { cn as r } from "../lib/utils.js";
6
- const S = e.Root, C = e.Trigger, z = e.Group, R = e.Portal, k = e.Sub, T = e.RadioGroup, u = d(({ className: o, inset: t, children: a, ...s }, i) => l(e.SubTrigger, { ref: i, className: r("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-chrome-100 data-[state=open]:bg-chrome-100 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", t && "pl-8", o), ...s, children: [a, n(m, { className: "ml-auto" })] }));
6
+ const S = e.Root, C = e.Trigger, z = e.Group, R = e.Portal, k = e.Sub, T = e.RadioGroup, u = d(({ className: o, inset: t, children: a, ...s }, i) => /* @__PURE__ */ l(
7
+ e.SubTrigger,
8
+ {
9
+ ref: i,
10
+ className: r(
11
+ "flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-chrome-100 data-[state=open]:bg-chrome-100 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
12
+ t && "pl-8",
13
+ o
14
+ ),
15
+ ...s,
16
+ children: [
17
+ a,
18
+ /* @__PURE__ */ n(m, { className: "ml-auto" })
19
+ ]
20
+ }
21
+ ));
7
22
  u.displayName = e.SubTrigger.displayName;
8
- const f = d(({ className: o, ...t }, a) => n(e.SubContent, { ref: a, className: r("z-50 min-w-[8rem] overflow-hidden rounded-md border border-chrome-300 bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", o), ...t }));
23
+ const f = d(({ className: o, ...t }, a) => /* @__PURE__ */ n(
24
+ e.SubContent,
25
+ {
26
+ ref: a,
27
+ className: r(
28
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border border-chrome-300 bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
29
+ o
30
+ ),
31
+ ...t
32
+ }
33
+ ));
9
34
  f.displayName = e.SubContent.displayName;
10
- const h = d(({ className: o, sideOffset: t = 4, ...a }, s) => n(e.Portal, { children: n(e.Content, { ref: s, sideOffset: t, className: r("z-50 min-w-[8rem] overflow-hidden rounded-md border border-chrome-300 bg-popover p-1 text-popover-foreground shadow-md", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", o), ...a }) }));
35
+ const h = d(({ className: o, sideOffset: t = 4, ...a }, s) => /* @__PURE__ */ n(e.Portal, { children: /* @__PURE__ */ n(
36
+ e.Content,
37
+ {
38
+ ref: s,
39
+ sideOffset: t,
40
+ className: r(
41
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border border-chrome-300 bg-popover p-1 text-popover-foreground shadow-md",
42
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
43
+ o
44
+ ),
45
+ ...a
46
+ }
47
+ ) }));
11
48
  h.displayName = e.Content.displayName;
12
- const b = d(({ className: o, inset: t, ...a }, s) => n(e.Item, { ref: s, className: r("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0", t && "pl-8", o), ...a }));
49
+ const b = d(({ className: o, inset: t, ...a }, s) => /* @__PURE__ */ n(
50
+ e.Item,
51
+ {
52
+ ref: s,
53
+ className: r(
54
+ "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
55
+ t && "pl-8",
56
+ o
57
+ ),
58
+ ...a
59
+ }
60
+ ));
13
61
  b.displayName = e.Item.displayName;
14
- const g = d(({ className: o, children: t, checked: a, ...s }, i) => l(e.CheckboxItem, { ref: i, className: r("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", o), checked: a, ...s, children: [n("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: n(e.ItemIndicator, { children: n(p, { className: "h-4 w-4" }) }) }), t] }));
62
+ const g = d(({ className: o, children: t, checked: a, ...s }, i) => /* @__PURE__ */ l(
63
+ e.CheckboxItem,
64
+ {
65
+ ref: i,
66
+ className: r(
67
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
68
+ o
69
+ ),
70
+ checked: a,
71
+ ...s,
72
+ children: [
73
+ /* @__PURE__ */ n("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ n(e.ItemIndicator, { children: /* @__PURE__ */ n(p, { className: "h-4 w-4" }) }) }),
74
+ t
75
+ ]
76
+ }
77
+ ));
15
78
  g.displayName = e.CheckboxItem.displayName;
16
- const N = d(({ className: o, children: t, ...a }, s) => l(e.RadioItem, { ref: s, className: r("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", o), ...a, children: [n("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: n(e.ItemIndicator, { children: n(c, { className: "h-2 w-2 fill-current" }) }) }), t] }));
79
+ const N = d(({ className: o, children: t, ...a }, s) => /* @__PURE__ */ l(
80
+ e.RadioItem,
81
+ {
82
+ ref: s,
83
+ className: r(
84
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
85
+ o
86
+ ),
87
+ ...a,
88
+ children: [
89
+ /* @__PURE__ */ n("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ n(e.ItemIndicator, { children: /* @__PURE__ */ n(c, { className: "h-2 w-2 fill-current" }) }) }),
90
+ t
91
+ ]
92
+ }
93
+ ));
17
94
  N.displayName = e.RadioItem.displayName;
18
- const w = d(({ className: o, inset: t, ...a }, s) => n(e.Label, { ref: s, className: r("px-2 py-1.5 text-sm font-semibold", t && "pl-8", o), ...a }));
95
+ const w = d(({ className: o, inset: t, ...a }, s) => /* @__PURE__ */ n(
96
+ e.Label,
97
+ {
98
+ ref: s,
99
+ className: r("px-2 py-1.5 text-sm font-semibold", t && "pl-8", o),
100
+ ...a
101
+ }
102
+ ));
19
103
  w.displayName = e.Label.displayName;
20
- const x = d(({ className: o, ...t }, a) => n(e.Separator, { ref: a, className: r("-mx-1 my-1 h-px bg-chrome-300", o), ...t }));
104
+ const x = d(({ className: o, ...t }, a) => /* @__PURE__ */ n(e.Separator, { ref: a, className: r("-mx-1 my-1 h-px bg-chrome-300", o), ...t }));
21
105
  x.displayName = e.Separator.displayName;
22
- const y = ({ className: o, ...t }) => n("span", { className: r("ml-auto text-xs tracking-widest opacity-60", o), ...t });
106
+ const y = ({ className: o, ...t }) => /* @__PURE__ */ n("span", { className: r("ml-auto text-xs tracking-widest opacity-60", o), ...t });
23
107
  y.displayName = "DropdownMenuShortcut";
24
108
  export {
25
109
  S as DropdownMenu,
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenu.js","sources":["../../src/elements/DropdownMenu.tsx"],"sourcesContent":["'use client';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\nimport { forwardRef } from 'react';\nimport { cn } from '@/lib/utils';\nconst DropdownMenu = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\nconst DropdownMenuSubTrigger = forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn('flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-chrome-100 data-[state=open]:bg-chrome-100 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', inset && 'pl-8', className), ...props, children: [children, _jsx(ChevronRight, { className: \"ml-auto\" })] })));\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\nconst DropdownMenuSubContent = forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn('z-50 min-w-[8rem] overflow-hidden rounded-md border border-chrome-300 bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className), ...props })));\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\nconst DropdownMenuContent = forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn('z-50 min-w-[8rem] overflow-hidden rounded-md border border-chrome-300 bg-popover p-1 text-popover-foreground shadow-md', 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className), ...props }) })));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\nconst DropdownMenuItem = forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Item, { ref: ref, className: cn('relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0', inset && 'pl-8', className), ...props })));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\nconst DropdownMenuCheckboxItem = forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), checked: checked, ...props, children: [_jsx(\"span\", { className: \"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: \"h-4 w-4\" }) }) }), children] })));\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\nconst DropdownMenuRadioItem = forwardRef(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.RadioItem, { ref: ref, className: cn('relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), ...props, children: [_jsx(\"span\", { className: \"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { className: \"h-2 w-2 fill-current\" }) }) }), children] })));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\nconst DropdownMenuLabel = forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Label, { ref: ref, className: cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className), ...props })));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\nconst DropdownMenuSeparator = forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Separator, { ref: ref, className: cn('-mx-1 my-1 h-px bg-chrome-300', className), ...props })));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\nconst DropdownMenuShortcut = ({ className, ...props }) => (_jsx(\"span\", { className: cn('ml-auto text-xs tracking-widest opacity-60', className), ...props }));\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\nexport { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };\n"],"names":["DropdownMenu","DropdownMenuPrimitive","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","forwardRef","className","inset","children","props","ref","_jsxs","cn","_jsx","ChevronRight","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","Check","DropdownMenuRadioItem","Circle","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"],"mappings":";;;;;AAMA,MAAMA,IAAeC,EAAsB,MACrCC,IAAsBD,EAAsB,SAC5CE,IAAoBF,EAAsB,OAC1CG,IAAqBH,EAAsB,QAC3CI,IAAkBJ,EAAsB,KACxCK,IAAyBL,EAAsB,YAC/CM,IAAyBC,EAAW,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,UAAAC,GAAU,GAAGC,EAAM,GAAGC,MAASC,EAAMb,EAAsB,YAAY,EAAE,KAAAY,GAAU,WAAWE,EAAG,kNAAkNL,KAAS,QAAQD,CAAS,GAAG,GAAGG,GAAO,UAAU,CAACD,GAAUK,EAAKC,GAAc,EAAE,WAAW,UAAW,CAAA,CAAC,EAAA,CAAG,CAAE;AAC/dV,EAAuB,cAAcN,EAAsB,WAAW;AAChE,MAAAiB,IAAyBV,EAAW,CAAC,EAAE,WAAAC,GAAW,GAAGG,EAAS,GAAAC,MAASG,EAAKf,EAAsB,YAAY,EAAE,KAAAY,GAAU,WAAWE,EAAG,2cAA2cN,CAAS,GAAG,GAAGG,GAAO,CAAE;AACjnBM,EAAuB,cAAcjB,EAAsB,WAAW;AACtE,MAAMkB,IAAsBX,EAAW,CAAC,EAAE,WAAAC,GAAW,YAAAW,IAAa,GAAG,GAAGR,EAAA,GAASC,MAASG,EAAKf,EAAsB,QAAQ,EAAE,UA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UAAU;AAC9D,MAAA0B,IAAoBnB,EAAW,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,GAAGE,EAAS,GAAAC,MAASG,EAAKf,EAAsB,OAAO,EAAE,KAAAY,GAAU,WAAWE,EAAG,qCAAqCL,KAAS,QAAQD,CAAS,GAAG,GAAGG,GAAO,CAAE;AACzNe,EAAkB,cAAc1B,EAAsB,MAAM;AACtD,MAAA2B,IAAwBpB,EAAW,CAAC,EAAE,WAAAC,GAAW,GAAGG,EAAS,GAAAC,MAASG,EAAKf,EAAsB,WAAW,EAAE,KAAAY,GAAU,WAAWE,EAAG,iCAAiCN,CAAS,GAAG,GAAGG,GAAO,CAAE;AACrMgB,EAAsB,cAAc3B,EAAsB,UAAU;AACpE,MAAM4B,IAAuB,CAAC,EAAE,WAAApB,GAAW,GAAGG,QAAaI,EAAK,QAAQ,EAAE,WAAWD,EAAG,8CAA8CN,CAAS,GAAG,GAAGG,EAAO,CAAA;AAC5JiB,EAAqB,cAAc;"}
1
+ {"version":3,"file":"DropdownMenu.js","sources":["../../src/elements/DropdownMenu.tsx"],"sourcesContent":["import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\nimport { forwardRef } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-chrome-100 data-[state=open]:bg-chrome-100 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\n\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border border-chrome-300 bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...props}\n />\n));\n\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border border-chrome-300 bg-popover p-1 text-popover-foreground shadow-md',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\n\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\n\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\n\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-chrome-100 focus:text-chrome-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\n\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}\n {...props}\n />\n));\n\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator ref={ref} className={cn('-mx-1 my-1 h-px bg-chrome-300', className)} {...props} />\n));\n\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => (\n <span className={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...props} />\n);\n\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n"],"names":["DropdownMenu","DropdownMenuPrimitive","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","forwardRef","className","inset","children","props","ref","jsxs","cn","jsx","ChevronRight","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","Check","DropdownMenuRadioItem","Circle","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"],"mappings":";;;;;AAMA,MAAMA,IAAeC,EAAsB,MAErCC,IAAsBD,EAAsB,SAE5CE,IAAoBF,EAAsB,OAE1CG,IAAqBH,EAAsB,QAE3CI,IAAkBJ,EAAsB,KAExCK,IAAyBL,EAAsB,YAE/CM,IAAyBC,EAK7B,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,UAAAC,GAAU,GAAGC,KAASC,MAC3C,gBAAAC;AAAA,EAACb,EAAsB;AAAA,EAAtB;AAAA,IACC,KAAAY;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAL,KAAS;AAAA,MACTD;AAAA,IAAA;AAAA,IAED,GAAGG;AAAA,IAEH,UAAA;AAAA,MAAAD;AAAA,MACD,gBAAAK,EAACC,GAAA,EAAa,WAAU,UAAA,CAAU;AAAA,IAAA;AAAA,EAAA;AACpC,CACD;AAEDV,EAAuB,cAAcN,EAAsB,WAAW;AAEtE,MAAMiB,IAAyBV,EAG7B,CAAC,EAAE,WAAAC,GAAW,GAAGG,EAAA,GAASC,MA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K,WAAWD,EAAG,8CAA8CN,CAAS,GAAI,GAAGG,EAAA,CAAO;AAG3FiB,EAAqB,cAAc;"}
@@ -0,0 +1,9 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ tags: string[];
5
+ component: import('react').FC<import('@radix-ui/react-dropdown-menu').DropdownMenuProps>;
6
+ };
7
+ export default meta;
8
+ type Story = StoryObj<typeof meta>;
9
+ export declare const Default: Story;