@kubetail/ui 0.2.0-rc1 → 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":"Alert.cjs","sources":["../../src/elements/Alert.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 { ExclamationTriangleIcon } from '@heroicons/react/24/solid';\n/**\n * UI component for displaying alerts\n */\nconst Alert = ({ children }) => (_jsx(\"div\", { className: \"rounded-md bg-yellow-50 p-4\", children: _jsxs(\"div\", { className: \"flex\", children: [_jsx(\"div\", { className: \"flex-shrink-0\", children: _jsx(ExclamationTriangleIcon, { className: \"h-5 w-5 text-yellow-400\", \"aria-hidden\": \"true\" }) }), _jsxs(\"div\", { className: \"ml-3\", children: [_jsx(\"h3\", { className: \"text-sm font-medium text-yellow-800\", children: \"Attention\" }), _jsx(\"div\", { className: \"mt-2 text-sm text-yellow-700\", children: _jsx(\"div\", { children: children }) })] })] }) }));\nexport default Alert;\n"],"names":["Alert","children","_jsx","_jsxs","ExclamationTriangleIcon"],"mappings":"yFAkBMA,EAAQ,CAAC,CAAE,SAAAC,KAAgBC,EAAAA,IAAK,MAAO,CAAE,UAAW,8BAA+B,SAAUC,EAAAA,KAAM,MAAO,CAAE,UAAW,OAAQ,SAAU,CAACD,EAAK,IAAA,MAAO,CAAE,UAAW,gBAAiB,SAAUA,MAAKE,EAAAA,wBAAyB,CAAE,UAAW,0BAA2B,cAAe,MAAO,CAAC,EAAG,EAAGD,EAAAA,KAAM,MAAO,CAAE,UAAW,OAAQ,SAAU,CAACD,MAAK,KAAM,CAAE,UAAW,sCAAuC,SAAU,WAAA,CAAa,EAAGA,MAAK,MAAO,CAAE,UAAW,+BAAgC,SAAUA,EAAAA,IAAK,MAAO,CAAE,SAAAD,CAAoB,CAAA,CAAG,CAAA,CAAC,EAAG,CAAC,CAAG,CAAA,CAAG,CAAA"}
1
+ {"version":3,"file":"Alert.cjs","sources":["../../src/elements/Alert.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 { ExclamationTriangleIcon } from '@heroicons/react/24/solid';\nimport type { ReactNode } from 'react';\n\ntype Props = {\n children?: ReactNode;\n};\n\n/**\n * UI component for displaying alerts\n */\nconst Alert = ({ children }: Props) => (\n <div className=\"rounded-md bg-yellow-50 p-4\">\n <div className=\"flex\">\n <div className=\"flex-shrink-0\">\n <ExclamationTriangleIcon className=\"h-5 w-5 text-yellow-400\" aria-hidden=\"true\" />\n </div>\n <div className=\"ml-3\">\n <h3 className=\"text-sm font-medium text-yellow-800\">Attention</h3>\n <div className=\"mt-2 text-sm text-yellow-700\">\n <div>{children}</div>\n </div>\n </div>\n </div>\n </div>\n);\n\nexport default Alert;\n"],"names":["Alert","children","jsx","jsxs","ExclamationTriangleIcon"],"mappings":"yFAwBMA,EAAQ,CAAC,CAAE,SAAAC,CAAA,IACfC,EAAAA,IAAC,MAAA,CAAI,UAAU,8BACb,SAAAC,EAAAA,KAAC,MAAA,CAAI,UAAU,OACb,SAAA,CAAAD,EAAAA,IAAC,MAAA,CAAI,UAAU,gBACb,SAAAA,EAAAA,IAACE,2BAAwB,UAAU,0BAA0B,cAAY,MAAA,CAAO,CAAA,CAClF,EACAD,EAAAA,KAAC,MAAA,CAAI,UAAU,OACb,SAAA,CAAAD,EAAAA,IAAC,KAAA,CAAG,UAAU,sCAAsC,SAAA,YAAS,QAC5D,MAAA,CAAI,UAAU,+BACb,SAAAA,EAAAA,IAAC,MAAA,CAAK,SAAAD,EAAS,CAAA,CACjB,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CACF"}
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  type Props = {
3
3
  children?: ReactNode;
4
4
  };
@@ -1,6 +1,12 @@
1
1
  import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
2
  import { ExclamationTriangleIcon as s } from "@heroicons/react/24/solid";
3
- const d = ({ children: t }) => e("div", { className: "rounded-md bg-yellow-50 p-4", children: l("div", { className: "flex", children: [e("div", { className: "flex-shrink-0", children: e(s, { className: "h-5 w-5 text-yellow-400", "aria-hidden": "true" }) }), l("div", { className: "ml-3", children: [e("h3", { className: "text-sm font-medium text-yellow-800", children: "Attention" }), e("div", { className: "mt-2 text-sm text-yellow-700", children: e("div", { children: t }) })] })] }) });
3
+ const d = ({ children: t }) => /* @__PURE__ */ e("div", { className: "rounded-md bg-yellow-50 p-4", children: /* @__PURE__ */ l("div", { className: "flex", children: [
4
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(s, { className: "h-5 w-5 text-yellow-400", "aria-hidden": "true" }) }),
5
+ /* @__PURE__ */ l("div", { className: "ml-3", children: [
6
+ /* @__PURE__ */ e("h3", { className: "text-sm font-medium text-yellow-800", children: "Attention" }),
7
+ /* @__PURE__ */ e("div", { className: "mt-2 text-sm text-yellow-700", children: /* @__PURE__ */ e("div", { children: t }) })
8
+ ] })
9
+ ] }) });
4
10
  export {
5
11
  d as default
6
12
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","sources":["../../src/elements/Alert.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 { ExclamationTriangleIcon } from '@heroicons/react/24/solid';\n/**\n * UI component for displaying alerts\n */\nconst Alert = ({ children }) => (_jsx(\"div\", { className: \"rounded-md bg-yellow-50 p-4\", children: _jsxs(\"div\", { className: \"flex\", children: [_jsx(\"div\", { className: \"flex-shrink-0\", children: _jsx(ExclamationTriangleIcon, { className: \"h-5 w-5 text-yellow-400\", \"aria-hidden\": \"true\" }) }), _jsxs(\"div\", { className: \"ml-3\", children: [_jsx(\"h3\", { className: \"text-sm font-medium text-yellow-800\", children: \"Attention\" }), _jsx(\"div\", { className: \"mt-2 text-sm text-yellow-700\", children: _jsx(\"div\", { children: children }) })] })] }) }));\nexport default Alert;\n"],"names":["Alert","children","_jsx","_jsxs","ExclamationTriangleIcon"],"mappings":";;AAkBA,MAAMA,IAAQ,CAAC,EAAE,UAAAC,QAAgBC,EAAK,OAAO,EAAE,WAAW,+BAA+B,UAAUC,EAAM,OAAO,EAAE,WAAW,QAAQ,UAAU,CAACD,EAAK,OAAO,EAAE,WAAW,iBAAiB,UAAUA,EAAKE,GAAyB,EAAE,WAAW,2BAA2B,eAAe,OAAO,CAAC,GAAG,GAAGD,EAAM,OAAO,EAAE,WAAW,QAAQ,UAAU,CAACD,EAAK,MAAM,EAAE,WAAW,uCAAuC,UAAU,YAAA,CAAa,GAAGA,EAAK,OAAO,EAAE,WAAW,gCAAgC,UAAUA,EAAK,OAAO,EAAE,UAAAD,EAAoB,CAAA,EAAG,CAAA,CAAC,GAAG,CAAC,EAAG,CAAA,EAAG,CAAA;"}
1
+ {"version":3,"file":"Alert.js","sources":["../../src/elements/Alert.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 { ExclamationTriangleIcon } from '@heroicons/react/24/solid';\nimport type { ReactNode } from 'react';\n\ntype Props = {\n children?: ReactNode;\n};\n\n/**\n * UI component for displaying alerts\n */\nconst Alert = ({ children }: Props) => (\n <div className=\"rounded-md bg-yellow-50 p-4\">\n <div className=\"flex\">\n <div className=\"flex-shrink-0\">\n <ExclamationTriangleIcon className=\"h-5 w-5 text-yellow-400\" aria-hidden=\"true\" />\n </div>\n <div className=\"ml-3\">\n <h3 className=\"text-sm font-medium text-yellow-800\">Attention</h3>\n <div className=\"mt-2 text-sm text-yellow-700\">\n <div>{children}</div>\n </div>\n </div>\n </div>\n </div>\n);\n\nexport default Alert;\n"],"names":["Alert","children","jsx","jsxs","ExclamationTriangleIcon"],"mappings":";;AAwBA,MAAMA,IAAQ,CAAC,EAAE,UAAAC,EAAA,MACf,gBAAAC,EAAC,OAAA,EAAI,WAAU,+BACb,UAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,QACb,UAAA;AAAA,EAAA,gBAAAD,EAAC,OAAA,EAAI,WAAU,iBACb,UAAA,gBAAAA,EAACE,KAAwB,WAAU,2BAA0B,eAAY,OAAA,CAAO,EAAA,CAClF;AAAA,EACA,gBAAAD,EAAC,OAAA,EAAI,WAAU,QACb,UAAA;AAAA,IAAA,gBAAAD,EAAC,MAAA,EAAG,WAAU,uCAAsC,UAAA,aAAS;AAAA,sBAC5D,OAAA,EAAI,WAAU,gCACb,UAAA,gBAAAA,EAAC,OAAA,EAAK,UAAAD,GAAS,EAAA,CACjB;AAAA,EAAA,EAAA,CACF;AAAA,EAAA,CACF,EAAA,CACF;"}
@@ -0,0 +1,11 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ component: ({ children }: {
5
+ children?: import('react').ReactNode;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ tags: string[];
8
+ };
9
+ export default meta;
10
+ type Story = StoryObj<typeof meta>;
11
+ export declare const Default: Story;
@@ -1 +1 @@
1
- {"version":3,"file":"Button.cjs","sources":["../../src/elements/Button.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 { useButtonProps } from '@restart/ui/Button';\nimport { cva } from 'class-variance-authority';\nimport { forwardRef } from 'react';\nimport { cn } from '@/lib/utils';\nexport const buttonVariants = cva('uppercase inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', {\n variants: {\n intent: {\n primary: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/60 shadow-sm',\n danger: 'bg-danger text-danger-foreground hover:bg-danger/90 shadow-sm',\n outline: 'border border-input bg-background hover:bg-secondary hover:text-secondary-foreground',\n ghost: 'hover:bg-secondary hover:text-secondary-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n xs: 'px-2.5 py-1.5 text-xs rounded',\n sm: 'px-3 py-2 text-xs rounded-md',\n md: 'px-4 py-2 text-sm rounded-md',\n lg: 'px-4 py-2 text-base rounded-md',\n xl: 'px-6 py-3 text-base rounded-md',\n },\n },\n defaultVariants: {\n intent: 'primary',\n size: 'md',\n },\n});\nconst Button = forwardRef(({ as, children, className, disabled, ...props }, ref) => {\n const [ariaButtonProps, { tagName: Tag }] = useButtonProps({\n tagName: as,\n disabled,\n ...props,\n });\n return (_jsx(Tag, { ...props, ...ariaButtonProps, ref: ref, className: cn(buttonVariants(props), className), children: children }));\n});\nButton.displayName = 'Button';\nexport default Button;\n"],"names":["buttonVariants","cva","Button","forwardRef","as","children","className","disabled","props","ref","ariaButtonProps","Tag","useButtonProps","_jsx","cn"],"mappings":"wQAkBaA,EAAiBC,MAAI,mSAAoS,CAClU,SAAU,CACN,OAAQ,CACJ,QAAS,mEACT,UAAW,yEACX,OAAQ,gEACR,QAAS,uFACT,MAAO,qDACP,KAAM,iDACV,EACA,KAAM,CACF,GAAI,gCACJ,GAAI,+BACJ,GAAI,+BACJ,GAAI,iCACJ,GAAI,gCAAA,CAEZ,EACA,gBAAiB,CACb,OAAQ,UACR,KAAM,IAAA,CAEd,CAAC,EACKC,EAASC,EAAAA,WAAW,CAAC,CAAE,GAAAC,EAAI,SAAAC,EAAU,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAM,EAAGC,IAAQ,CAChF,KAAM,CAACC,EAAiB,CAAE,QAASC,CAAK,CAAA,EAAIC,EAAAA,eAAe,CACvD,QAASR,EACT,SAAAG,EACA,GAAGC,CAAA,CACN,EACD,OAAQK,EAAAA,IAAKF,EAAK,CAAE,GAAGH,EAAO,GAAGE,EAAiB,IAAAD,EAAU,UAAWK,EAAA,GAAGd,EAAeQ,CAAK,EAAGF,CAAS,EAAG,SAAAD,EAAoB,CACrI,CAAC,EACDH,EAAO,YAAc"}
1
+ {"version":3,"file":"Button.cjs","sources":["../../src/elements/Button.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 { useButtonProps } from '@restart/ui/Button';\nimport type { ButtonProps } from '@restart/ui/Button';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { forwardRef } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>;\n\nexport const buttonVariants = cva(\n 'uppercase inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n intent: {\n primary: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/60 shadow-sm',\n danger: 'bg-danger text-danger-foreground hover:bg-danger/90 shadow-sm',\n outline: 'border border-input bg-background hover:bg-secondary hover:text-secondary-foreground',\n ghost: 'hover:bg-secondary hover:text-secondary-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n xs: 'px-2.5 py-1.5 text-xs rounded',\n sm: 'px-3 py-2 text-xs rounded-md',\n md: 'px-4 py-2 text-sm rounded-md',\n lg: 'px-4 py-2 text-base rounded-md',\n xl: 'px-6 py-3 text-base rounded-md',\n },\n },\n defaultVariants: {\n intent: 'primary',\n size: 'md',\n },\n },\n);\n\nconst Button = forwardRef(({ as, children, className, disabled, ...props }: ButtonProps & ButtonVariantProps, ref) => {\n const [ariaButtonProps, { tagName: Tag }] = useButtonProps({\n tagName: as,\n disabled,\n ...props,\n });\n\n return (\n <Tag {...props} {...ariaButtonProps} ref={ref} className={cn(buttonVariants(props), className)}>\n {children}\n </Tag>\n );\n});\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"names":["buttonVariants","cva","Button","forwardRef","as","children","className","disabled","props","ref","ariaButtonProps","Tag","useButtonProps","jsx","cn"],"mappings":"wQAuBaA,EAAiBC,EAAAA,IAC5B,mSACA,CACE,SAAU,CACR,OAAQ,CACN,QAAS,mEACT,UAAW,yEACX,OAAQ,gEACR,QAAS,uFACT,MAAO,qDACP,KAAM,iDAAA,EAER,KAAM,CACJ,GAAI,gCACJ,GAAI,+BACJ,GAAI,+BACJ,GAAI,iCACJ,GAAI,gCAAA,CACN,EAEF,gBAAiB,CACf,OAAQ,UACR,KAAM,IAAA,CACR,CAEJ,EAEMC,EAASC,EAAAA,WAAW,CAAC,CAAE,GAAAC,EAAI,SAAAC,EAAU,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAA,EAA2CC,IAAQ,CACpH,KAAM,CAACC,EAAiB,CAAE,QAASC,CAAA,CAAK,EAAIC,EAAAA,eAAe,CACzD,QAASR,EACT,SAAAG,EACA,GAAGC,CAAA,CACJ,EAED,OACEK,EAAAA,IAACF,EAAA,CAAK,GAAGH,EAAQ,GAAGE,EAAiB,IAAAD,EAAU,UAAWK,EAAAA,GAAGd,EAAeQ,CAAK,EAAGF,CAAS,EAC1F,SAAAD,CAAA,CACH,CAEJ,CAAC,EAEDH,EAAO,YAAc"}
@@ -1,9 +1,9 @@
1
- import type { ButtonProps } from '@restart/ui/Button';
2
- import { type VariantProps } from 'class-variance-authority';
1
+ import { ButtonProps } from '@restart/ui/Button';
2
+ import { VariantProps } from 'class-variance-authority';
3
3
  export type ButtonVariantProps = VariantProps<typeof buttonVariants>;
4
4
  export declare const buttonVariants: (props?: ({
5
- intent?: "link" | "danger" | "primary" | "secondary" | "outline" | "ghost" | null | undefined;
6
- size?: "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
7
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
- declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & ButtonVariantProps & import("react").RefAttributes<unknown>>;
5
+ intent?: "link" | "primary" | "secondary" | "danger" | "outline" | "ghost" | null | undefined;
6
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
7
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
+ declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & ButtonVariantProps & import('react').RefAttributes<unknown>>;
9
9
  export default Button;
@@ -3,35 +3,38 @@ import { useButtonProps as m } from "@restart/ui/Button";
3
3
  import { cva as u } from "class-variance-authority";
4
4
  import { forwardRef as g } from "react";
5
5
  import { cn as p } from "../lib/utils.js";
6
- const f = u("uppercase inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", {
7
- variants: {
8
- intent: {
9
- primary: "bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm",
10
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/60 shadow-sm",
11
- danger: "bg-danger text-danger-foreground hover:bg-danger/90 shadow-sm",
12
- outline: "border border-input bg-background hover:bg-secondary hover:text-secondary-foreground",
13
- ghost: "hover:bg-secondary hover:text-secondary-foreground",
14
- link: "text-primary underline-offset-4 hover:underline"
6
+ const f = u(
7
+ "uppercase inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
8
+ {
9
+ variants: {
10
+ intent: {
11
+ primary: "bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm",
12
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/60 shadow-sm",
13
+ danger: "bg-danger text-danger-foreground hover:bg-danger/90 shadow-sm",
14
+ outline: "border border-input bg-background hover:bg-secondary hover:text-secondary-foreground",
15
+ ghost: "hover:bg-secondary hover:text-secondary-foreground",
16
+ link: "text-primary underline-offset-4 hover:underline"
17
+ },
18
+ size: {
19
+ xs: "px-2.5 py-1.5 text-xs rounded",
20
+ sm: "px-3 py-2 text-xs rounded-md",
21
+ md: "px-4 py-2 text-sm rounded-md",
22
+ lg: "px-4 py-2 text-base rounded-md",
23
+ xl: "px-6 py-3 text-base rounded-md"
24
+ }
15
25
  },
16
- size: {
17
- xs: "px-2.5 py-1.5 text-xs rounded",
18
- sm: "px-3 py-2 text-xs rounded-md",
19
- md: "px-4 py-2 text-sm rounded-md",
20
- lg: "px-4 py-2 text-base rounded-md",
21
- xl: "px-6 py-3 text-base rounded-md"
26
+ defaultVariants: {
27
+ intent: "primary",
28
+ size: "md"
22
29
  }
23
- },
24
- defaultVariants: {
25
- intent: "primary",
26
- size: "md"
27
30
  }
28
- }), c = g(({ as: r, children: o, className: t, disabled: n, ...e }, s) => {
31
+ ), c = g(({ as: r, children: o, className: t, disabled: n, ...e }, s) => {
29
32
  const [a, { tagName: d }] = m({
30
33
  tagName: r,
31
34
  disabled: n,
32
35
  ...e
33
36
  });
34
- return i(d, { ...e, ...a, ref: s, className: p(f(e), t), children: o });
37
+ return /* @__PURE__ */ i(d, { ...e, ...a, ref: s, className: p(f(e), t), children: o });
35
38
  });
36
39
  c.displayName = "Button";
37
40
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../src/elements/Button.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 { useButtonProps } from '@restart/ui/Button';\nimport { cva } from 'class-variance-authority';\nimport { forwardRef } from 'react';\nimport { cn } from '@/lib/utils';\nexport const buttonVariants = cva('uppercase inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', {\n variants: {\n intent: {\n primary: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/60 shadow-sm',\n danger: 'bg-danger text-danger-foreground hover:bg-danger/90 shadow-sm',\n outline: 'border border-input bg-background hover:bg-secondary hover:text-secondary-foreground',\n ghost: 'hover:bg-secondary hover:text-secondary-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n xs: 'px-2.5 py-1.5 text-xs rounded',\n sm: 'px-3 py-2 text-xs rounded-md',\n md: 'px-4 py-2 text-sm rounded-md',\n lg: 'px-4 py-2 text-base rounded-md',\n xl: 'px-6 py-3 text-base rounded-md',\n },\n },\n defaultVariants: {\n intent: 'primary',\n size: 'md',\n },\n});\nconst Button = forwardRef(({ as, children, className, disabled, ...props }, ref) => {\n const [ariaButtonProps, { tagName: Tag }] = useButtonProps({\n tagName: as,\n disabled,\n ...props,\n });\n return (_jsx(Tag, { ...props, ...ariaButtonProps, ref: ref, className: cn(buttonVariants(props), className), children: children }));\n});\nButton.displayName = 'Button';\nexport default Button;\n"],"names":["buttonVariants","cva","Button","forwardRef","as","children","className","disabled","props","ref","ariaButtonProps","Tag","useButtonProps","_jsx","cn"],"mappings":";;;;;AAkBa,MAAAA,IAAiBC,EAAI,oSAAoS;AAAA,EAClU,UAAU;AAAA,IACN,QAAQ;AAAA,MACJ,SAAS;AAAA,MACT,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,OAAO;AAAA,MACP,MAAM;AAAA,IACV;AAAA,IACA,MAAM;AAAA,MACF,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EAEZ;AAAA,EACA,iBAAiB;AAAA,IACb,QAAQ;AAAA,IACR,MAAM;AAAA,EAAA;AAEd,CAAC,GACKC,IAASC,EAAW,CAAC,EAAE,IAAAC,GAAI,UAAAC,GAAU,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAM,GAAGC,MAAQ;AAChF,QAAM,CAACC,GAAiB,EAAE,SAASC,EAAK,CAAA,IAAIC,EAAe;AAAA,IACvD,SAASR;AAAA,IACT,UAAAG;AAAA,IACA,GAAGC;AAAA,EAAA,CACN;AACD,SAAQK,EAAKF,GAAK,EAAE,GAAGH,GAAO,GAAGE,GAAiB,KAAAD,GAAU,WAAWK,EAAGd,EAAeQ,CAAK,GAAGF,CAAS,GAAG,UAAAD,GAAoB;AACrI,CAAC;AACDH,EAAO,cAAc;"}
1
+ {"version":3,"file":"Button.js","sources":["../../src/elements/Button.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 { useButtonProps } from '@restart/ui/Button';\nimport type { ButtonProps } from '@restart/ui/Button';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { forwardRef } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>;\n\nexport const buttonVariants = cva(\n 'uppercase inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n intent: {\n primary: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/60 shadow-sm',\n danger: 'bg-danger text-danger-foreground hover:bg-danger/90 shadow-sm',\n outline: 'border border-input bg-background hover:bg-secondary hover:text-secondary-foreground',\n ghost: 'hover:bg-secondary hover:text-secondary-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n xs: 'px-2.5 py-1.5 text-xs rounded',\n sm: 'px-3 py-2 text-xs rounded-md',\n md: 'px-4 py-2 text-sm rounded-md',\n lg: 'px-4 py-2 text-base rounded-md',\n xl: 'px-6 py-3 text-base rounded-md',\n },\n },\n defaultVariants: {\n intent: 'primary',\n size: 'md',\n },\n },\n);\n\nconst Button = forwardRef(({ as, children, className, disabled, ...props }: ButtonProps & ButtonVariantProps, ref) => {\n const [ariaButtonProps, { tagName: Tag }] = useButtonProps({\n tagName: as,\n disabled,\n ...props,\n });\n\n return (\n <Tag {...props} {...ariaButtonProps} ref={ref} className={cn(buttonVariants(props), className)}>\n {children}\n </Tag>\n );\n});\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"names":["buttonVariants","cva","Button","forwardRef","as","children","className","disabled","props","ref","ariaButtonProps","Tag","useButtonProps","jsx","cn"],"mappings":";;;;;AAuBO,MAAMA,IAAiBC;AAAA,EAC5B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,QAAQ;AAAA,QACN,SAAS;AAAA,QACT,WAAW;AAAA,QACX,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,OAAO;AAAA,QACP,MAAM;AAAA,MAAA;AAAA,MAER,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,IACN;AAAA,IAEF,iBAAiB;AAAA,MACf,QAAQ;AAAA,MACR,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ,GAEMC,IAASC,EAAW,CAAC,EAAE,IAAAC,GAAI,UAAAC,GAAU,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GAA2CC,MAAQ;AACpH,QAAM,CAACC,GAAiB,EAAE,SAASC,EAAA,CAAK,IAAIC,EAAe;AAAA,IACzD,SAASR;AAAA,IACT,UAAAG;AAAA,IACA,GAAGC;AAAA,EAAA,CACJ;AAED,SACE,gBAAAK,EAACF,GAAA,EAAK,GAAGH,GAAQ,GAAGE,GAAiB,KAAAD,GAAU,WAAWK,EAAGd,EAAeQ,CAAK,GAAGF,CAAS,GAC1F,UAAAD,EAAA,CACH;AAEJ,CAAC;AAEDH,EAAO,cAAc;"}
@@ -0,0 +1,15 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ import { ButtonVariantProps } from './Button';
3
+ declare const meta: {
4
+ title: string;
5
+ tags: string[];
6
+ component: import('react').ForwardRefExoticComponent<import('@restart/ui/Button').ButtonProps & ButtonVariantProps & import('react').RefAttributes<unknown>>;
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const Primary: Story;
11
+ export declare const Secondary: Story;
12
+ export declare const Danger: Story;
13
+ export declare const Outline: Story;
14
+ export declare const Ghost: Story;
15
+ export declare const Link: Story;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("lucide-react"),i=require("react-day-picker"),a=require("./Button.cjs"),e=require("../lib/utils.cjs"),l=()=>t.jsx(r.ChevronLeft,{className:"h-4 w-4"}),u=()=>t.jsx(r.ChevronRight,{className:"h-4 w-4"});function n({className:o,classNames:c,showOutsideDays:s=!0,...d}){return t.jsx(i.DayPicker,{showOutsideDays:s,className:e.cn("p-3",o),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:e.cn(a.buttonVariants({intent:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:e.cn(a.buttonVariants({intent:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...c},components:{IconLeft:l,IconRight:u},...d})}n.displayName="Calendar";exports.Calendar=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),r=require("react-day-picker");function n({showOutsideDays:t=!0,...o}){const e=r.getDefaultClassNames();return a.jsx(r.DayPicker,{mode:"single",showOutsideDays:t,classNames:{today:"bg-accent text-accent-foreground",selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",root:`${e.root} shadow-lg p-5`,chevron:`${e.chevron} fill-amber-500`,weekday:"text-muted-foreground font-normal text-sm",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",outside:"text-muted-foreground"},...o})}exports.Calendar=n;
2
2
  //# sourceMappingURL=Calendar.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Calendar.cjs","sources":["../../src/elements/Calendar.tsx"],"sourcesContent":["'use client';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { DayPicker } from 'react-day-picker';\nimport { buttonVariants } from './Button';\nimport { cn } from '@/lib/utils';\nconst IconLeft = () => _jsx(ChevronLeft, { className: \"h-4 w-4\" });\nconst IconRight = () => _jsx(ChevronRight, { className: \"h-4 w-4\" });\nfunction Calendar({ className, classNames, showOutsideDays = true, ...props }) {\n return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn('p-3', className), classNames: {\n months: 'flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0',\n month: 'space-y-4',\n caption: 'flex justify-center pt-1 relative items-center',\n caption_label: 'text-sm font-medium',\n nav: 'space-x-1 flex items-center',\n nav_button: cn(buttonVariants({ intent: 'outline' }), 'h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100'),\n nav_button_previous: 'absolute left-1',\n nav_button_next: 'absolute right-1',\n table: 'w-full border-collapse space-y-1',\n head_row: 'flex',\n head_cell: 'text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]',\n row: 'flex w-full mt-2',\n cell: 'h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20',\n day: cn(buttonVariants({ intent: 'ghost' }), 'h-9 w-9 p-0 font-normal aria-selected:opacity-100'),\n day_range_end: 'day-range-end',\n day_selected: 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',\n day_today: 'bg-accent text-accent-foreground',\n day_outside: 'day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30',\n day_disabled: 'text-muted-foreground opacity-50',\n day_range_middle: 'aria-selected:bg-accent aria-selected:text-accent-foreground',\n day_hidden: 'invisible',\n ...classNames,\n }, components: { IconLeft, IconRight }, ...props }));\n}\nCalendar.displayName = 'Calendar';\nexport { Calendar };\n"],"names":["IconLeft","_jsx","ChevronLeft","IconRight","ChevronRight","Calendar","className","classNames","showOutsideDays","props","DayPicker","cn","buttonVariants"],"mappings":"qOAMMA,EAAW,IAAMC,EAAAA,IAAKC,EAAAA,YAAa,CAAE,UAAW,UAAW,EAC3DC,EAAY,IAAMF,EAAAA,IAAKG,EAAAA,aAAc,CAAE,UAAW,UAAW,EACnE,SAASC,EAAS,CAAE,UAAAC,EAAW,WAAAC,EAAY,gBAAAC,EAAkB,GAAM,GAAGC,GAAS,CACnE,OAAAR,EAAA,IAAKS,YAAW,CAAE,gBAAAF,EAAkC,UAAWG,EAAAA,GAAG,MAAOL,CAAS,EAAG,WAAY,CACjG,OAAQ,gEACR,MAAO,YACP,QAAS,iDACT,cAAe,sBACf,IAAK,8BACL,WAAYK,KAAGC,iBAAe,CAAE,OAAQ,SAAU,CAAC,EAAG,yDAAyD,EAC/G,oBAAqB,kBACrB,gBAAiB,mBACjB,MAAO,mCACP,SAAU,OACV,UAAW,iEACX,IAAK,mBACL,KAAM,mTACN,IAAKD,KAAGC,iBAAe,CAAE,OAAQ,OAAQ,CAAC,EAAG,mDAAmD,EAChG,cAAe,gBACf,aAAc,mIACd,UAAW,mCACX,YAAa,uIACb,aAAc,mCACd,iBAAkB,+DAClB,WAAY,YACZ,GAAGL,CAAA,EACJ,WAAY,CAAE,SAAAP,EAAU,UAAAG,GAAa,GAAGM,EAAO,CAC1D,CACAJ,EAAS,YAAc"}
1
+ {"version":3,"file":"Calendar.cjs","sources":["../../src/elements/Calendar.tsx"],"sourcesContent":["/*\n'use client';\n\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { DayPicker } from 'react-day-picker';\n\nimport { buttonVariants } from './Button';\nimport { cn } from '@/lib/utils';\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>;\n\nconst ChevronLeftIcon = () => <ChevronLeft className=\"h-4 w-4\" />;\nconst ChevronRightIcon = () => <ChevronRight className=\"h-4 w-4\" />;\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn('p-3', className)}\n classNames={{\n months: 'flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0',\n month: 'space-y-4',\n caption: 'flex justify-center pt-1 relative items-center',\n caption_label: 'text-sm font-medium',\n nav: 'space-x-1 flex items-center',\n nav_button: cn(\n buttonVariants({ intent: 'outline' }),\n 'h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100',\n ),\n nav_button_previous: 'absolute left-1',\n nav_button_next: 'absolute right-1',\n table: 'w-full border-collapse space-y-1',\n head_row: 'flex',\n head_cell: 'text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]',\n row: 'flex w-full mt-2',\n cell: 'h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20',\n day: cn(\n buttonVariants({ intent: 'ghost' }),\n 'h-9 w-9 p-0 font-normal aria-selected:opacity-100',\n ),\n day_range_end: 'day-range-end',\n day_selected: 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',\n day_today: 'bg-accent text-accent-foreground',\n day_outside: 'day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30',\n day_disabled: 'text-muted-foreground opacity-50',\n day_range_middle: 'aria-selected:bg-accent aria-selected:text-accent-foreground',\n day_hidden: 'invisible',\n ...classNames,\n }}\n components={{ \n Chevron: ({ orientation }) => orientation === 'left' ? <ChevronLeftIcon /> : <ChevronRightIcon /> \n }}\n {...props}\n />\n );\n}\n\nCalendar.displayName = 'Calendar';\n\nexport { Calendar };\n*/\n\nimport { DayPicker, getDefaultClassNames } from 'react-day-picker';\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>;\n\nexport function Calendar({ showOutsideDays = true, ...props }) {\n const defaultClassNames = getDefaultClassNames();\n return (\n <DayPicker\n mode=\"single\"\n showOutsideDays={showOutsideDays}\n classNames={{\n today: 'bg-accent text-accent-foreground',\n selected:\n 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',\n root: `${defaultClassNames.root} shadow-lg p-5`,\n chevron: `${defaultClassNames.chevron} fill-amber-500`,\n weekday: 'text-muted-foreground font-normal text-sm',\n day_selected:\n 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',\n day_today: 'bg-accent text-accent-foreground',\n outside: 'text-muted-foreground',\n }}\n {...props}\n />\n );\n}\n"],"names":["Calendar","showOutsideDays","props","defaultClassNames","getDefaultClassNames","jsx","DayPicker"],"mappings":"mJAuEO,SAASA,EAAS,CAAE,gBAAAC,EAAkB,GAAM,GAAGC,GAAS,CAC7D,MAAMC,EAAoBC,EAAAA,qBAAA,EAC1B,OACEC,EAAAA,IAACC,EAAAA,UAAA,CACC,KAAK,SACL,gBAAAL,EACA,WAAY,CACV,MAAO,mCACP,SACE,mIACF,KAAM,GAAGE,EAAkB,IAAI,iBAC/B,QAAS,GAAGA,EAAkB,OAAO,kBACrC,QAAS,4CACT,aACE,mIACF,UAAW,mCACX,QAAS,uBAAA,EAEV,GAAGD,CAAA,CAAA,CAGV"}
@@ -1,7 +1,6 @@
1
1
  import { DayPicker } from 'react-day-picker';
2
2
  export type CalendarProps = React.ComponentProps<typeof DayPicker>;
3
- declare function Calendar({ className, classNames, showOutsideDays, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
4
- declare namespace Calendar {
5
- var displayName: string;
6
- }
7
- export { Calendar };
3
+ export declare function Calendar({ showOutsideDays, ...props }: {
4
+ [x: string]: any;
5
+ showOutsideDays?: boolean | undefined;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,36 +1,26 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { ChevronRight as c, ChevronLeft as s } from "lucide-react";
3
- import { DayPicker as i } from "react-day-picker";
4
- import { buttonVariants as a } from "./Button.js";
5
- import { cn as e } from "../lib/utils.js";
6
- const l = () => t(s, { className: "h-4 w-4" }), m = () => t(c, { className: "h-4 w-4" });
7
- function u({ className: r, classNames: o, showOutsideDays: n = !0, ...d }) {
8
- return t(i, { showOutsideDays: n, className: e("p-3", r), classNames: {
9
- months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
10
- month: "space-y-4",
11
- caption: "flex justify-center pt-1 relative items-center",
12
- caption_label: "text-sm font-medium",
13
- nav: "space-x-1 flex items-center",
14
- nav_button: e(a({ intent: "outline" }), "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),
15
- nav_button_previous: "absolute left-1",
16
- nav_button_next: "absolute right-1",
17
- table: "w-full border-collapse space-y-1",
18
- head_row: "flex",
19
- head_cell: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
20
- row: "flex w-full mt-2",
21
- cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
22
- day: e(a({ intent: "ghost" }), "h-9 w-9 p-0 font-normal aria-selected:opacity-100"),
23
- day_range_end: "day-range-end",
24
- day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
25
- day_today: "bg-accent text-accent-foreground",
26
- day_outside: "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
27
- day_disabled: "text-muted-foreground opacity-50",
28
- day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
29
- day_hidden: "invisible",
30
- ...o
31
- }, components: { IconLeft: l, IconRight: m }, ...d });
2
+ import { getDefaultClassNames as a, DayPicker as m } from "react-day-picker";
3
+ function u({ showOutsideDays: e = !0, ...o }) {
4
+ const r = a();
5
+ return /* @__PURE__ */ t(
6
+ m,
7
+ {
8
+ mode: "single",
9
+ showOutsideDays: e,
10
+ classNames: {
11
+ today: "bg-accent text-accent-foreground",
12
+ selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
13
+ root: `${r.root} shadow-lg p-5`,
14
+ chevron: `${r.chevron} fill-amber-500`,
15
+ weekday: "text-muted-foreground font-normal text-sm",
16
+ day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
17
+ day_today: "bg-accent text-accent-foreground",
18
+ outside: "text-muted-foreground"
19
+ },
20
+ ...o
21
+ }
22
+ );
32
23
  }
33
- u.displayName = "Calendar";
34
24
  export {
35
25
  u as Calendar
36
26
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Calendar.js","sources":["../../src/elements/Calendar.tsx"],"sourcesContent":["'use client';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { DayPicker } from 'react-day-picker';\nimport { buttonVariants } from './Button';\nimport { cn } from '@/lib/utils';\nconst IconLeft = () => _jsx(ChevronLeft, { className: \"h-4 w-4\" });\nconst IconRight = () => _jsx(ChevronRight, { className: \"h-4 w-4\" });\nfunction Calendar({ className, classNames, showOutsideDays = true, ...props }) {\n return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn('p-3', className), classNames: {\n months: 'flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0',\n month: 'space-y-4',\n caption: 'flex justify-center pt-1 relative items-center',\n caption_label: 'text-sm font-medium',\n nav: 'space-x-1 flex items-center',\n nav_button: cn(buttonVariants({ intent: 'outline' }), 'h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100'),\n nav_button_previous: 'absolute left-1',\n nav_button_next: 'absolute right-1',\n table: 'w-full border-collapse space-y-1',\n head_row: 'flex',\n head_cell: 'text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]',\n row: 'flex w-full mt-2',\n cell: 'h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20',\n day: cn(buttonVariants({ intent: 'ghost' }), 'h-9 w-9 p-0 font-normal aria-selected:opacity-100'),\n day_range_end: 'day-range-end',\n day_selected: 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',\n day_today: 'bg-accent text-accent-foreground',\n day_outside: 'day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30',\n day_disabled: 'text-muted-foreground opacity-50',\n day_range_middle: 'aria-selected:bg-accent aria-selected:text-accent-foreground',\n day_hidden: 'invisible',\n ...classNames,\n }, components: { IconLeft, IconRight }, ...props }));\n}\nCalendar.displayName = 'Calendar';\nexport { Calendar };\n"],"names":["IconLeft","_jsx","ChevronLeft","IconRight","ChevronRight","Calendar","className","classNames","showOutsideDays","props","DayPicker","cn","buttonVariants"],"mappings":";;;;;AAMA,MAAMA,IAAW,MAAMC,EAAKC,GAAa,EAAE,WAAW,WAAW,GAC3DC,IAAY,MAAMF,EAAKG,GAAc,EAAE,WAAW,WAAW;AACnE,SAASC,EAAS,EAAE,WAAAC,GAAW,YAAAC,GAAY,iBAAAC,IAAkB,IAAM,GAAGC,KAAS;AACnE,SAAAR,EAAKS,GAAW,EAAE,iBAAAF,GAAkC,WAAWG,EAAG,OAAOL,CAAS,GAAG,YAAY;AAAA,IACjG,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,SAAS;AAAA,IACT,eAAe;AAAA,IACf,KAAK;AAAA,IACL,YAAYK,EAAGC,EAAe,EAAE,QAAQ,UAAU,CAAC,GAAG,yDAAyD;AAAA,IAC/G,qBAAqB;AAAA,IACrB,iBAAiB;AAAA,IACjB,OAAO;AAAA,IACP,UAAU;AAAA,IACV,WAAW;AAAA,IACX,KAAK;AAAA,IACL,MAAM;AAAA,IACN,KAAKD,EAAGC,EAAe,EAAE,QAAQ,QAAQ,CAAC,GAAG,mDAAmD;AAAA,IAChG,eAAe;AAAA,IACf,cAAc;AAAA,IACd,WAAW;AAAA,IACX,aAAa;AAAA,IACb,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,YAAY;AAAA,IACZ,GAAGL;AAAA,EAAA,GACJ,YAAY,EAAE,UAAAP,GAAU,WAAAG,KAAa,GAAGM,GAAO;AAC1D;AACAJ,EAAS,cAAc;"}
1
+ {"version":3,"file":"Calendar.js","sources":["../../src/elements/Calendar.tsx"],"sourcesContent":["/*\n'use client';\n\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { DayPicker } from 'react-day-picker';\n\nimport { buttonVariants } from './Button';\nimport { cn } from '@/lib/utils';\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>;\n\nconst ChevronLeftIcon = () => <ChevronLeft className=\"h-4 w-4\" />;\nconst ChevronRightIcon = () => <ChevronRight className=\"h-4 w-4\" />;\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn('p-3', className)}\n classNames={{\n months: 'flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0',\n month: 'space-y-4',\n caption: 'flex justify-center pt-1 relative items-center',\n caption_label: 'text-sm font-medium',\n nav: 'space-x-1 flex items-center',\n nav_button: cn(\n buttonVariants({ intent: 'outline' }),\n 'h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100',\n ),\n nav_button_previous: 'absolute left-1',\n nav_button_next: 'absolute right-1',\n table: 'w-full border-collapse space-y-1',\n head_row: 'flex',\n head_cell: 'text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]',\n row: 'flex w-full mt-2',\n cell: 'h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20',\n day: cn(\n buttonVariants({ intent: 'ghost' }),\n 'h-9 w-9 p-0 font-normal aria-selected:opacity-100',\n ),\n day_range_end: 'day-range-end',\n day_selected: 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',\n day_today: 'bg-accent text-accent-foreground',\n day_outside: 'day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30',\n day_disabled: 'text-muted-foreground opacity-50',\n day_range_middle: 'aria-selected:bg-accent aria-selected:text-accent-foreground',\n day_hidden: 'invisible',\n ...classNames,\n }}\n components={{ \n Chevron: ({ orientation }) => orientation === 'left' ? <ChevronLeftIcon /> : <ChevronRightIcon /> \n }}\n {...props}\n />\n );\n}\n\nCalendar.displayName = 'Calendar';\n\nexport { Calendar };\n*/\n\nimport { DayPicker, getDefaultClassNames } from 'react-day-picker';\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>;\n\nexport function Calendar({ showOutsideDays = true, ...props }) {\n const defaultClassNames = getDefaultClassNames();\n return (\n <DayPicker\n mode=\"single\"\n showOutsideDays={showOutsideDays}\n classNames={{\n today: 'bg-accent text-accent-foreground',\n selected:\n 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',\n root: `${defaultClassNames.root} shadow-lg p-5`,\n chevron: `${defaultClassNames.chevron} fill-amber-500`,\n weekday: 'text-muted-foreground font-normal text-sm',\n day_selected:\n 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',\n day_today: 'bg-accent text-accent-foreground',\n outside: 'text-muted-foreground',\n }}\n {...props}\n />\n );\n}\n"],"names":["Calendar","showOutsideDays","props","defaultClassNames","getDefaultClassNames","jsx","DayPicker"],"mappings":";;AAuEO,SAASA,EAAS,EAAE,iBAAAC,IAAkB,IAAM,GAAGC,KAAS;AAC7D,QAAMC,IAAoBC,EAAA;AAC1B,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,iBAAAL;AAAA,MACA,YAAY;AAAA,QACV,OAAO;AAAA,QACP,UACE;AAAA,QACF,MAAM,GAAGE,EAAkB,IAAI;AAAA,QAC/B,SAAS,GAAGA,EAAkB,OAAO;AAAA,QACrC,SAAS;AAAA,QACT,cACE;AAAA,QACF,WAAW;AAAA,QACX,SAAS;AAAA,MAAA;AAAA,MAEV,GAAGD;AAAA,IAAA;AAAA,EAAA;AAGV;"}
@@ -0,0 +1,10 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ import { Calendar } from './Calendar';
3
+ declare const meta: {
4
+ title: string;
5
+ tags: string[];
6
+ component: typeof Calendar;
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const Default: Story;
@@ -1 +1 @@
1
- {"version":3,"file":"Container.cjs","sources":["../../src/elements/Container.tsx"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { cn } from '@/lib/utils';\nconst baseCN = 'container mx-auto sm:max-w-screen-sm md:max-w-screen-md lg:max-w-screen-lg xl:max-w-screen-xl 2xl:max-w-screen-2xl px-4';\nconst Container = ({ as = 'div', children, className }) => {\n const Tag = as;\n return (_jsx(Tag, { className: cn(baseCN, className), children: children }));\n};\nexport default Container;\n"],"names":["baseCN","Container","as","children","className","Tag","_jsx","cn"],"mappings":"gFAEMA,EAAS,0HACTC,EAAY,CAAC,CAAE,GAAAC,EAAK,MAAO,SAAAC,EAAU,UAAAC,KAAgB,CACvD,MAAMC,EAAMH,EACJ,OAAAI,EAAA,IAAKD,EAAK,CAAE,UAAWE,KAAGP,EAAQI,CAAS,EAAG,SAAAD,EAAoB,CAC9E"}
1
+ {"version":3,"file":"Container.cjs","sources":["../../src/elements/Container.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 { ElementType, ReactNode } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst baseCN =\n 'container mx-auto sm:max-w-screen-sm md:max-w-screen-md lg:max-w-screen-lg xl:max-w-screen-xl 2xl:max-w-screen-2xl px-4';\n\ntype Props = {\n as?: ElementType;\n children?: ReactNode;\n className?: string;\n};\n\nconst Container = ({ as = 'div', children, className }: Props) => {\n const Tag = as;\n\n return <Tag className={cn(baseCN, className)}>{children}</Tag>;\n};\n\nexport default Container;\n"],"names":["baseCN","Container","as","children","className","Tag","cn"],"mappings":"gFAkBMA,EACJ,0HAQIC,EAAY,CAAC,CAAE,GAAAC,EAAK,MAAO,SAAAC,EAAU,UAAAC,KAAuB,CAChE,MAAMC,EAAMH,EAEZ,aAAQG,EAAA,CAAI,UAAWC,EAAAA,GAAGN,EAAQI,CAAS,EAAI,SAAAD,EAAS,CAC1D"}
@@ -1,4 +1,4 @@
1
- import type { ElementType, ReactNode } from 'react';
1
+ import { ElementType, ReactNode } from 'react';
2
2
  type Props = {
3
3
  as?: ElementType;
4
4
  children?: ReactNode;
@@ -1,6 +1,6 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
2
  import { cn as n } from "../lib/utils.js";
3
- const r = "container mx-auto sm:max-w-screen-sm md:max-w-screen-md lg:max-w-screen-lg xl:max-w-screen-xl 2xl:max-w-screen-2xl px-4", t = ({ as: e = "div", children: a, className: m }) => s(e, { className: n(r, m), children: a });
3
+ const r = "container mx-auto sm:max-w-screen-sm md:max-w-screen-md lg:max-w-screen-lg xl:max-w-screen-xl 2xl:max-w-screen-2xl px-4", t = ({ as: e = "div", children: a, className: m }) => /* @__PURE__ */ s(e, { className: n(r, m), children: a });
4
4
  export {
5
5
  t as default
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Container.js","sources":["../../src/elements/Container.tsx"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { cn } from '@/lib/utils';\nconst baseCN = 'container mx-auto sm:max-w-screen-sm md:max-w-screen-md lg:max-w-screen-lg xl:max-w-screen-xl 2xl:max-w-screen-2xl px-4';\nconst Container = ({ as = 'div', children, className }) => {\n const Tag = as;\n return (_jsx(Tag, { className: cn(baseCN, className), children: children }));\n};\nexport default Container;\n"],"names":["baseCN","Container","as","children","className","_jsx","cn"],"mappings":";;AAEA,MAAMA,IAAS,2HACTC,IAAY,CAAC,EAAE,IAAAC,IAAK,OAAO,UAAAC,GAAU,WAAAC,QAE/BC,EADIH,GACM,EAAE,WAAWI,EAAGN,GAAQI,CAAS,GAAG,UAAAD,GAAoB;"}
1
+ {"version":3,"file":"Container.js","sources":["../../src/elements/Container.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 { ElementType, ReactNode } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst baseCN =\n 'container mx-auto sm:max-w-screen-sm md:max-w-screen-md lg:max-w-screen-lg xl:max-w-screen-xl 2xl:max-w-screen-2xl px-4';\n\ntype Props = {\n as?: ElementType;\n children?: ReactNode;\n className?: string;\n};\n\nconst Container = ({ as = 'div', children, className }: Props) => {\n const Tag = as;\n\n return <Tag className={cn(baseCN, className)}>{children}</Tag>;\n};\n\nexport default Container;\n"],"names":["baseCN","Container","as","children","className","cn"],"mappings":";;AAkBA,MAAMA,IACJ,2HAQIC,IAAY,CAAC,EAAE,IAAAC,IAAK,OAAO,UAAAC,GAAU,WAAAC,0BAC7BF,GAEJ,EAAI,WAAWG,EAAGL,GAAQI,CAAS,GAAI,UAAAD,GAAS;"}
@@ -0,0 +1,14 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ tags: string[];
5
+ component: ({ as, children, className }: {
6
+ as?: import('react').ElementType;
7
+ children?: import('react').ReactNode;
8
+ className?: string;
9
+ }) => import("react/jsx-runtime").JSX.Element;
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Default: Story;
14
+ export declare const CustomStyling: Story;
@@ -1 +1 @@
1
- {"version":3,"file":"Body.cjs","sources":["../../../src/elements/DataTable/Body.tsx"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { cn } from '@/lib/utils';\nconst baseCls = 'divide-y divide-chrome-200 bg-background';\nconst Body = ({ className, ...props }) => (_jsx(\"tbody\", { ...props, className: cn(baseCls, className) }));\nBody.displayName = 'DataTableBody';\nexport default Body;\n"],"names":["baseCls","Body","className","props","_jsx","cn"],"mappings":"mFAEMA,EAAU,2CACVC,EAAO,CAAC,CAAE,UAAAC,EAAW,GAAGC,KAAaC,EAAAA,IAAK,QAAS,CAAE,GAAGD,EAAO,UAAWE,KAAGL,EAASE,CAAS,CAAG,CAAA,EACxGD,EAAK,YAAc"}
1
+ {"version":3,"file":"Body.cjs","sources":["../../../src/elements/DataTable/Body.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\nimport { cn } from '@/lib/utils';\n\nconst baseCls = 'divide-y divide-chrome-200 bg-background';\n\nconst Body = ({ className, ...props }: ComponentPropsWithoutRef<'tbody'>) => (\n <tbody {...props} className={cn(baseCls, className)} />\n);\n\nBody.displayName = 'DataTableBody';\n\nexport default Body;\n"],"names":["baseCls","Body","className","props","jsx","cn"],"mappings":"mFAkBMA,EAAU,2CAEVC,EAAO,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAA,IAC5BC,EAAAA,IAAC,QAAA,CAAO,GAAGD,EAAO,UAAWE,EAAAA,GAAGL,EAASE,CAAS,CAAA,CAAG,EAGvDD,EAAK,YAAc"}
@@ -1,4 +1,4 @@
1
- import type { ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithoutRef } from 'react';
2
2
  declare const Body: {
3
3
  ({ className, ...props }: ComponentPropsWithoutRef<"tbody">): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
@@ -1,6 +1,6 @@
1
1
  import { jsx as d } from "react/jsx-runtime";
2
2
  import { cn as e } from "../../lib/utils.js";
3
- const s = "divide-y divide-chrome-200 bg-background", t = ({ className: o, ...a }) => d("tbody", { ...a, className: e(s, o) });
3
+ const s = "divide-y divide-chrome-200 bg-background", t = ({ className: o, ...a }) => /* @__PURE__ */ d("tbody", { ...a, className: e(s, o) });
4
4
  t.displayName = "DataTableBody";
5
5
  export {
6
6
  t as default
@@ -1 +1 @@
1
- {"version":3,"file":"Body.js","sources":["../../../src/elements/DataTable/Body.tsx"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { cn } from '@/lib/utils';\nconst baseCls = 'divide-y divide-chrome-200 bg-background';\nconst Body = ({ className, ...props }) => (_jsx(\"tbody\", { ...props, className: cn(baseCls, className) }));\nBody.displayName = 'DataTableBody';\nexport default Body;\n"],"names":["baseCls","Body","className","props","_jsx","cn"],"mappings":";;AAEA,MAAMA,IAAU,4CACVC,IAAO,CAAC,EAAE,WAAAC,GAAW,GAAGC,QAAaC,EAAK,SAAS,EAAE,GAAGD,GAAO,WAAWE,EAAGL,GAASE,CAAS,EAAG,CAAA;AACxGD,EAAK,cAAc;"}
1
+ {"version":3,"file":"Body.js","sources":["../../../src/elements/DataTable/Body.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\nimport { cn } from '@/lib/utils';\n\nconst baseCls = 'divide-y divide-chrome-200 bg-background';\n\nconst Body = ({ className, ...props }: ComponentPropsWithoutRef<'tbody'>) => (\n <tbody {...props} className={cn(baseCls, className)} />\n);\n\nBody.displayName = 'DataTableBody';\n\nexport default Body;\n"],"names":["baseCls","Body","className","props","jsx","cn"],"mappings":";;AAkBA,MAAMA,IAAU,4CAEVC,IAAO,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,MAC5B,gBAAAC,EAAC,SAAA,EAAO,GAAGD,GAAO,WAAWE,EAAGL,GAASE,CAAS,EAAA,CAAG;AAGvDD,EAAK,cAAc;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DataCell.cjs","sources":["../../../src/elements/DataTable/DataCell.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 { useContext } from 'react';\nimport { cn } from '@/lib/utils';\nimport { Context as TableContext } from './shared';\nconst baseCls = 'whitespace-nowrap';\nconst sizeCNMap = {\n xs: 'px-2 py-1',\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 DataCell = ({ className, ...props }) => {\n const { size } = useContext(TableContext);\n return (_jsx(\"td\", { ...props, className: cn(baseCls, sizeCNMap[size], className) }));\n};\nDataCell.displayName = 'DataTableDataCell';\nexport default DataCell;\n"],"names":["baseCls","sizeCNMap","DataCell","className","props","size","useContext","TableContext","_jsx","cn"],"mappings":"gIAiBMA,EAAU,oBACVC,EAAY,CACd,GAAI,YACJ,GAAI,cACJ,GAAI,cACJ,GAAI,cACJ,GAAI,aACR,EACMC,EAAW,CAAC,CAAE,UAAAC,EAAW,GAAGC,KAAY,CAC1C,KAAM,CAAE,KAAAC,CAAA,EAASC,EAAA,WAAWC,SAAY,EACxC,OAAQC,MAAK,KAAM,CAAE,GAAGJ,EAAO,UAAWK,KAAGT,EAASC,EAAUI,CAAI,EAAGF,CAAS,EAAG,CACvF,EACAD,EAAS,YAAc"}
1
+ {"version":3,"file":"DataCell.cjs","sources":["../../../src/elements/DataTable/DataCell.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 { useContext } from 'react';\nimport type { ComponentPropsWithoutRef } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Context as TableContext } from './shared';\nimport type { DataTableSize } from './shared';\n\nconst baseCls = 'whitespace-nowrap';\n\nconst sizeCNMap: Record<DataTableSize, string> = {\n xs: 'px-2 py-1',\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\nconst DataCell = ({ className, ...props }: ComponentPropsWithoutRef<'td'>) => {\n const { size } = useContext(TableContext);\n\n return <td {...props} className={cn(baseCls, sizeCNMap[size], className)} />;\n};\n\nDataCell.displayName = 'DataTableDataCell';\n\nexport default DataCell;\n"],"names":["baseCls","sizeCNMap","DataCell","className","props","size","useContext","TableContext","jsx","cn"],"mappings":"gIAsBMA,EAAU,oBAEVC,EAA2C,CAC/C,GAAI,YACJ,GAAI,cACJ,GAAI,cACJ,GAAI,cACJ,GAAI,aACN,EAEMC,EAAW,CAAC,CAAE,UAAAC,EAAW,GAAGC,KAA4C,CAC5E,KAAM,CAAE,KAAAC,CAAA,EAASC,EAAAA,WAAWC,SAAY,EAExC,OAAOC,MAAC,KAAA,CAAI,GAAGJ,EAAO,UAAWK,KAAGT,EAASC,EAAUI,CAAI,EAAGF,CAAS,CAAA,CAAG,CAC5E,EAEAD,EAAS,YAAc"}
@@ -1,4 +1,4 @@
1
- import type { ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithoutRef } from 'react';
2
2
  declare const DataCell: {
3
3
  ({ className, ...props }: ComponentPropsWithoutRef<"td">): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
@@ -10,7 +10,7 @@ const r = "whitespace-nowrap", l = {
10
10
  xl: "px-3 py-3.5"
11
11
  }, x = ({ className: t, ...p }) => {
12
12
  const { size: a } = e(m);
13
- return s("td", { ...p, className: o(r, l[a], t) });
13
+ return /* @__PURE__ */ s("td", { ...p, className: o(r, l[a], t) });
14
14
  };
15
15
  x.displayName = "DataTableDataCell";
16
16
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"DataCell.js","sources":["../../../src/elements/DataTable/DataCell.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 { useContext } from 'react';\nimport { cn } from '@/lib/utils';\nimport { Context as TableContext } from './shared';\nconst baseCls = 'whitespace-nowrap';\nconst sizeCNMap = {\n xs: 'px-2 py-1',\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 DataCell = ({ className, ...props }) => {\n const { size } = useContext(TableContext);\n return (_jsx(\"td\", { ...props, className: cn(baseCls, sizeCNMap[size], className) }));\n};\nDataCell.displayName = 'DataTableDataCell';\nexport default DataCell;\n"],"names":["baseCls","sizeCNMap","DataCell","className","props","size","useContext","TableContext","_jsx","cn"],"mappings":";;;;AAiBA,MAAMA,IAAU,qBACVC,IAAY;AAAA,EACd,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACR,GACMC,IAAW,CAAC,EAAE,WAAAC,GAAW,GAAGC,QAAY;AAC1C,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAWC,CAAY;AACxC,SAAQC,EAAK,MAAM,EAAE,GAAGJ,GAAO,WAAWK,EAAGT,GAASC,EAAUI,CAAI,GAAGF,CAAS,GAAG;AACvF;AACAD,EAAS,cAAc;"}
1
+ {"version":3,"file":"DataCell.js","sources":["../../../src/elements/DataTable/DataCell.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 { useContext } from 'react';\nimport type { ComponentPropsWithoutRef } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Context as TableContext } from './shared';\nimport type { DataTableSize } from './shared';\n\nconst baseCls = 'whitespace-nowrap';\n\nconst sizeCNMap: Record<DataTableSize, string> = {\n xs: 'px-2 py-1',\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\nconst DataCell = ({ className, ...props }: ComponentPropsWithoutRef<'td'>) => {\n const { size } = useContext(TableContext);\n\n return <td {...props} className={cn(baseCls, sizeCNMap[size], className)} />;\n};\n\nDataCell.displayName = 'DataTableDataCell';\n\nexport default DataCell;\n"],"names":["baseCls","sizeCNMap","DataCell","className","props","size","useContext","TableContext","jsx","cn"],"mappings":";;;;AAsBA,MAAMA,IAAU,qBAEVC,IAA2C;AAAA,EAC/C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEMC,IAAW,CAAC,EAAE,WAAAC,GAAW,GAAGC,QAA4C;AAC5E,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAWC,CAAY;AAExC,SAAO,gBAAAC,EAAC,MAAA,EAAI,GAAGJ,GAAO,WAAWK,EAAGT,GAASC,EAAUI,CAAI,GAAGF,CAAS,EAAA,CAAG;AAC5E;AAEAD,EAAS,cAAc;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Header.cjs","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":"qMAgBMA,EAAU,eACVC,EAAO,IAAM,CAAE,EACRC,EAAUC,EAAAA,cAAc,CACjC,OAAQ,KACR,eAAgBF,CACpB,CAAC,EACKG,EAAS,CAAC,CAAE,UAAAC,EAAW,OAAAC,EAAQ,eAAAC,EAAgB,GAAGC,KAAY,CAC1D,MAAAC,EAAUC,EAAAA,QAAQ,KAAO,CAC3B,OAAQJ,GAAU,KAClB,eAAgBC,GAAkBN,CAAA,GAClC,CAACK,EAAQC,CAAc,CAAC,EAC5B,OAAQI,EAAAA,IAAKT,EAAQ,SAAU,CAAE,MAAOO,EAAS,SAAUE,EAAK,IAAA,QAAS,CAAE,GAAGH,EAAO,UAAWI,EAAAA,GAAGZ,EAASK,CAAS,CAAG,CAAA,EAAG,CAC/H,EACAD,EAAO,YAAc"}
1
+ {"version":3,"file":"Header.cjs","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":"qMAmBMA,EAAU,eACVC,EAAO,IAAM,CAAC,EAmBPC,EAAUC,EAAAA,cAA6B,CAClD,OAAQ,KACR,eAAgBF,CAClB,CAAC,EAEKG,EAAS,CAAC,CAAE,UAAAC,EAAW,OAAAC,EAAQ,eAAAC,EAAgB,GAAGC,KAAmB,CACzE,MAAMC,EAAUC,EAAAA,QACd,KAAO,CACL,OAAQJ,GAAU,KAClB,eAAgBC,GAAkBN,CAAA,GAEpC,CAACK,EAAQC,CAAc,CAAA,EAGzB,OACEI,EAAAA,IAACT,EAAQ,SAAR,CAAiB,MAAOO,EACvB,SAAAE,EAAAA,IAAC,QAAA,CAAO,GAAGH,EAAO,UAAWI,EAAAA,GAAGZ,EAASK,CAAS,EAAG,EACvD,CAEJ,EAEAD,EAAO,YAAc"}
@@ -1,4 +1,4 @@
1
- import type { ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithoutRef } from 'react';
2
2
  export type SortBy = {
3
3
  field: string;
4
4
  direction: 'ASC' | 'DESC';
@@ -12,7 +12,7 @@ type SortByContext = {
12
12
  sortBy: SortBy | null;
13
13
  onSortByChange: OnSortByChange;
14
14
  };
15
- export declare const Context: import("react").Context<SortByContext>;
15
+ export declare const Context: import('react').Context<SortByContext>;
16
16
  declare const Header: {
17
17
  ({ className, sortBy, onSortByChange, ...props }: Props): import("react/jsx-runtime").JSX.Element;
18
18
  displayName: string;
@@ -6,11 +6,14 @@ const d = "bg-chrome-50", r = () => {
6
6
  sortBy: null,
7
7
  onSortByChange: r
8
8
  }), p = ({ className: a, sortBy: e, onSortByChange: o, ...n }) => {
9
- const s = l(() => ({
10
- sortBy: e || null,
11
- onSortByChange: o || r
12
- }), [e, o]);
13
- return t(i.Provider, { value: s, children: t("thead", { ...n, className: m(d, a) }) });
9
+ const s = l(
10
+ () => ({
11
+ sortBy: e || null,
12
+ onSortByChange: o || r
13
+ }),
14
+ [e, o]
15
+ );
16
+ return /* @__PURE__ */ t(i.Provider, { value: s, children: /* @__PURE__ */ t("thead", { ...n, className: m(d, a) }) });
14
17
  };
15
18
  p.displayName = "DataTableHeader";
16
19
  export {