@uva-glass/component-library
Version:
React components UvA
101 lines (100 loc) • 2.63 kB
JavaScript
import { jsx as e } from "react/jsx-runtime";
import { useState as d, useRef as g } from "react";
import { fn as p } from "../../index-DXR-TB1d.js";
import { InputField as o } from "./InputField.js";
import { Container as u } from "../../storyComponents/Container/Container.js";
import { Icon as f } from "../Icon/Icon.js";
import "../Buttons/Button.js";
import "../Buttons/LinkButton.js";
import "@react-aria/button";
import "../Checkbox/Checkbox.js";
import "@react-aria/dialog";
import "@react-aria/focus";
import "@react-aria/overlays";
import "../OverlayCloseButton/OverlayCloseButton.js";
import "../GridRow/GridRow.js";
import "../IconButton/IconButton.js";
import "../Input/Input.js";
import "react-router";
import "../../TablePlugin-MjKuocl4.js";
import "../RteEditor/Providers/LanguageProvider.js";
import "../RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
import "../RteEditor/hooks/components/Flyout.js";
import "../../index-B3c5pcHk.js";
import "../SelectListbox/SelectListbox.js";
import "../SelectListbox/SelectProvider.js";
import "../Sortable/components/SortableItem.js";
import "../../SortableProvider-Ck_XnBVq.js";
const C = `
// Has all HTMLInputElement props available except "className" and "style"
<InputField aria-labelledby={aria-labelledby} id={id} onChange={onChangeFunction}
value={value} type={type} clearTrigger={clearTrigger} />
`, h = (t) => {
const r = t.variant ?? [];
return { ...t, variant: r.toString() };
}, Q = {
title: "Atoms/InputField",
component: o,
argTypes: {
variant: {
options: ["large"],
control: "check"
},
type: {
control: "radio",
options: ["text", "password", "email"]
},
id: {
control: "text"
},
autoComplete: {
table: {
disable: !0
}
}
},
parameters: {
inspectComponent: o,
codeString: C
}
}, a = (t) => {
const [r, i] = d(""), l = g(null), m = (c) => {
i(c.target.value), p()("handleChange");
}, s = () => {
i(""), p()("handleClear");
};
return /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(
o,
{
...h(t),
value: r,
onChange: m,
onClear: s,
ref: l
}
) });
}, n = {
type: "text",
variant: void 0,
id: "4f9ca77d"
}, b = a.bind({});
b.args = {
...n
};
const v = a.bind({});
v.args = {
...n,
clearTrigger: "Clear"
};
const y = a.bind({});
y.args = {
...n,
clearTrigger: /* @__PURE__ */ e(f, { name: "Cross" })
};
export {
b as InputFieldExample,
y as WithIconClearTrigger,
v as WithStringClearTrigger,
Q as default
};
//# sourceMappingURL=InputField.stories.js.map