jcicl 1.0.42 → 1.0.44

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.
@@ -1,10 +1,10 @@
1
- import { jsx as e, jsxs as h } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as h } from "react/jsx-runtime";
2
2
  import { createElement as x } from "react";
3
- import { n as p } from "../.chunks/emotion-styled.browser.esm.js";
3
+ import { n as m } from "../.chunks/emotion-styled.browser.esm.js";
4
4
  import { Button as b } from "../Button/Button.js";
5
5
  import { Flex as u } from "../Flex/Flex.js";
6
- import a from "../theme.js";
7
- const g = p("div")`
6
+ import s from "../theme.js";
7
+ const g = m("div")`
8
8
  position: fixed;
9
9
  top: 0;
10
10
  left: 0;
@@ -12,25 +12,26 @@ const g = p("div")`
12
12
  bottom: 0;
13
13
  background-color: rgba(0, 0, 0, 0.5);
14
14
  display: flex;
15
- align-items: center;
15
+ align-items: start;
16
16
  justify-content: center;
17
+ padding-top: 13vh;
17
18
  z-index: 2000;
18
- `, C = p("div")`
19
+ `, v = m("div")`
19
20
  padding: 16px;
20
- background-color: ${a.colors.midnight};
21
- color: ${a.colors.white};
21
+ background-color: ${s.colors.white};
22
+ color: ${s.colors.black};
22
23
  border-radius: 15px;
23
24
  font-size: 0.875rem;
24
25
  min-width: 300px;
25
26
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
26
- `, m = ({ message: i, buttonNames: c = ["OK"], buttonProps: d = [{}], onComplete: n }) => {
27
- const s = (o, t) => {
27
+ `, p = ({ message: i, buttonNames: c = ["OK"], buttonProps: d = [{}], onComplete: e }) => {
28
+ const a = (o, t) => {
28
29
  const l = o ? o(t) : void 0;
29
- n == null || n(l);
30
+ e == null || e(l);
30
31
  };
31
- return /* @__PURE__ */ e(g, { children: /* @__PURE__ */ e(C, { role: "dialog", "aria-modal": "true", children: /* @__PURE__ */ h(u, { column: !0, gap: "16px", children: [
32
- /* @__PURE__ */ e(u, { column: !0, children: i }),
33
- /* @__PURE__ */ e(u, { justifyContent: "flex-end", gap: "8px", children: c.map((o, t) => {
32
+ return /* @__PURE__ */ n(g, { children: /* @__PURE__ */ n(v, { role: "dialog", "aria-modal": "true", children: /* @__PURE__ */ h(u, { column: !0, gap: "16px", children: [
33
+ /* @__PURE__ */ n(u, { column: !0, children: i }),
34
+ /* @__PURE__ */ n(u, { justifyContent: "flex-end", gap: "8px", children: c.map((o, t) => {
34
35
  const l = o === "Cancel" || o === "Close", r = d[t] || {};
35
36
  return /* @__PURE__ */ x(
36
37
  b,
@@ -38,25 +39,25 @@ const g = p("div")`
38
39
  ...r,
39
40
  key: t,
40
41
  variant: l && !r.variant ? "custom" : r.variant || 1,
41
- onClick: (f) => s(r.onClick, f),
42
- backgroundColor: l && !r.backgroundColor ? a.colors.charcoal : r.backgroundColor,
43
- hoverColor: l && !r.hoverColor ? a.colors.slate : r.hoverColor
42
+ onClick: (f) => a(r.onClick, f),
43
+ backgroundColor: l && !r.backgroundColor ? s.colors.charcoal : r.backgroundColor,
44
+ hoverColor: l && !r.hoverColor ? s.colors.slate : r.hoverColor
44
45
  },
45
46
  o
46
47
  );
47
48
  }) })
48
49
  ] }) }) });
49
- }, A = ({ type: i, message: c, buttonNames: d, buttonProps: n, onComplete: s }) => {
50
+ }, A = ({ type: i, message: c, buttonNames: d, buttonProps: e, onComplete: a }) => {
50
51
  if (i === "alert")
51
- return /* @__PURE__ */ e(m, { message: c, buttonProps: [{ onClick: () => !0 }], onComplete: s });
52
- let o = d, t = n;
53
- return i === "confirm" && (o = ["OK", "Cancel"], t = [{ onClick: () => !0 }, { onClick: () => !1 }]), /* @__PURE__ */ e(
54
- m,
52
+ return /* @__PURE__ */ n(p, { message: c, buttonProps: [{ onClick: () => !0 }], onComplete: a });
53
+ let o = d, t = e;
54
+ return i === "confirm" && (o = ["OK", "Cancel"], t = [{ onClick: () => !0 }, { onClick: () => !1 }]), /* @__PURE__ */ n(
55
+ p,
55
56
  {
56
57
  message: c,
57
58
  buttonNames: o,
58
59
  buttonProps: t,
59
- onComplete: s
60
+ onComplete: a
60
61
  }
61
62
  );
62
63
  };
@@ -1,10 +1,11 @@
1
+ import { FormInputType } from '../FormInput';
1
2
  import { DropdownOption } from '../LabeledDropdown';
2
3
  import { AllInputProps } from '../FormInput/FormInput';
3
4
  export type FormField = {
4
5
  key: string;
5
6
  label?: string;
6
7
  sublabel?: string;
7
- type: 'checkbox' | 'currency' | 'date' | 'dropdown' | 'email' | 'multiDropdown' | 'number' | 'phone' | 'zip' | 'radio' | 'text' | 'textarea' | 'url';
8
+ type: FormInputType;
8
9
  options?: DropdownOption[];
9
10
  limit?: number;
10
11
  defaultValue?: string | number;
@@ -1,57 +1,59 @@
1
- import { jsxs as f, Fragment as D, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as C, Fragment as D, jsx as l } from "react/jsx-runtime";
2
2
  import { FormInput as p } from "../FormInput/FormInput.js";
3
- import { FormSectionTitle as g, FormFieldGrid as j, FormFieldCheckboxContainer as C } from "../FormComponents/FormComponents.js";
4
- import S from "../theme.js";
5
- import { u as z } from "../.chunks/useMediaQuery.js";
6
- const V = ({
7
- title: a,
3
+ import { FormSectionTitle as g, FormFieldGrid as j, FormFieldCheckboxContainer as T } from "../FormComponents/FormComponents.js";
4
+ import { isTablet as G } from "../utils.js";
5
+ const q = ({
6
+ title: t,
8
7
  fields: h,
9
- columns: v = z(`(max-width: ${S.screenSizes.tablet})`) ? 2 : 3,
10
- columnsOverride: w,
11
- gap: b = 21,
12
- noLabel: s = !1,
8
+ columns: v,
9
+ columnsOverride: b,
10
+ gap: w = 21,
11
+ noLabel: a = !1,
13
12
  checkboxContainer: F = !1,
14
13
  formDefaults: c,
15
14
  onChange: x
16
- }) => /* @__PURE__ */ f(D, { children: [
17
- a && /* @__PURE__ */ n(g, { children: a }),
18
- !F && /* @__PURE__ */ n(j, { columns: v, columnsOverride: w, gap: b, children: h.map(({ key: r, label: e, type: o, limit: d, options: l, defaultValue: i, ...u }) => {
19
- const m = c[r] !== void 0 ? c[r] : i !== void 0 ? i : o === "multiDropdown" ? [] : o === "checkbox" ? !1 : "";
20
- return /* @__PURE__ */ n(
21
- p,
22
- {
23
- onChange: (t) => x(r, t, o),
24
- label: e,
25
- type: o,
26
- limit: d,
27
- ...o === "checkbox" ? { checked: !!m } : { value: m },
28
- noLabel: s,
29
- options: l,
30
- multiple: o === "multiDropdown",
31
- ...u
32
- },
33
- r
34
- );
35
- }) }),
36
- F && /* @__PURE__ */ n(C, { children: h.map(({ key: r, label: e, type: o, limit: d, options: l, defaultValue: i, ...u }) => {
37
- const m = c[r] !== void 0 ? c[r] : i !== void 0 ? i : o === "multiDropdown" ? [] : o === "checkbox" ? !1 : "";
38
- return /* @__PURE__ */ n(
39
- p,
40
- {
41
- onChange: (t) => x(r, t, o),
42
- label: e,
43
- type: o,
44
- limit: d,
45
- ...o === "checkbox" ? { checked: !!m } : { defaultValue: m },
46
- noLabel: s,
47
- options: l,
48
- multiple: o === "multiDropdown",
49
- ...u
50
- },
51
- r
52
- );
53
- }) })
54
- ] });
15
+ }) => {
16
+ const f = v ?? (G() ? 2 : 3);
17
+ return /* @__PURE__ */ C(D, { children: [
18
+ t && /* @__PURE__ */ l(g, { children: t }),
19
+ !F && /* @__PURE__ */ l(j, { columns: f, columnsOverride: b, gap: w, children: h.map(({ key: r, label: m, type: o, limit: d, options: u, defaultValue: i, ...e }) => {
20
+ const n = c[r] !== void 0 ? c[r] : i !== void 0 ? i : o === "multiDropdown" ? [] : o === "checkbox" ? !1 : "";
21
+ return /* @__PURE__ */ l(
22
+ p,
23
+ {
24
+ onChange: (s) => x(r, s, o),
25
+ label: m,
26
+ type: o,
27
+ limit: d,
28
+ ...o === "checkbox" ? { checked: !!n } : { value: n },
29
+ noLabel: a,
30
+ options: u,
31
+ multiple: o === "multiDropdown",
32
+ ...e
33
+ },
34
+ r
35
+ );
36
+ }) }),
37
+ F && /* @__PURE__ */ l(T, { children: h.map(({ key: r, label: m, type: o, limit: d, options: u, defaultValue: i, ...e }) => {
38
+ const n = c[r] !== void 0 ? c[r] : i !== void 0 ? i : o === "multiDropdown" ? [] : o === "checkbox" ? !1 : "";
39
+ return /* @__PURE__ */ l(
40
+ p,
41
+ {
42
+ onChange: (s) => x(r, s, o),
43
+ label: m,
44
+ type: o,
45
+ limit: d,
46
+ ...o === "checkbox" ? { checked: !!n } : { defaultValue: n },
47
+ noLabel: a,
48
+ options: u,
49
+ multiple: o === "multiDropdown",
50
+ ...e
51
+ },
52
+ r
53
+ );
54
+ }) })
55
+ ] });
56
+ };
55
57
  export {
56
- V as default
58
+ q as default
57
59
  };
@@ -2,11 +2,19 @@ import { LabeledInputProps } from '../LabeledInput';
2
2
  import { LabeledCurrencyInputProps } from '../LabeledCurrencyInput';
3
3
  import { LabeledCheckboxProps } from '../LabeledCheckbox';
4
4
  import { LabeledRadioProps } from '../LabeledRadio';
5
- import { LabeledDropdownProps } from '../LabeledDropdown';
5
+ import { LabeledDropdownProps, DropdownOption } from '../LabeledDropdown';
6
6
  import { LabeledTextAreaProps } from '../LabeledTextArea/LabeledTextArea';
7
7
  export type AllInputProps = LabeledInputProps & LabeledCheckboxProps & LabeledRadioProps & LabeledDropdownProps & LabeledCurrencyInputProps & LabeledTextAreaProps;
8
- export type FormInputProps = AllInputProps & {
9
- type?: 'text' | 'dropdown' | 'date' | 'number' | 'checkbox' | 'radio' | 'textarea' | 'currency' | 'multiDropdown';
8
+ export type FormInputType = 'checkbox' | 'currency' | 'date' | 'dropdown' | 'email' | 'multiDropdown' | 'number' | 'phone' | 'radio' | 'text' | 'textarea' | 'url' | 'zip';
9
+ type ConflictingKeys = 'onChange' | 'options' | 'value' | 'checked' | 'defaultValue' | 'label';
10
+ export type FormInputProps = Partial<Omit<AllInputProps, ConflictingKeys | 'type'>> & {
11
+ type?: FormInputType;
12
+ onChange?: (event: any, ...args: any[]) => void;
13
+ options?: DropdownOption[];
14
+ value?: unknown;
15
+ checked?: boolean;
16
+ defaultValue?: unknown;
17
+ label?: string;
10
18
  };
11
19
  export declare const FormInput: React.FC<FormInputProps>;
12
20
  export default FormInput;
@@ -1 +1 @@
1
- export { default, type FormInputProps } from './FormInput.tsx';
1
+ export { default, type FormInputProps, type FormInputType } from './FormInput.tsx';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jcicl",
3
3
  "private": false,
4
- "version": "1.0.42",
4
+ "version": "1.0.44",
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",