@kubetail/ui 0.1.3-rc20

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 (91) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +50 -0
  3. package/dist/elements/Alert.cjs +1 -0
  4. package/dist/elements/Alert.d.ts +9 -0
  5. package/dist/elements/Alert.js +6 -0
  6. package/dist/elements/Alert.test.d.ts +1 -0
  7. package/dist/elements/Button.cjs +1 -0
  8. package/dist/elements/Button.d.ts +10 -0
  9. package/dist/elements/Button.js +40 -0
  10. package/dist/elements/Button.test.d.ts +1 -0
  11. package/dist/elements/Calendar.cjs +1 -0
  12. package/dist/elements/Calendar.d.ts +8 -0
  13. package/dist/elements/Calendar.js +36 -0
  14. package/dist/elements/Container.cjs +1 -0
  15. package/dist/elements/Container.d.ts +8 -0
  16. package/dist/elements/Container.js +6 -0
  17. package/dist/elements/Container.test.d.ts +1 -0
  18. package/dist/elements/DataTable/Body.cjs +1 -0
  19. package/dist/elements/DataTable/Body.d.ts +6 -0
  20. package/dist/elements/DataTable/Body.js +7 -0
  21. package/dist/elements/DataTable/DataCell.cjs +1 -0
  22. package/dist/elements/DataTable/DataCell.d.ts +6 -0
  23. package/dist/elements/DataTable/DataCell.js +18 -0
  24. package/dist/elements/DataTable/Header.cjs +1 -0
  25. package/dist/elements/DataTable/Header.d.ts +20 -0
  26. package/dist/elements/DataTable/Header.js +19 -0
  27. package/dist/elements/DataTable/HeaderCell.cjs +1 -0
  28. package/dist/elements/DataTable/HeaderCell.d.ts +10 -0
  29. package/dist/elements/DataTable/HeaderCell.js +23 -0
  30. package/dist/elements/DataTable/Row.cjs +1 -0
  31. package/dist/elements/DataTable/Row.d.ts +6 -0
  32. package/dist/elements/DataTable/Row.js +6 -0
  33. package/dist/elements/DataTable/index.cjs +1 -0
  34. package/dist/elements/DataTable/index.d.ts +29 -0
  35. package/dist/elements/DataTable/index.js +32 -0
  36. package/dist/elements/Form.cjs +1 -0
  37. package/dist/elements/Form.d.ts +23 -0
  38. package/dist/elements/Form.js +26 -0
  39. package/dist/elements/Form.test.d.ts +1 -0
  40. package/dist/elements/FormCheck.cjs +1 -0
  41. package/dist/elements/FormCheck.d.ts +8 -0
  42. package/dist/elements/FormCheck.js +11 -0
  43. package/dist/elements/FormCheck.test.d.ts +1 -0
  44. package/dist/elements/FormControl.cjs +1 -0
  45. package/dist/elements/FormControl.d.ts +13 -0
  46. package/dist/elements/FormControl.js +16 -0
  47. package/dist/elements/FormControl.test.d.ts +1 -0
  48. package/dist/elements/FormControlFeedback.cjs +1 -0
  49. package/dist/elements/FormControlFeedback.d.ts +9 -0
  50. package/dist/elements/FormControlFeedback.js +7 -0
  51. package/dist/elements/FormControlFeedback.test.d.ts +1 -0
  52. package/dist/elements/FormFeedback.cjs +1 -0
  53. package/dist/elements/FormFeedback.d.ts +9 -0
  54. package/dist/elements/FormFeedback.js +7 -0
  55. package/dist/elements/FormFeedback.test.d.ts +1 -0
  56. package/dist/elements/FormFieldset.cjs +1 -0
  57. package/dist/elements/FormFieldset.d.ts +3 -0
  58. package/dist/elements/FormFieldset.js +8 -0
  59. package/dist/elements/FormFieldset.test.d.ts +1 -0
  60. package/dist/elements/FormGroup.cjs +1 -0
  61. package/dist/elements/FormGroup.d.ts +11 -0
  62. package/dist/elements/FormGroup.js +12 -0
  63. package/dist/elements/FormGroup.test.d.ts +1 -0
  64. package/dist/elements/FormLabel.cjs +1 -0
  65. package/dist/elements/FormLabel.d.ts +7 -0
  66. package/dist/elements/FormLabel.js +12 -0
  67. package/dist/elements/FormLabel.test.d.ts +1 -0
  68. package/dist/elements/FormOption.cjs +1 -0
  69. package/dist/elements/FormOption.d.ts +3 -0
  70. package/dist/elements/FormOption.js +7 -0
  71. package/dist/elements/FormSelect.cjs +1 -0
  72. package/dist/elements/FormSelect.d.ts +6 -0
  73. package/dist/elements/FormSelect.js +12 -0
  74. package/dist/elements/Popover.cjs +1 -0
  75. package/dist/elements/Popover.d.ts +8 -0
  76. package/dist/elements/Popover.js +13 -0
  77. package/dist/elements/Spinner.cjs +1 -0
  78. package/dist/elements/Spinner.d.ts +7 -0
  79. package/dist/elements/Spinner.js +11 -0
  80. package/dist/elements/Tabs.cjs +1 -0
  81. package/dist/elements/Tabs.d.ts +7 -0
  82. package/dist/elements/Tabs.js +16 -0
  83. package/dist/index.cjs +1 -0
  84. package/dist/index.js +1 -0
  85. package/dist/lib/utils.cjs +1 -0
  86. package/dist/lib/utils.d.ts +2 -0
  87. package/dist/lib/utils.js +8 -0
  88. package/dist/plugin.cjs +1 -0
  89. package/dist/plugin.d.ts +8 -0
  90. package/dist/plugin.js +159 -0
  91. package/package.json +97 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # kubetail-ui
2
+
3
+ Kubetail-UI is a project for developing and sharing React components and other UI elements for Kubetail
4
+
5
+ ## Getting started
6
+
7
+ First, install the dependencies:
8
+
9
+ ```sh
10
+ pnpm install
11
+ ```
12
+
13
+ Next, run storybook:
14
+
15
+ ```sh
16
+ pnpm storybook
17
+ ```
18
+
19
+ Open [http://localhost:6006](http://localhost:6006) in your browser to see the components.
20
+
21
+ ## Scripts
22
+
23
+ * build - Run the build script (`$ pnpm build`)
24
+ * lint - Run the linter (`$ pnpm lint`)
25
+ * test - Run the unit tests (`$ pnpm test`)
26
+ * storybook - Run the storybook development server (`$ pnpm storybook`)
27
+ * build-storybook - Run the storybook build script (`$ pnpm build-storybook`)
28
+
29
+ ## Integrate kubetail-ui into your Tailwind CSS project
30
+
31
+ 1. Install `kubetail-ui` package (replace X.Y.Z with desired version)
32
+
33
+ ```bash
34
+ pnpm add git+ssh://git@github.com/kubetail-org/kubetail-ui.git#vX.Y.Z
35
+ ```
36
+
37
+ 2. Modify your Tailwind config file
38
+
39
+ ```javascript
40
+ module.exports = {
41
+ content: [
42
+ ...
43
+ "./node_modules/kubetail-ui/esm/*.js"
44
+ ],
45
+ plugins: [
46
+ ...
47
+ require('kubetail-ui/plugin')
48
+ ]
49
+ }
50
+ ```
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),l=require("@heroicons/react/24/solid"),t=({children:s})=>e.jsx("div",{className:"rounded-md bg-yellow-50 p-4",children:e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx(l.ExclamationTriangleIcon,{className:"h-5 w-5 text-yellow-400","aria-hidden":"true"})}),e.jsxs("div",{className:"ml-3",children:[e.jsx("h3",{className:"text-sm font-medium text-yellow-800",children:"Attention"}),e.jsx("div",{className:"mt-2 text-sm text-yellow-700",children:e.jsx("div",{children:s})})]})]})});module.exports=t;
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from 'react';
2
+ type Props = {
3
+ children?: ReactNode;
4
+ };
5
+ /**
6
+ * UI component for displaying alerts
7
+ */
8
+ declare const Alert: ({ children }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export default Alert;
@@ -0,0 +1,6 @@
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
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 }) })] })] }) });
4
+ export {
5
+ d as default
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react/jsx-runtime"),g=require("@restart/ui/Button"),m=require("class-variance-authority"),l=require("react"),b=require("../lib/utils.cjs"),r=m.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",{variants:{intent:{primary:"bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/60 shadow-sm",danger:"bg-danger text-danger-foreground hover:bg-danger/90 shadow-sm",outline:"border border-input bg-background hover:bg-secondary hover:text-secondary-foreground",ghost:"hover:bg-secondary hover:text-secondary-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{xs:"px-2.5 py-1.5 text-xs rounded",sm:"px-3 py-2 text-xs rounded-md",md:"px-4 py-2 text-sm rounded-md",lg:"px-4 py-2 text-base rounded-md",xl:"px-6 py-3 text-base rounded-md"}},defaultVariants:{intent:"primary",size:"md"}}),t=l.forwardRef(({as:n,children:o,className:s,disabled:a,...e},i)=>{const[d,{tagName:u}]=g.useButtonProps({tagName:n,disabled:a,...e});return c.jsx(u,{...e,...d,ref:i,className:b.cn(r(e),s),children:o})});t.displayName="Button";exports.buttonVariants=r;exports.default=t;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import type { ButtonProps } from '@restart/ui/Button';
3
+ import { type VariantProps } from 'class-variance-authority';
4
+ export type ButtonVariantProps = VariantProps<typeof buttonVariants>;
5
+ export declare const buttonVariants: (props?: ({
6
+ intent?: "link" | "danger" | "primary" | "secondary" | "outline" | "ghost" | null | undefined;
7
+ size?: "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
8
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
+ declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & ButtonVariantProps & import("react").RefAttributes<unknown>>;
10
+ export default Button;
@@ -0,0 +1,40 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { useButtonProps as m } from "@restart/ui/Button";
3
+ import { cva as u } from "class-variance-authority";
4
+ import { forwardRef as g } from "react";
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"
15
+ },
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"
22
+ }
23
+ },
24
+ defaultVariants: {
25
+ intent: "primary",
26
+ size: "md"
27
+ }
28
+ }), c = g(({ as: r, children: o, className: t, disabled: n, ...e }, s) => {
29
+ const [a, { tagName: d }] = m({
30
+ tagName: r,
31
+ disabled: n,
32
+ ...e
33
+ });
34
+ return i(d, { ...e, ...a, ref: s, className: p(f(e), t), children: o });
35
+ });
36
+ c.displayName = "Button";
37
+ export {
38
+ f as buttonVariants,
39
+ c as default
40
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
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;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { DayPicker } from 'react-day-picker';
3
+ export type CalendarProps = React.ComponentProps<typeof DayPicker>;
4
+ declare function Calendar({ className, classNames, showOutsideDays, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
5
+ declare namespace Calendar {
6
+ var displayName: string;
7
+ }
8
+ export { Calendar };
@@ -0,0 +1,36 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { ChevronLeft as c, ChevronRight 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(c, { className: "h-4 w-4" }), m = () => t(s, { 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 });
32
+ }
33
+ u.displayName = "Calendar";
34
+ export {
35
+ u as Calendar
36
+ };
@@ -0,0 +1 @@
1
+ "use strict";const c=require("react/jsx-runtime"),t=require("../lib/utils.cjs"),x="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",a=({as:e="div",children:s,className:n})=>{const r=e;return c.jsx(r,{className:t.cn(x,n),children:s})};module.exports=a;
@@ -0,0 +1,8 @@
1
+ import type { ElementType, ReactNode } from 'react';
2
+ type Props = {
3
+ as?: ElementType;
4
+ children?: ReactNode;
5
+ className?: string;
6
+ };
7
+ declare const Container: ({ as, children, className }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export default Container;
@@ -0,0 +1,6 @@
1
+ import { jsx as s } from "react/jsx-runtime";
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 });
4
+ export {
5
+ t as default
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";const i=require("react/jsx-runtime"),o=require("../../lib/utils.cjs"),a="divide-y divide-chrome-200 bg-background",s=({className:e,...t})=>i.jsx("tbody",{...t,className:o.cn(a,e)});s.displayName="DataTableBody";module.exports=s;
@@ -0,0 +1,6 @@
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+ declare const Body: {
3
+ ({ className, ...props }: ComponentPropsWithoutRef<'tbody'>): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default Body;
@@ -0,0 +1,7 @@
1
+ import { jsx as d } from "react/jsx-runtime";
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) });
4
+ t.displayName = "DataTableBody";
5
+ export {
6
+ t as default
7
+ };
@@ -0,0 +1 @@
1
+ "use strict";const n=require("react/jsx-runtime"),p=require("react"),r=require("../../lib/utils.cjs"),c=require("./index.cjs"),x="whitespace-nowrap",i={xs:"px-2 py-1",sm:"px-2 py-1.5",md:"px-3 py-3.5",lg:"px-3 py-3.5",xl:"px-3 py-3.5"},e=({className:s,...t})=>{const{size:a}=p.useContext(c.Context);return n.jsx("td",{...t,className:r.cn(x,i[a],s)})};e.displayName="DataTableDataCell";module.exports=e;
@@ -0,0 +1,6 @@
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+ declare const DataCell: {
3
+ ({ className, ...props }: ComponentPropsWithoutRef<'td'>): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default DataCell;
@@ -0,0 +1,18 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { useContext as e } from "react";
3
+ import { cn as o } from "../../lib/utils.js";
4
+ import { Context as m } from "./index.js";
5
+ const r = "whitespace-nowrap", l = {
6
+ xs: "px-2 py-1",
7
+ sm: "px-2 py-1.5",
8
+ md: "px-3 py-3.5",
9
+ lg: "px-3 py-3.5",
10
+ xl: "px-3 py-3.5"
11
+ }, x = ({ className: t, ...p }) => {
12
+ const { size: a } = e(m);
13
+ return s("td", { ...p, className: o(r, l[a], t) });
14
+ };
15
+ x.displayName = "DataTableDataCell";
16
+ export {
17
+ x as default
18
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),o=require("react"),d=require("../../lib/utils.cjs"),x="bg-chrome-50",n=()=>{},r=o.createContext({sortBy:null,onSortByChange:n}),s=({className:a,sortBy:c,onSortByChange:l,...u})=>{const e={sortBy:c||null,onSortByChange:l||n},i=o.useMemo(()=>e,[e]);return t.jsx(r.Provider,{value:i,children:t.jsx("thead",{...u,className:d.cn(x,a)})})};s.displayName="DataTableHeader";exports.Context=r;exports.default=s;
@@ -0,0 +1,20 @@
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+ export type SortBy = {
3
+ field: string;
4
+ direction: 'ASC' | 'DESC';
5
+ };
6
+ type OnSortByChange = (newSortBy: SortBy) => void;
7
+ interface Props extends ComponentPropsWithoutRef<'thead'> {
8
+ sortBy?: SortBy;
9
+ onSortByChange?: OnSortByChange;
10
+ }
11
+ type SortByContext = {
12
+ sortBy: SortBy | null;
13
+ onSortByChange: OnSortByChange;
14
+ };
15
+ export declare const Context: import("react").Context<SortByContext>;
16
+ declare const Header: {
17
+ ({ className, sortBy, onSortByChange, ...props }: Props): import("react/jsx-runtime").JSX.Element;
18
+ displayName: string;
19
+ };
20
+ export default Header;
@@ -0,0 +1,19 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { createContext as l, useMemo as m } from "react";
3
+ import { cn as d } from "../../lib/utils.js";
4
+ const u = "bg-chrome-50", t = () => {
5
+ }, i = l({
6
+ sortBy: null,
7
+ onSortByChange: t
8
+ }), p = ({ className: r, sortBy: n, onSortByChange: a, ...s }) => {
9
+ const o = {
10
+ sortBy: n || null,
11
+ onSortByChange: a || t
12
+ }, c = m(() => o, [o]);
13
+ return e(i.Provider, { value: c, children: e("thead", { ...s, className: d(u, r) }) });
14
+ };
15
+ p.displayName = "DataTableHeader";
16
+ export {
17
+ i as Context,
18
+ p as default
19
+ };
@@ -0,0 +1 @@
1
+ "use strict";const s=require("react/jsx-runtime"),c=require("@heroicons/react/20/solid"),r=require("react"),l=require("../../lib/utils.cjs"),d=require("./index.cjs"),h=require("./Header.cjs"),f="text-left font-semibold text-chrome-900 select-none",N="ml-2 flex-none text-chrome-400 group-hover:visible group-focus:visible",b={xs:"px-2 py-1.5",sm:"px-2 py-1.5",md:"px-3 py-3.5",lg:"px-3 py-3.5",xl:"px-3 py-3.5"},a=({children:o,className:x,sortField:n,initialSortDirection:p="ASC",...C})=>{const{size:u}=r.useContext(d.Context),{sortBy:e,onSortByChange:m}=r.useContext(h.Context),i=e&&e.field===n?e.direction:p;return s.jsxs("th",{...C,className:l.cn(f,b[u],x),children:[n&&s.jsxs("span",{className:"group inline-flex cursor-pointer",onClick:()=>{let t=i;(e==null?void 0:e.field)===n&&(t=t==="ASC"?"DESC":"ASC"),m({field:n,direction:t})},children:[o,s.jsx("span",{className:l.cn(N,(e==null?void 0:e.field)===n?"visible":"invisible"),children:i==="ASC"?s.jsx(c.ChevronUpIcon,{className:"h-5 w-5"}):s.jsx(c.ChevronDownIcon,{className:"h-5 w-5"})})]}),!n&&o]})};a.displayName="DataTableHeaderCell";module.exports=a;
@@ -0,0 +1,10 @@
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+ interface Props extends ComponentPropsWithoutRef<'th'> {
3
+ sortField?: string;
4
+ initialSortDirection?: 'ASC' | 'DESC';
5
+ }
6
+ declare const HeaderCell: {
7
+ ({ children, className, sortField, initialSortDirection, ...props }: Props): import("react/jsx-runtime").JSX.Element;
8
+ displayName: string;
9
+ };
10
+ export default HeaderCell;
@@ -0,0 +1,23 @@
1
+ import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
+ import { ChevronUpIcon as f, ChevronDownIcon as h } from "@heroicons/react/20/solid";
3
+ import { useContext as c } from "react";
4
+ import { cn as l } from "../../lib/utils.js";
5
+ import { Context as d } from "./index.js";
6
+ import { Context as N } from "./Header.js";
7
+ const u = "text-left font-semibold text-chrome-900 select-none", b = "ml-2 flex-none text-chrome-400 group-hover:visible group-focus:visible", v = {
8
+ xs: "px-2 py-1.5",
9
+ sm: "px-2 py-1.5",
10
+ md: "px-3 py-3.5",
11
+ lg: "px-3 py-3.5",
12
+ xl: "px-3 py-3.5"
13
+ }, S = ({ children: i, className: p, sortField: o, initialSortDirection: a = "ASC", ...m }) => {
14
+ const { size: x } = c(d), { sortBy: e, onSortByChange: C } = c(N), s = e && e.field === o ? e.direction : a;
15
+ return r("th", { ...m, className: l(u, v[x], p), children: [o && r("span", { className: "group inline-flex cursor-pointer", onClick: () => {
16
+ let n = s;
17
+ (e == null ? void 0 : e.field) === o && (n = n === "ASC" ? "DESC" : "ASC"), C({ field: o, direction: n });
18
+ }, children: [i, t("span", { className: l(b, (e == null ? void 0 : e.field) === o ? "visible" : "invisible"), children: s === "ASC" ? t(f, { className: "h-5 w-5" }) : t(h, { className: "h-5 w-5" }) })] }), !o && i] });
19
+ };
20
+ S.displayName = "DataTableHeaderCell";
21
+ export {
22
+ S as default
23
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),s=t=>e.jsx("tr",{...t});s.displayName="DataTableRow";module.exports=s;
@@ -0,0 +1,6 @@
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+ declare const Row: {
3
+ (props: ComponentPropsWithoutRef<'tr'>): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default Row;
@@ -0,0 +1,6 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ const t = (a) => o("tr", { ...a });
3
+ t.displayName = "DataTableRow";
4
+ export {
5
+ t as default
6
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),a=require("react"),r=require("../../lib/utils.cjs"),d=require("./Body.cjs"),u=require("./DataCell.cjs"),x=require("./Header.cjs"),m=require("./HeaderCell.cjs"),b=require("./Row.cjs"),o=a.createContext({size:"md"}),v="overflow-hidden shadow ring-1 ring-black ring-opacity-5 rounded-lg",g={xs:"text-xs",sm:"text-sm",md:"text-sm",lg:"text-base",xl:"text-base"},n=({className:l,children:c,size:e="md"})=>{const s={size:e},i=a.useMemo(()=>s,[s]);return t.jsx(o.Provider,{value:i,children:t.jsx("div",{className:r.cn(v,l),children:t.jsx("table",{className:r.cn("min-w-full divide-y divide-chrome-300",e&&g[e]),children:c})})})};n.displayName="DataTable";const q=Object.assign(n,{Body:d,DataCell:u,Header:x.default,HeaderCell:m,Row:b});exports.Context=o;exports.default=q;
@@ -0,0 +1,29 @@
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
+ export type DataTableSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
8
+ type DataTableContext = {
9
+ size: DataTableSize;
10
+ };
11
+ export declare const Context: import("react").Context<DataTableContext>;
12
+ interface Props extends PropsWithChildren {
13
+ className?: string;
14
+ size?: DataTableSize;
15
+ }
16
+ declare const DataTable: {
17
+ ({ className, children, size, }: Props): import("react/jsx-runtime").JSX.Element;
18
+ displayName: string;
19
+ };
20
+ type DataTableType = typeof DataTable;
21
+ interface DataTableExportType extends DataTableType {
22
+ Body: typeof Body;
23
+ DataCell: typeof DataCell;
24
+ Header: typeof Header;
25
+ HeaderCell: typeof HeaderCell;
26
+ Row: typeof Row;
27
+ }
28
+ declare const DataTableExport: DataTableExportType;
29
+ export default DataTableExport;