jcicl 0.0.211 → 0.0.213

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.
@@ -0,0 +1,11 @@
1
+ import { InputProps } from '../../../../../../../../../src/components/base/Input';
2
+ export interface StyleProps {
3
+ grid?: boolean;
4
+ }
5
+ export interface LabeledCurrencyInputProps extends InputProps {
6
+ label: string;
7
+ grid?: boolean;
8
+ noLabel?: boolean;
9
+ }
10
+ export declare const LabeledCurrencyInput: React.FC<LabeledCurrencyInputProps>;
11
+ export default LabeledCurrencyInput;
@@ -0,0 +1,51 @@
1
+ import { jsxs as s, jsx as m } from "react/jsx-runtime";
2
+ import { useState as f } from "react";
3
+ import { n as d } from "../.chunks/emotion-styled.browser.esm.js";
4
+ import { c as g } from "../.chunks/emotion-react.browser.esm.js";
5
+ import { Input as h } from "../Input/Input.js";
6
+ const w = d("div")(({ grid: t }) => ({
7
+ ...g`
8
+ display: flex;
9
+ flex-wrap: nowrap;
10
+ gap: 9px;
11
+ font-family: 'Roboto', sans-serif;
12
+
13
+ span {
14
+ white-space: nowrap;
15
+ font-weight: bold;
16
+ }
17
+
18
+ .MuiTextField-root {
19
+ flex-grow: 1;
20
+ }
21
+
22
+ .MuiCurrencyInputBase-root {
23
+ width: ${t && "100%"};
24
+ }
25
+ `
26
+ })), j = ({
27
+ label: t,
28
+ grid: l = !0,
29
+ noLabel: p = !1,
30
+ onChange: r,
31
+ ...u
32
+ }) => {
33
+ const [i, n] = f("");
34
+ return /* @__PURE__ */ s(w, { grid: l, className: "jcLabeledCurrencyInput", children: [
35
+ !p && /* @__PURE__ */ s("span", { children: [
36
+ t,
37
+ ":"
38
+ ] }),
39
+ /* @__PURE__ */ m(h, { ...u, onChange: (a) => {
40
+ const { value: c } = a.target, e = c.replace(/[^0-9.-]+/g, ""), o = new Intl.NumberFormat("en-US", {
41
+ style: "decimal",
42
+ maximumFractionDigits: 2
43
+ }).format(Number(e) || 0);
44
+ e && e.length > 1 && e[e.length - 1] === "." ? n(o + ".") : n(o), r && r(a);
45
+ }, value: `$${i}` })
46
+ ] });
47
+ };
48
+ export {
49
+ j as LabeledCurrencyInput,
50
+ j as default
51
+ };
@@ -0,0 +1 @@
1
+ export { default, type LabeledCurrencyInputProps } from './LabeledCurrencyInput';
@@ -0,0 +1,4 @@
1
+ import { LabeledCurrencyInput as a } from "./LabeledCurrencyInput.js";
2
+ export {
3
+ a as default
4
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jcicl",
3
3
  "private": false,
4
- "version": "0.0.211",
4
+ "version": "0.0.213",
5
5
  "description": "Component library for the websites of Johnson County Iowa",
6
6
  "license": "MIT",
7
7
  "homepage": "https://devops.jc.net/JCIT/Business%20Solutions%20Delivery/_git/JCComponentLibrary?path=%2FREADME.md&version=GBmaster",