@kubetail/ui 0.2.0 → 0.3.0-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/elements/Alert.cjs.map +1 -1
- package/dist/elements/Alert.d.ts +1 -1
- package/dist/elements/Alert.js +7 -1
- package/dist/elements/Alert.js.map +1 -1
- package/dist/elements/Alert.stories.d.ts +11 -0
- package/dist/elements/Button.cjs.map +1 -1
- package/dist/elements/Button.d.ts +6 -6
- package/dist/elements/Button.js +24 -21
- package/dist/elements/Button.js.map +1 -1
- package/dist/elements/Button.stories.d.ts +15 -0
- package/dist/elements/Calendar.cjs +1 -1
- package/dist/elements/Calendar.cjs.map +1 -1
- package/dist/elements/Calendar.d.ts +4 -5
- package/dist/elements/Calendar.js +21 -31
- package/dist/elements/Calendar.js.map +1 -1
- package/dist/elements/Calendar.stories.d.ts +10 -0
- package/dist/elements/Container.cjs.map +1 -1
- package/dist/elements/Container.d.ts +1 -1
- package/dist/elements/Container.js +1 -1
- package/dist/elements/Container.js.map +1 -1
- package/dist/elements/Container.stories.d.ts +14 -0
- package/dist/elements/DataTable/Body.cjs.map +1 -1
- package/dist/elements/DataTable/Body.d.ts +1 -1
- package/dist/elements/DataTable/Body.js +1 -1
- package/dist/elements/DataTable/Body.js.map +1 -1
- package/dist/elements/DataTable/DataCell.cjs.map +1 -1
- package/dist/elements/DataTable/DataCell.d.ts +1 -1
- package/dist/elements/DataTable/DataCell.js +1 -1
- package/dist/elements/DataTable/DataCell.js.map +1 -1
- package/dist/elements/DataTable/Header.cjs.map +1 -1
- package/dist/elements/DataTable/Header.d.ts +2 -2
- package/dist/elements/DataTable/Header.js +8 -5
- package/dist/elements/DataTable/Header.js.map +1 -1
- package/dist/elements/DataTable/HeaderCell.cjs.map +1 -1
- package/dist/elements/DataTable/HeaderCell.d.ts +1 -1
- package/dist/elements/DataTable/HeaderCell.js +20 -4
- package/dist/elements/DataTable/HeaderCell.js.map +1 -1
- package/dist/elements/DataTable/Row.cjs.map +1 -1
- package/dist/elements/DataTable/Row.d.ts +1 -1
- package/dist/elements/DataTable/Row.js +1 -1
- package/dist/elements/DataTable/Row.js.map +1 -1
- package/dist/elements/DataTable/index.cjs.map +1 -1
- package/dist/elements/DataTable/index.d.ts +9 -9
- package/dist/elements/DataTable/index.js +1 -1
- package/dist/elements/DataTable/index.js.map +1 -1
- package/dist/elements/DataTable/shared.cjs.map +1 -1
- package/dist/elements/DataTable/shared.d.ts +1 -1
- package/dist/elements/DataTable/shared.js.map +1 -1
- package/dist/elements/DataTable.stories.d.ts +11 -0
- package/dist/elements/DropdownMenu.cjs.map +1 -1
- package/dist/elements/DropdownMenu.d.ts +17 -17
- package/dist/elements/DropdownMenu.js +93 -9
- package/dist/elements/DropdownMenu.js.map +1 -1
- package/dist/elements/DropdownMenu.stories.d.ts +9 -0
- package/dist/elements/Form.cjs.map +1 -1
- package/dist/elements/Form.d.ts +10 -10
- package/dist/elements/Form.js +3 -1
- package/dist/elements/Form.js.map +1 -1
- package/dist/elements/Form.stories.d.ts +11 -0
- package/dist/elements/FormCheck.cjs +1 -1
- package/dist/elements/FormCheck.cjs.map +1 -1
- package/dist/elements/FormCheck.d.ts +2 -2
- package/dist/elements/FormCheck.js +9 -4
- package/dist/elements/FormCheck.js.map +1 -1
- package/dist/elements/FormCheck.stories.d.ts +14 -0
- package/dist/elements/FormControl.cjs.map +1 -1
- package/dist/elements/FormControl.d.ts +2 -2
- package/dist/elements/FormControl.js +6 -4
- package/dist/elements/FormControl.js.map +1 -1
- package/dist/elements/FormControlFeedback.cjs.map +1 -1
- package/dist/elements/FormControlFeedback.js +1 -1
- package/dist/elements/FormControlFeedback.js.map +1 -1
- package/dist/elements/FormFeedback.cjs.map +1 -1
- package/dist/elements/FormFeedback.js +1 -1
- package/dist/elements/FormFeedback.js.map +1 -1
- package/dist/elements/FormFieldset.cjs.map +1 -1
- package/dist/elements/FormFieldset.d.ts +1 -1
- package/dist/elements/FormFieldset.js +3 -1
- package/dist/elements/FormFieldset.js.map +1 -1
- package/dist/elements/FormGroup.cjs.map +1 -1
- package/dist/elements/FormGroup.d.ts +2 -2
- package/dist/elements/FormGroup.js +1 -1
- package/dist/elements/FormGroup.js.map +1 -1
- package/dist/elements/FormLabel.cjs.map +1 -1
- package/dist/elements/FormLabel.d.ts +1 -1
- package/dist/elements/FormLabel.js +6 -4
- package/dist/elements/FormLabel.js.map +1 -1
- package/dist/elements/FormOption.cjs.map +1 -1
- package/dist/elements/FormOption.d.ts +1 -1
- package/dist/elements/FormOption.js +3 -1
- package/dist/elements/FormOption.js.map +1 -1
- package/dist/elements/FormSelect.cjs.map +1 -1
- package/dist/elements/FormSelect.d.ts +1 -1
- package/dist/elements/FormSelect.js +1 -1
- package/dist/elements/FormSelect.js.map +1 -1
- package/dist/elements/Popover.cjs.map +1 -1
- package/dist/elements/Popover.d.ts +6 -6
- package/dist/elements/Popover.js +13 -1
- package/dist/elements/Popover.js.map +1 -1
- package/dist/elements/Popover.stories.d.ts +9 -0
- package/dist/elements/Spinner.cjs.map +1 -1
- package/dist/elements/Spinner.js +29 -1
- package/dist/elements/Spinner.js.map +1 -1
- package/dist/elements/Spinner.stories.d.ts +16 -0
- package/dist/elements/Tabs.cjs.map +1 -1
- package/dist/elements/Tabs.d.ts +5 -5
- package/dist/elements/Tabs.js +33 -3
- package/dist/elements/Tabs.js.map +1 -1
- package/dist/elements/Tabs.stories.d.ts +9 -0
- package/dist/index.css +106 -0
- package/dist/index.d.ts +1 -0
- package/dist/lib/utils.cjs.map +1 -1
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/package.json +92 -46
- package/dist/plugin.cjs +0 -2
- package/dist/plugin.cjs.map +0 -1
- package/dist/plugin.d.ts +0 -8
- package/dist/plugin.js +0 -168
- package/dist/plugin.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.cjs","sources":["../../src/elements/Form.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"Form.cjs","sources":["../../src/elements/Form.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 { forwardRef } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport FormCheck from './FormCheck';\nimport FormControl from './FormControl';\nimport FormFeedback from './FormFeedback';\nimport FormFieldset from './FormFieldset';\nimport FormGroup from './FormGroup';\nimport FormLabel from './FormLabel';\nimport FormOption from './FormOption';\nimport FormSelect from './FormSelect';\n\nconst baseCls = 'space-y-8';\n\nconst Form = forwardRef(\n ({ className, ...props }: React.ComponentPropsWithoutRef<'form'>, ref: React.ForwardedRef<HTMLFormElement>) => (\n <form {...props} ref={ref} className={cn(baseCls, className)} />\n ),\n);\n\nForm.displayName = 'Form';\n\ntype FormType = typeof Form;\n\nexport interface FormExportType extends FormType {\n Check: typeof FormCheck;\n Control: typeof FormControl;\n Group: typeof FormGroup;\n Feedback: typeof FormFeedback;\n Fieldset: typeof FormFieldset;\n Label: typeof FormLabel;\n Option: typeof FormOption;\n Select: typeof FormSelect;\n}\n\nconst FormExport: FormExportType = Object.assign(Form, {\n Check: FormCheck,\n Control: FormControl,\n Group: FormGroup,\n Feedback: FormFeedback,\n Fieldset: FormFieldset,\n Label: FormLabel,\n Option: FormOption,\n Select: FormSelect,\n});\n\nexport default FormExport;\n"],"names":["baseCls","Form","forwardRef","className","props","ref","jsx","cn","FormExport","FormCheck","FormControl","FormGroup","FormFeedback","FormFieldset","FormLabel","FormOption","FormSelect"],"mappings":"qVA2BMA,EAAU,YAEVC,EAAOC,EAAAA,WACX,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAA,EAAiDC,IAChEC,EAAAA,IAAC,OAAA,CAAM,GAAGF,EAAO,IAAAC,EAAU,UAAWE,EAAAA,GAAGP,EAASG,CAAS,CAAA,CAAG,CAElE,EAEAF,EAAK,YAAc,OAenB,MAAMO,EAA6B,OAAO,OAAOP,EAAM,CACrD,MAAOQ,EACP,QAASC,EACT,MAAOC,EAAAA,QACP,SAAUC,EACV,SAAUC,EACV,MAAOC,EACP,OAAQC,EACR,OAAQC,CACV,CAAC"}
|
package/dist/elements/Form.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import FormCheck from './FormCheck';
|
|
2
|
-
import FormControl from './FormControl';
|
|
3
|
-
import FormFeedback from './FormFeedback';
|
|
4
|
-
import FormFieldset from './FormFieldset';
|
|
5
|
-
import FormGroup from './FormGroup';
|
|
6
|
-
import FormLabel from './FormLabel';
|
|
7
|
-
import FormOption from './FormOption';
|
|
8
|
-
import FormSelect from './FormSelect';
|
|
9
|
-
declare const Form: import(
|
|
1
|
+
import { default as FormCheck } from './FormCheck';
|
|
2
|
+
import { default as FormControl } from './FormControl';
|
|
3
|
+
import { default as FormFeedback } from './FormFeedback';
|
|
4
|
+
import { default as FormFieldset } from './FormFieldset';
|
|
5
|
+
import { default as FormGroup } from './FormGroup';
|
|
6
|
+
import { default as FormLabel } from './FormLabel';
|
|
7
|
+
import { default as FormOption } from './FormOption';
|
|
8
|
+
import { default as FormSelect } from './FormSelect';
|
|
9
|
+
declare const Form: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref"> & import('react').RefAttributes<HTMLFormElement>>;
|
|
10
10
|
type FormType = typeof Form;
|
|
11
|
-
interface FormExportType extends FormType {
|
|
11
|
+
export interface FormExportType extends FormType {
|
|
12
12
|
Check: typeof FormCheck;
|
|
13
13
|
Control: typeof FormControl;
|
|
14
14
|
Group: typeof FormGroup;
|
package/dist/elements/Form.js
CHANGED
|
@@ -9,7 +9,9 @@ import c from "./FormGroup.js";
|
|
|
9
9
|
import l from "./FormLabel.js";
|
|
10
10
|
import n from "./FormOption.js";
|
|
11
11
|
import d from "./FormSelect.js";
|
|
12
|
-
const b = "space-y-8", o = p(
|
|
12
|
+
const b = "space-y-8", o = p(
|
|
13
|
+
({ className: r, ...m }, t) => /* @__PURE__ */ e("form", { ...m, ref: t, className: i(b, r) })
|
|
14
|
+
);
|
|
13
15
|
o.displayName = "Form";
|
|
14
16
|
const N = Object.assign(o, {
|
|
15
17
|
Check: f,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../src/elements/Form.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../../src/elements/Form.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 { forwardRef } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport FormCheck from './FormCheck';\nimport FormControl from './FormControl';\nimport FormFeedback from './FormFeedback';\nimport FormFieldset from './FormFieldset';\nimport FormGroup from './FormGroup';\nimport FormLabel from './FormLabel';\nimport FormOption from './FormOption';\nimport FormSelect from './FormSelect';\n\nconst baseCls = 'space-y-8';\n\nconst Form = forwardRef(\n ({ className, ...props }: React.ComponentPropsWithoutRef<'form'>, ref: React.ForwardedRef<HTMLFormElement>) => (\n <form {...props} ref={ref} className={cn(baseCls, className)} />\n ),\n);\n\nForm.displayName = 'Form';\n\ntype FormType = typeof Form;\n\nexport interface FormExportType extends FormType {\n Check: typeof FormCheck;\n Control: typeof FormControl;\n Group: typeof FormGroup;\n Feedback: typeof FormFeedback;\n Fieldset: typeof FormFieldset;\n Label: typeof FormLabel;\n Option: typeof FormOption;\n Select: typeof FormSelect;\n}\n\nconst FormExport: FormExportType = Object.assign(Form, {\n Check: FormCheck,\n Control: FormControl,\n Group: FormGroup,\n Feedback: FormFeedback,\n Fieldset: FormFieldset,\n Label: FormLabel,\n Option: FormOption,\n Select: FormSelect,\n});\n\nexport default FormExport;\n"],"names":["baseCls","Form","forwardRef","className","props","ref","jsx","cn","FormExport","FormCheck","FormControl","FormGroup","FormFeedback","FormFieldset","FormLabel","FormOption","FormSelect"],"mappings":";;;;;;;;;;;AA2BA,MAAMA,IAAU,aAEVC,IAAOC;AAAA,EACX,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAAiDC,MAChE,gBAAAC,EAAC,QAAA,EAAM,GAAGF,GAAO,KAAAC,GAAU,WAAWE,EAAGP,GAASG,CAAS,EAAA,CAAG;AAElE;AAEAF,EAAK,cAAc;AAenB,MAAMO,IAA6B,OAAO,OAAOP,GAAM;AAAA,EACrD,OAAOQ;AAAA,EACP,SAASC;AAAAA,EACT,OAAOC;AAAA,EACP,UAAUC;AAAA,EACV,UAAUC;AAAA,EACV,OAAOC;AAAA,EACP,QAAQC;AAAA,EACR,QAAQC;AACV,CAAC;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
tags: string[];
|
|
5
|
+
component: import('./Form').FormExportType;
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<typeof meta>;
|
|
9
|
+
export declare const Empty: Story;
|
|
10
|
+
export declare const WithData: Story;
|
|
11
|
+
export declare const WithErrors: Story;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),u=require("react"),l=require("../lib/utils.cjs"),m="flex items-center",
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),u=require("react"),l=require("../lib/utils.cjs"),m="flex items-center",f="h-4 w-4 text-primary-600 rounded border-input ring-offset-background focus:outline-none focus:border-input focus:ring-1 focus:ring-ring focus:ring-offset-0 disabled:opacity-50",d="ml-2 block text-sm text-chrome-900",t=u.forwardRef(({as:c="input",className:o,id:s,label:r,...n},i)=>{const a=c;return e.jsxs("div",{className:l.cn(m,o),children:[e.jsx(a,{...n,ref:i,id:s,type:"checkbox",className:f}),r&&e.jsx("label",{htmlFor:s,className:d,children:r})]})});t.displayName="FormCheck";module.exports=t;
|
|
2
2
|
//# sourceMappingURL=FormCheck.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormCheck.cjs","sources":["../../src/elements/FormCheck.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FormCheck.cjs","sources":["../../src/elements/FormCheck.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 { forwardRef } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst wrapperBaseCls = 'flex items-center';\nconst inputBaseCls =\n 'h-4 w-4 text-primary-600 rounded border-input ring-offset-background focus:outline-none focus:border-input focus:ring-1 focus:ring-ring focus:ring-offset-0 disabled:opacity-50';\nconst labelBaseCls = 'ml-2 block text-sm text-chrome-900';\n\nexport interface Props extends React.ComponentPropsWithoutRef<'input'> {\n as?: React.ElementType;\n id?: string;\n label?: React.ReactNode;\n}\n\nconst FormCheck = forwardRef(\n ({ as = 'input', className, id, label, ...props }: Props, ref: React.ForwardedRef<HTMLInputElement>) => {\n const Tag = as;\n\n return (\n <div className={cn(wrapperBaseCls, className)}>\n <Tag {...props} ref={ref} id={id} type=\"checkbox\" className={inputBaseCls} />\n {label && (\n <label htmlFor={id} className={labelBaseCls}>\n {label}\n </label>\n )}\n </div>\n );\n },\n);\n\nFormCheck.displayName = 'FormCheck';\n\nexport default FormCheck;\n"],"names":["wrapperBaseCls","inputBaseCls","labelBaseCls","FormCheck","forwardRef","as","className","id","label","props","ref","Tag","cn","jsx"],"mappings":"mGAkBMA,EAAiB,oBACjBC,EACJ,kLACIC,EAAe,qCAQfC,EAAYC,EAAAA,WAChB,CAAC,CAAE,GAAAC,EAAK,QAAS,UAAAC,EAAW,GAAAC,EAAI,MAAAC,EAAO,GAAGC,CAAA,EAAgBC,IAA8C,CACtG,MAAMC,EAAMN,EAEZ,cACG,MAAA,CAAI,UAAWO,EAAAA,GAAGZ,EAAgBM,CAAS,EAC1C,SAAA,CAAAO,EAAAA,IAACF,EAAA,CAAK,GAAGF,EAAO,IAAAC,EAAU,GAAAH,EAAQ,KAAK,WAAW,UAAWN,EAAc,EAC1EO,GACCK,EAAAA,IAAC,QAAA,CAAM,QAASN,EAAI,UAAWL,EAC5B,SAAAM,CAAA,CACH,CAAA,EAEJ,CAAA,CAGN,EAEAL,EAAU,YAAc"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
interface Props extends React.ComponentPropsWithoutRef<'input'> {
|
|
1
|
+
export interface Props extends React.ComponentPropsWithoutRef<'input'> {
|
|
2
2
|
as?: React.ElementType;
|
|
3
3
|
id?: string;
|
|
4
4
|
label?: React.ReactNode;
|
|
5
5
|
}
|
|
6
|
-
declare const FormCheck: import(
|
|
6
|
+
declare const FormCheck: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLInputElement>>;
|
|
7
7
|
export default FormCheck;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as l } from "react";
|
|
3
3
|
import { cn as m } from "../lib/utils.js";
|
|
4
|
-
const f = "flex items-center",
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const f = "flex items-center", p = "h-4 w-4 text-primary-600 rounded border-input ring-offset-background focus:outline-none focus:border-input focus:ring-1 focus:ring-ring focus:ring-offset-0 disabled:opacity-50", u = "ml-2 block text-sm text-chrome-900", d = l(
|
|
5
|
+
({ as: s = "input", className: t, id: e, label: o, ...c }, n) => {
|
|
6
|
+
const a = s;
|
|
7
|
+
return /* @__PURE__ */ i("div", { className: m(f, t), children: [
|
|
8
|
+
/* @__PURE__ */ r(a, { ...c, ref: n, id: e, type: "checkbox", className: p }),
|
|
9
|
+
o && /* @__PURE__ */ r("label", { htmlFor: e, className: u, children: o })
|
|
10
|
+
] });
|
|
11
|
+
}
|
|
12
|
+
);
|
|
8
13
|
d.displayName = "FormCheck";
|
|
9
14
|
export {
|
|
10
15
|
d as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormCheck.js","sources":["../../src/elements/FormCheck.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FormCheck.js","sources":["../../src/elements/FormCheck.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 { forwardRef } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst wrapperBaseCls = 'flex items-center';\nconst inputBaseCls =\n 'h-4 w-4 text-primary-600 rounded border-input ring-offset-background focus:outline-none focus:border-input focus:ring-1 focus:ring-ring focus:ring-offset-0 disabled:opacity-50';\nconst labelBaseCls = 'ml-2 block text-sm text-chrome-900';\n\nexport interface Props extends React.ComponentPropsWithoutRef<'input'> {\n as?: React.ElementType;\n id?: string;\n label?: React.ReactNode;\n}\n\nconst FormCheck = forwardRef(\n ({ as = 'input', className, id, label, ...props }: Props, ref: React.ForwardedRef<HTMLInputElement>) => {\n const Tag = as;\n\n return (\n <div className={cn(wrapperBaseCls, className)}>\n <Tag {...props} ref={ref} id={id} type=\"checkbox\" className={inputBaseCls} />\n {label && (\n <label htmlFor={id} className={labelBaseCls}>\n {label}\n </label>\n )}\n </div>\n );\n },\n);\n\nFormCheck.displayName = 'FormCheck';\n\nexport default FormCheck;\n"],"names":["wrapperBaseCls","inputBaseCls","labelBaseCls","FormCheck","forwardRef","as","className","id","label","props","ref","Tag","cn","jsx"],"mappings":";;;AAkBA,MAAMA,IAAiB,qBACjBC,IACJ,mLACIC,IAAe,sCAQfC,IAAYC;AAAA,EAChB,CAAC,EAAE,IAAAC,IAAK,SAAS,WAAAC,GAAW,IAAAC,GAAI,OAAAC,GAAO,GAAGC,EAAA,GAAgBC,MAA8C;AACtG,UAAMC,IAAMN;AAEZ,6BACG,OAAA,EAAI,WAAWO,EAAGZ,GAAgBM,CAAS,GAC1C,UAAA;AAAA,MAAA,gBAAAO,EAACF,GAAA,EAAK,GAAGF,GAAO,KAAAC,GAAU,IAAAH,GAAQ,MAAK,YAAW,WAAWN,GAAc;AAAA,MAC1EO,KACC,gBAAAK,EAAC,SAAA,EAAM,SAASN,GAAI,WAAWL,GAC5B,UAAAM,EAAA,CACH;AAAA,IAAA,GAEJ;AAAA,EAAA;AAGN;AAEAL,EAAU,cAAc;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
tags: string[];
|
|
5
|
+
component: import('react').ForwardRefExoticComponent<import('./FormCheck').Props & import('react').RefAttributes<HTMLInputElement>>;
|
|
6
|
+
args: {
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
export declare const Checked: Story;
|
|
14
|
+
export declare const Disabled: Story;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormControl.cjs","sources":["../../src/elements/FormControl.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FormControl.cjs","sources":["../../src/elements/FormControl.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 { forwardRef, useContext } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Context as FormGroupContext } from './FormGroup';\nimport FormControlFeedback from './FormControlFeedback';\n\nconst baseCls =\n 'flex h-10 w-full rounded border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground ring-offset-background focus:outline-none focus:border-input focus:ring-1 focus:ring-ring focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 file:border-0 file:bg-transparent file:text-sm file:font-medium';\n\ninterface Props extends React.ComponentPropsWithoutRef<'input'> {\n as?: React.ElementType;\n id?: string;\n}\n\nconst FormControl = forwardRef(\n ({ as = 'input', className, id, ...props }: Props, ref: React.ForwardedRef<HTMLInputElement>) => {\n const Tag = as;\n const { controlId } = useContext(FormGroupContext);\n\n return <Tag {...props} ref={ref} id={id || controlId} className={cn(baseCls, className)} />;\n },\n);\n\nFormControl.displayName = 'FormControl';\n\ntype FormControlType = typeof FormControl;\n\ninterface FormControlExportType extends FormControlType {\n Feedback: typeof FormControlFeedback;\n}\n\nconst FormControlExport: FormControlExportType = Object.assign(FormControl, {\n Feedback: FormControlFeedback,\n});\n\nexport default FormControlExport;\n"],"names":["baseCls","FormControl","forwardRef","as","className","id","props","ref","Tag","controlId","useContext","FormGroupContext","jsx","cn","FormControlExport","FormControlFeedback"],"mappings":"uKAqBMA,EACJ,+UAOIC,EAAcC,EAAAA,WAClB,CAAC,CAAE,GAAAC,EAAK,QAAS,UAAAC,EAAW,GAAAC,EAAI,GAAGC,CAAA,EAAgBC,IAA8C,CAC/F,MAAMC,EAAML,EACN,CAAE,UAAAM,CAAA,EAAcC,EAAAA,WAAWC,SAAgB,EAEjD,OAAOC,EAAAA,IAACJ,EAAA,CAAK,GAAGF,EAAO,IAAAC,EAAU,GAAIF,GAAMI,EAAW,UAAWI,EAAAA,GAAGb,EAASI,CAAS,CAAA,CAAG,CAAA,CAE7F,EAEAH,EAAY,YAAc,cAQ1B,MAAMa,EAA2C,OAAO,OAAOb,EAAa,CAC1E,SAAUc,CACZ,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import FormControlFeedback from './FormControlFeedback';
|
|
1
|
+
import { default as FormControlFeedback } from './FormControlFeedback';
|
|
2
2
|
interface Props extends React.ComponentPropsWithoutRef<'input'> {
|
|
3
3
|
as?: React.ElementType;
|
|
4
4
|
id?: string;
|
|
5
5
|
}
|
|
6
|
-
declare const FormControl: import(
|
|
6
|
+
declare const FormControl: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLInputElement>>;
|
|
7
7
|
type FormControlType = typeof FormControl;
|
|
8
8
|
interface FormControlExportType extends FormControlType {
|
|
9
9
|
Feedback: typeof FormControlFeedback;
|
|
@@ -3,10 +3,12 @@ import { forwardRef as l, useContext as a } from "react";
|
|
|
3
3
|
import { cn as c } from "../lib/utils.js";
|
|
4
4
|
import { Context as m } from "./FormGroup.js";
|
|
5
5
|
import u from "./FormControlFeedback.js";
|
|
6
|
-
const p = "flex h-10 w-full rounded border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground ring-offset-background focus:outline-none focus:border-input focus:ring-1 focus:ring-ring focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 file:border-0 file:bg-transparent file:text-sm file:font-medium", o = l(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
6
|
+
const p = "flex h-10 w-full rounded border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground ring-offset-background focus:outline-none focus:border-input focus:ring-1 focus:ring-ring focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 file:border-0 file:bg-transparent file:text-sm file:font-medium", o = l(
|
|
7
|
+
({ as: r = "input", className: t, id: e, ...n }, s) => {
|
|
8
|
+
const f = r, { controlId: i } = a(m);
|
|
9
|
+
return /* @__PURE__ */ d(f, { ...n, ref: s, id: e || i, className: c(p, t) });
|
|
10
|
+
}
|
|
11
|
+
);
|
|
10
12
|
o.displayName = "FormControl";
|
|
11
13
|
const k = Object.assign(o, {
|
|
12
14
|
Feedback: u
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormControl.js","sources":["../../src/elements/FormControl.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FormControl.js","sources":["../../src/elements/FormControl.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 { forwardRef, useContext } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Context as FormGroupContext } from './FormGroup';\nimport FormControlFeedback from './FormControlFeedback';\n\nconst baseCls =\n 'flex h-10 w-full rounded border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground ring-offset-background focus:outline-none focus:border-input focus:ring-1 focus:ring-ring focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 file:border-0 file:bg-transparent file:text-sm file:font-medium';\n\ninterface Props extends React.ComponentPropsWithoutRef<'input'> {\n as?: React.ElementType;\n id?: string;\n}\n\nconst FormControl = forwardRef(\n ({ as = 'input', className, id, ...props }: Props, ref: React.ForwardedRef<HTMLInputElement>) => {\n const Tag = as;\n const { controlId } = useContext(FormGroupContext);\n\n return <Tag {...props} ref={ref} id={id || controlId} className={cn(baseCls, className)} />;\n },\n);\n\nFormControl.displayName = 'FormControl';\n\ntype FormControlType = typeof FormControl;\n\ninterface FormControlExportType extends FormControlType {\n Feedback: typeof FormControlFeedback;\n}\n\nconst FormControlExport: FormControlExportType = Object.assign(FormControl, {\n Feedback: FormControlFeedback,\n});\n\nexport default FormControlExport;\n"],"names":["baseCls","FormControl","forwardRef","as","className","id","props","ref","Tag","controlId","useContext","FormGroupContext","jsx","cn","FormControlExport","FormControlFeedback"],"mappings":";;;;;AAqBA,MAAMA,IACJ,gVAOIC,IAAcC;AAAA,EAClB,CAAC,EAAE,IAAAC,IAAK,SAAS,WAAAC,GAAW,IAAAC,GAAI,GAAGC,EAAA,GAAgBC,MAA8C;AAC/F,UAAMC,IAAML,GACN,EAAE,WAAAM,EAAA,IAAcC,EAAWC,CAAgB;AAEjD,WAAO,gBAAAC,EAACJ,GAAA,EAAK,GAAGF,GAAO,KAAAC,GAAU,IAAIF,KAAMI,GAAW,WAAWI,EAAGb,GAASI,CAAS,EAAA,CAAG;AAAA,EAAA;AAE7F;AAEAH,EAAY,cAAc;AAQ1B,MAAMa,IAA2C,OAAO,OAAOb,GAAa;AAAA,EAC1E,UAAUc;AACZ,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormControlFeedback.cjs","sources":["../../src/elements/FormControlFeedback.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FormControlFeedback.cjs","sources":["../../src/elements/FormControlFeedback.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 { cn } from '@/lib/utils';\n\nconst baseCls = 'text-sm font-medium text-danger !-mb-6';\n\ninterface Props extends React.ComponentPropsWithoutRef<'div'> {\n as?: React.ElementType;\n}\n\nconst FormControlFeedback = ({ as = 'div', className, ...props }: Props) => {\n const Tag = as;\n\n return <Tag {...props} className={cn(baseCls, className)} />;\n};\n\nFormControlFeedback.displayName = 'FormControlFeedback';\n\nexport default FormControlFeedback;\n"],"names":["baseCls","FormControlFeedback","as","className","props","Tag","jsx","cn"],"mappings":"gFAgBMA,EAAU,yCAMVC,EAAsB,CAAC,CAAE,GAAAC,EAAK,MAAO,UAAAC,EAAW,GAAGC,KAAmB,CAC1E,MAAMC,EAAMH,EAEZ,OAAOI,EAAAA,IAACD,GAAK,GAAGD,EAAO,UAAWG,KAAGP,EAASG,CAAS,EAAG,CAC5D,EAEAF,EAAoB,YAAc"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { cn as m } from "../lib/utils.js";
|
|
3
|
-
const r = "text-sm font-medium text-danger !-mb-6", s = ({ as: o = "div", className: t, ...e }) => a(o, { ...e, className: m(r, t) });
|
|
3
|
+
const r = "text-sm font-medium text-danger !-mb-6", s = ({ as: o = "div", className: t, ...e }) => /* @__PURE__ */ a(o, { ...e, className: m(r, t) });
|
|
4
4
|
s.displayName = "FormControlFeedback";
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormControlFeedback.js","sources":["../../src/elements/FormControlFeedback.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FormControlFeedback.js","sources":["../../src/elements/FormControlFeedback.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 { cn } from '@/lib/utils';\n\nconst baseCls = 'text-sm font-medium text-danger !-mb-6';\n\ninterface Props extends React.ComponentPropsWithoutRef<'div'> {\n as?: React.ElementType;\n}\n\nconst FormControlFeedback = ({ as = 'div', className, ...props }: Props) => {\n const Tag = as;\n\n return <Tag {...props} className={cn(baseCls, className)} />;\n};\n\nFormControlFeedback.displayName = 'FormControlFeedback';\n\nexport default FormControlFeedback;\n"],"names":["baseCls","FormControlFeedback","as","className","props","jsx","cn"],"mappings":";;AAgBA,MAAMA,IAAU,0CAMVC,IAAsB,CAAC,EAAE,IAAAC,IAAK,OAAO,WAAAC,GAAW,GAAGC,QAGhD,gBAAAC,EAFKH,KAEC,GAAGE,GAAO,WAAWE,EAAGN,GAASG,CAAS,GAAG;AAG5DF,EAAoB,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFeedback.cjs","sources":["../../src/elements/FormFeedback.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FormFeedback.cjs","sources":["../../src/elements/FormFeedback.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 { cn } from '@/lib/utils';\n\nconst baseCls = 'text-base font-medium text-danger !mt-0 !-mb-4';\n\ninterface Props extends React.ComponentPropsWithoutRef<'div'> {\n as?: React.ElementType;\n}\n\nconst FormFeedback = ({ as = 'div', className, ...props }: Props) => {\n const Tag = as;\n\n return <Tag {...props} className={cn(baseCls, className)} />;\n};\n\nFormFeedback.displayName = 'FormFeedback';\n\nexport default FormFeedback;\n"],"names":["baseCls","FormFeedback","as","className","props","Tag","jsx","cn"],"mappings":"gFAgBMA,EAAU,iDAMVC,EAAe,CAAC,CAAE,GAAAC,EAAK,MAAO,UAAAC,EAAW,GAAGC,KAAmB,CACnE,MAAMC,EAAMH,EAEZ,OAAOI,EAAAA,IAACD,GAAK,GAAGD,EAAO,UAAWG,KAAGP,EAASG,CAAS,EAAG,CAC5D,EAEAF,EAAa,YAAc"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { cn as o } from "../lib/utils.js";
|
|
3
|
-
const s = "text-base font-medium text-danger !mt-0 !-mb-4", r = ({ as: e = "div", className: t, ...a }) => m(e, { ...a, className: o(s, t) });
|
|
3
|
+
const s = "text-base font-medium text-danger !mt-0 !-mb-4", r = ({ as: e = "div", className: t, ...a }) => /* @__PURE__ */ m(e, { ...a, className: o(s, t) });
|
|
4
4
|
r.displayName = "FormFeedback";
|
|
5
5
|
export {
|
|
6
6
|
r as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFeedback.js","sources":["../../src/elements/FormFeedback.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FormFeedback.js","sources":["../../src/elements/FormFeedback.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 { cn } from '@/lib/utils';\n\nconst baseCls = 'text-base font-medium text-danger !mt-0 !-mb-4';\n\ninterface Props extends React.ComponentPropsWithoutRef<'div'> {\n as?: React.ElementType;\n}\n\nconst FormFeedback = ({ as = 'div', className, ...props }: Props) => {\n const Tag = as;\n\n return <Tag {...props} className={cn(baseCls, className)} />;\n};\n\nFormFeedback.displayName = 'FormFeedback';\n\nexport default FormFeedback;\n"],"names":["baseCls","FormFeedback","as","className","props","jsx","cn"],"mappings":";;AAgBA,MAAMA,IAAU,kDAMVC,IAAe,CAAC,EAAE,IAAAC,IAAK,OAAO,WAAAC,GAAW,GAAGC,QAGzC,gBAAAC,EAFKH,KAEC,GAAGE,GAAO,WAAWE,EAAGN,GAASG,CAAS,GAAG;AAG5DF,EAAa,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFieldset.cjs","sources":["../../src/elements/FormFieldset.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FormFieldset.cjs","sources":["../../src/elements/FormFieldset.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 { forwardRef } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst baseCls = 'space-y-8';\n\nconst FormFieldset = forwardRef(\n (\n { className, ...props }: React.ComponentPropsWithoutRef<'fieldset'>,\n ref: React.ForwardedRef<HTMLFieldSetElement>,\n ) => <fieldset {...props} ref={ref} className={cn(baseCls, className)} />,\n);\n\nFormFieldset.displayName = 'FormFieldset';\n\nexport default FormFieldset;\n"],"names":["baseCls","FormFieldset","forwardRef","className","props","ref","jsx","cn"],"mappings":"mGAkBMA,EAAU,YAEVC,EAAeC,EAAAA,WACnB,CACE,CAAE,UAAAC,EAAW,GAAGC,CAAA,EAChBC,IACGC,EAAAA,IAAC,WAAA,CAAU,GAAGF,EAAO,IAAAC,EAAU,UAAWE,EAAAA,GAAGP,EAASG,CAAS,CAAA,CAAG,CACzE,EAEAF,EAAa,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const FormFieldset: import(
|
|
1
|
+
declare const FormFieldset: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, "ref"> & import('react').RefAttributes<HTMLFieldSetElement>>;
|
|
2
2
|
export default FormFieldset;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as m } from "react";
|
|
3
3
|
import { cn as t } from "../lib/utils.js";
|
|
4
|
-
const a = "space-y-8", f = m(
|
|
4
|
+
const a = "space-y-8", f = m(
|
|
5
|
+
({ className: e, ...s }, o) => /* @__PURE__ */ r("fieldset", { ...s, ref: o, className: t(a, e) })
|
|
6
|
+
);
|
|
5
7
|
f.displayName = "FormFieldset";
|
|
6
8
|
export {
|
|
7
9
|
f as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFieldset.js","sources":["../../src/elements/FormFieldset.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FormFieldset.js","sources":["../../src/elements/FormFieldset.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 { forwardRef } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst baseCls = 'space-y-8';\n\nconst FormFieldset = forwardRef(\n (\n { className, ...props }: React.ComponentPropsWithoutRef<'fieldset'>,\n ref: React.ForwardedRef<HTMLFieldSetElement>,\n ) => <fieldset {...props} ref={ref} className={cn(baseCls, className)} />,\n);\n\nFormFieldset.displayName = 'FormFieldset';\n\nexport default FormFieldset;\n"],"names":["baseCls","FormFieldset","forwardRef","className","props","ref","jsx","cn"],"mappings":";;;AAkBA,MAAMA,IAAU,aAEVC,IAAeC;AAAA,EACnB,CACE,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAChBC,MACG,gBAAAC,EAAC,YAAA,EAAU,GAAGF,GAAO,KAAAC,GAAU,WAAWE,EAAGP,GAASG,CAAS,EAAA,CAAG;AACzE;AAEAF,EAAa,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormGroup.cjs","sources":["../../src/elements/FormGroup.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FormGroup.cjs","sources":["../../src/elements/FormGroup.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, forwardRef, useMemo } from 'react';\n\nimport { cn } from '@/lib/utils';\n\ntype ContextState = {\n controlId: string | undefined;\n};\n\nconst Context = createContext({} as ContextState); // for passing `controlId`\nconst baseCls = 'space-y-1';\n\ninterface Props extends React.ComponentPropsWithoutRef<'div'> {\n controlId?: string;\n}\n\nconst FormGroup = forwardRef(({ className, controlId, ...props }: Props, ref: React.ForwardedRef<HTMLDivElement>) => {\n const context = useMemo(() => ({ controlId }), [controlId]);\n\n return (\n <Context.Provider value={context}>\n <div {...props} ref={ref} className={cn(baseCls, className)} />\n </Context.Provider>\n );\n});\n\nFormGroup.displayName = 'FormGroup';\n\nexport { Context };\nexport default FormGroup;\n"],"names":["Context","createContext","baseCls","FormGroup","forwardRef","className","controlId","props","ref","context","useMemo","jsx","cn"],"mappings":"kMAsBMA,EAAUC,EAAAA,cAAc,CAAA,CAAkB,EAC1CC,EAAU,YAMVC,EAAYC,EAAAA,WAAW,CAAC,CAAE,UAAAC,EAAW,UAAAC,EAAW,GAAGC,CAAA,EAAgBC,IAA4C,CACnH,MAAMC,EAAUC,EAAAA,QAAQ,KAAO,CAAE,UAAAJ,IAAc,CAACA,CAAS,CAAC,EAE1D,aACGN,EAAQ,SAAR,CAAiB,MAAOS,EACvB,SAAAE,MAAC,MAAA,CAAK,GAAGJ,EAAO,IAAAC,EAAU,UAAWI,EAAAA,GAAGV,EAASG,CAAS,EAAG,EAC/D,CAEJ,CAAC,EAEDF,EAAU,YAAc"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
type ContextState = {
|
|
2
2
|
controlId: string | undefined;
|
|
3
3
|
};
|
|
4
|
-
declare const Context: import(
|
|
4
|
+
declare const Context: import('react').Context<ContextState>;
|
|
5
5
|
interface Props extends React.ComponentPropsWithoutRef<'div'> {
|
|
6
6
|
controlId?: string;
|
|
7
7
|
}
|
|
8
|
-
declare const FormGroup: import(
|
|
8
|
+
declare const FormGroup: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export { Context };
|
|
10
10
|
export default FormGroup;
|
|
@@ -3,7 +3,7 @@ import { createContext as m, forwardRef as c, useMemo as n } from "react";
|
|
|
3
3
|
import { cn as p } from "../lib/utils.js";
|
|
4
4
|
const i = m({}), f = "space-y-1", u = c(({ className: r, controlId: o, ...t }, s) => {
|
|
5
5
|
const a = n(() => ({ controlId: o }), [o]);
|
|
6
|
-
return e(i.Provider, { value: a, children: e("div", { ...t, ref: s, className: p(f, r) }) });
|
|
6
|
+
return /* @__PURE__ */ e(i.Provider, { value: a, children: /* @__PURE__ */ e("div", { ...t, ref: s, className: p(f, r) }) });
|
|
7
7
|
});
|
|
8
8
|
u.displayName = "FormGroup";
|
|
9
9
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormGroup.js","sources":["../../src/elements/FormGroup.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FormGroup.js","sources":["../../src/elements/FormGroup.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, forwardRef, useMemo } from 'react';\n\nimport { cn } from '@/lib/utils';\n\ntype ContextState = {\n controlId: string | undefined;\n};\n\nconst Context = createContext({} as ContextState); // for passing `controlId`\nconst baseCls = 'space-y-1';\n\ninterface Props extends React.ComponentPropsWithoutRef<'div'> {\n controlId?: string;\n}\n\nconst FormGroup = forwardRef(({ className, controlId, ...props }: Props, ref: React.ForwardedRef<HTMLDivElement>) => {\n const context = useMemo(() => ({ controlId }), [controlId]);\n\n return (\n <Context.Provider value={context}>\n <div {...props} ref={ref} className={cn(baseCls, className)} />\n </Context.Provider>\n );\n});\n\nFormGroup.displayName = 'FormGroup';\n\nexport { Context };\nexport default FormGroup;\n"],"names":["Context","createContext","baseCls","FormGroup","forwardRef","className","controlId","props","ref","context","useMemo","jsx","cn"],"mappings":";;;AAsBA,MAAMA,IAAUC,EAAc,CAAA,CAAkB,GAC1CC,IAAU,aAMVC,IAAYC,EAAW,CAAC,EAAE,WAAAC,GAAW,WAAAC,GAAW,GAAGC,EAAA,GAAgBC,MAA4C;AACnH,QAAMC,IAAUC,EAAQ,OAAO,EAAE,WAAAJ,MAAc,CAACA,CAAS,CAAC;AAE1D,2BACGN,EAAQ,UAAR,EAAiB,OAAOS,GACvB,UAAA,gBAAAE,EAAC,OAAA,EAAK,GAAGJ,GAAO,KAAAC,GAAU,WAAWI,EAAGV,GAASG,CAAS,GAAG,GAC/D;AAEJ,CAAC;AAEDF,EAAU,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormLabel.cjs","sources":["../../src/elements/FormLabel.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FormLabel.cjs","sources":["../../src/elements/FormLabel.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 { forwardRef, useContext } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Context as FormGroupContext } from './FormGroup';\n\nconst baseCls = 'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70';\n\ninterface Props extends React.ComponentPropsWithoutRef<'label'> {\n as?: React.ElementType;\n htmlFor?: string;\n}\n\nconst FormLabel = forwardRef(\n ({ as = 'label', className, htmlFor, ...props }: Props, ref: React.ForwardedRef<HTMLLabelElement>) => {\n const Tag = as;\n const { controlId } = useContext(FormGroupContext);\n\n return <Tag {...props} ref={ref} htmlFor={htmlFor || controlId} className={cn(baseCls, className)} />;\n },\n);\n\nFormLabel.displayName = 'FormLabel';\n\nexport default FormLabel;\n"],"names":["baseCls","FormLabel","forwardRef","as","className","htmlFor","props","ref","Tag","controlId","useContext","FormGroupContext","jsx","cn"],"mappings":"gIAoBMA,EAAU,6FAOVC,EAAYC,EAAAA,WAChB,CAAC,CAAE,GAAAC,EAAK,QAAS,UAAAC,EAAW,QAAAC,EAAS,GAAGC,CAAA,EAAgBC,IAA8C,CACpG,MAAMC,EAAML,EACN,CAAE,UAAAM,CAAA,EAAcC,EAAAA,WAAWC,SAAgB,EAEjD,OAAOC,EAAAA,IAACJ,EAAA,CAAK,GAAGF,EAAO,IAAAC,EAAU,QAASF,GAAWI,EAAW,UAAWI,EAAAA,GAAGb,EAASI,CAAS,CAAA,CAAG,CAAA,CAEvG,EAEAH,EAAU,YAAc"}
|
|
@@ -2,5 +2,5 @@ interface Props extends React.ComponentPropsWithoutRef<'label'> {
|
|
|
2
2
|
as?: React.ElementType;
|
|
3
3
|
htmlFor?: string;
|
|
4
4
|
}
|
|
5
|
-
declare const FormLabel: import(
|
|
5
|
+
declare const FormLabel: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLLabelElement>>;
|
|
6
6
|
export default FormLabel;
|
|
@@ -2,10 +2,12 @@ import { jsx as l } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as n, useContext as d } from "react";
|
|
3
3
|
import { cn as i } from "../lib/utils.js";
|
|
4
4
|
import { Context as c } from "./FormGroup.js";
|
|
5
|
-
const p = "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", f = n(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
});
|
|
5
|
+
const p = "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", f = n(
|
|
6
|
+
({ as: o = "label", className: e, htmlFor: t, ...r }, a) => {
|
|
7
|
+
const m = o, { controlId: s } = d(c);
|
|
8
|
+
return /* @__PURE__ */ l(m, { ...r, ref: a, htmlFor: t || s, className: i(p, e) });
|
|
9
|
+
}
|
|
10
|
+
);
|
|
9
11
|
f.displayName = "FormLabel";
|
|
10
12
|
export {
|
|
11
13
|
f as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormLabel.js","sources":["../../src/elements/FormLabel.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FormLabel.js","sources":["../../src/elements/FormLabel.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 { forwardRef, useContext } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Context as FormGroupContext } from './FormGroup';\n\nconst baseCls = 'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70';\n\ninterface Props extends React.ComponentPropsWithoutRef<'label'> {\n as?: React.ElementType;\n htmlFor?: string;\n}\n\nconst FormLabel = forwardRef(\n ({ as = 'label', className, htmlFor, ...props }: Props, ref: React.ForwardedRef<HTMLLabelElement>) => {\n const Tag = as;\n const { controlId } = useContext(FormGroupContext);\n\n return <Tag {...props} ref={ref} htmlFor={htmlFor || controlId} className={cn(baseCls, className)} />;\n },\n);\n\nFormLabel.displayName = 'FormLabel';\n\nexport default FormLabel;\n"],"names":["baseCls","FormLabel","forwardRef","as","className","htmlFor","props","ref","Tag","controlId","useContext","FormGroupContext","jsx","cn"],"mappings":";;;;AAoBA,MAAMA,IAAU,8FAOVC,IAAYC;AAAA,EAChB,CAAC,EAAE,IAAAC,IAAK,SAAS,WAAAC,GAAW,SAAAC,GAAS,GAAGC,EAAA,GAAgBC,MAA8C;AACpG,UAAMC,IAAML,GACN,EAAE,WAAAM,EAAA,IAAcC,EAAWC,CAAgB;AAEjD,WAAO,gBAAAC,EAACJ,GAAA,EAAK,GAAGF,GAAO,KAAAC,GAAU,SAASF,KAAWI,GAAW,WAAWI,EAAGb,GAASI,CAAS,EAAA,CAAG;AAAA,EAAA;AAEvG;AAEAH,EAAU,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormOption.cjs","sources":["../../src/elements/FormOption.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FormOption.cjs","sources":["../../src/elements/FormOption.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 { forwardRef } from 'react';\n\nconst FormOption = forwardRef(\n ({ className, ...props }: React.ComponentPropsWithoutRef<'option'>, ref: React.ForwardedRef<HTMLOptionElement>) => (\n <option {...props} ref={ref} className={className} />\n ),\n);\n\nFormOption.displayName = 'FormOption';\n\nexport default FormOption;\n"],"names":["FormOption","forwardRef","className","props","ref","jsx"],"mappings":"qEAgBMA,EAAaC,EAAAA,WACjB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAA,EAAmDC,IAClEC,MAAC,SAAA,CAAQ,GAAGF,EAAO,IAAAC,EAAU,UAAAF,CAAA,CAAsB,CAEvD,EAEAF,EAAW,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const FormOption: import(
|
|
1
|
+
declare const FormOption: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>, "ref"> & import('react').RefAttributes<HTMLOptionElement>>;
|
|
2
2
|
export default FormOption;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as p } from "react";
|
|
3
|
-
const i = p(
|
|
3
|
+
const i = p(
|
|
4
|
+
({ className: o, ...r }, t) => /* @__PURE__ */ m("option", { ...r, ref: t, className: o })
|
|
5
|
+
);
|
|
4
6
|
i.displayName = "FormOption";
|
|
5
7
|
export {
|
|
6
8
|
i as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormOption.js","sources":["../../src/elements/FormOption.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FormOption.js","sources":["../../src/elements/FormOption.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 { forwardRef } from 'react';\n\nconst FormOption = forwardRef(\n ({ className, ...props }: React.ComponentPropsWithoutRef<'option'>, ref: React.ForwardedRef<HTMLOptionElement>) => (\n <option {...props} ref={ref} className={className} />\n ),\n);\n\nFormOption.displayName = 'FormOption';\n\nexport default FormOption;\n"],"names":["FormOption","forwardRef","className","props","ref","jsx"],"mappings":";;AAgBA,MAAMA,IAAaC;AAAA,EACjB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAAmDC,MAClE,gBAAAC,EAAC,UAAA,EAAQ,GAAGF,GAAO,KAAAC,GAAU,WAAAF,EAAA,CAAsB;AAEvD;AAEAF,EAAW,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormSelect.cjs","sources":["../../src/elements/FormSelect.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"FormSelect.cjs","sources":["../../src/elements/FormSelect.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 { forwardRef, useContext } from 'react';\n\nimport { cn } from '@/lib/utils';\n\nimport { Context as FormGroupContext } from './FormGroup';\n\nconst baseCls =\n 'mt-1 block w-full h-10 rounded bg-background border border-input py-2 pl-3 pr-10 text-sm ring-offset-background focus:outline-none focus:border-input focus:ring-1 focus:ring-ring focus:ring-offset-0 disabled:opacity-50';\n\ninterface Props extends React.ComponentPropsWithoutRef<'select'> {\n id?: string;\n}\n\nconst FormSelect = forwardRef(({ className, id, ...props }: Props, ref: React.ForwardedRef<HTMLSelectElement>) => {\n const { controlId } = useContext(FormGroupContext);\n\n return <select {...props} ref={ref} id={id || controlId} className={cn(baseCls, className)} />;\n});\n\nFormSelect.displayName = 'FormSelect';\n\nexport default FormSelect;\n"],"names":["baseCls","FormSelect","forwardRef","className","id","props","ref","controlId","useContext","FormGroupContext","jsx","cn"],"mappings":"gIAoBMA,EACJ,6NAMIC,EAAaC,EAAAA,WAAW,CAAC,CAAE,UAAAC,EAAW,GAAAC,EAAI,GAAGC,CAAA,EAAgBC,IAA+C,CAChH,KAAM,CAAE,UAAAC,CAAA,EAAcC,EAAAA,WAAWC,SAAgB,EAEjD,OAAOC,EAAAA,IAAC,SAAA,CAAQ,GAAGL,EAAO,IAAAC,EAAU,GAAIF,GAAMG,EAAW,UAAWI,EAAAA,GAAGX,EAASG,CAAS,CAAA,CAAG,CAC9F,CAAC,EAEDF,EAAW,YAAc"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface Props extends React.ComponentPropsWithoutRef<'select'> {
|
|
2
2
|
id?: string;
|
|
3
3
|
}
|
|
4
|
-
declare const FormSelect: import(
|
|
4
|
+
declare const FormSelect: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLSelectElement>>;
|
|
5
5
|
export default FormSelect;
|
|
@@ -4,7 +4,7 @@ import { cn as i } from "../lib/utils.js";
|
|
|
4
4
|
import { Context as u } from "./FormGroup.js";
|
|
5
5
|
const d = "mt-1 block w-full h-10 rounded bg-background border border-input py-2 pl-3 pr-10 text-sm ring-offset-background focus:outline-none focus:border-input focus:ring-1 focus:ring-ring focus:ring-offset-0 disabled:opacity-50", l = c(({ className: o, id: r, ...t }, e) => {
|
|
6
6
|
const { controlId: n } = f(u);
|
|
7
|
-
return s("select", { ...t, ref: e, id: r || n, className: i(d, o) });
|
|
7
|
+
return /* @__PURE__ */ s("select", { ...t, ref: e, id: r || n, className: i(d, o) });
|
|
8
8
|
});
|
|
9
9
|
l.displayName = "FormSelect";
|
|
10
10
|
export {
|