jcicl 1.0.30 → 1.0.32

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,6 +1,6 @@
1
1
  import { ButtonProps as MuiButtonProps } from '@mui/material/Button/Button';
2
2
  export interface ButtonProps extends Omit<MuiButtonProps, 'variant' | 'size' | 'color'> {
3
- variant?: 1 | 2 | 'unstyled' | 'copy' | 'icon' | 'bibi' | 'bibiOutlined' | 'bibiInverse' | 'filter' | 'custom' | 'pill';
3
+ variant?: 1 | 2 | 'unstyled' | 'copy' | 'icon' | 'bibi' | 'bibiOutlined' | 'bibiInverse' | 'filter' | 'custom' | 'pill' | 'form';
4
4
  size?: number;
5
5
  color?: string;
6
6
  highlightColor?: string;
package/Button/Button.js CHANGED
@@ -1,44 +1,44 @@
1
- import { jsxs as T, jsx as i } from "react/jsx-runtime";
1
+ import { jsxs as N, jsx as i } from "react/jsx-runtime";
2
2
  import * as B from "react";
3
- import { useState as q } from "react";
4
- import { g as J, a as K, s, r as Q, c as p, u as X, b as W, P as e, d as Y, e as h } from "../.chunks/DefaultPropsProvider.js";
5
- import { m as Z } from "../.chunks/memoTheme.js";
6
- import { c as oo } from "../.chunks/createSimplePaletteValueFilter.js";
3
+ import { useState as J } from "react";
4
+ import { g as K, a as Q, s, r as X, c as p, u as Y, b as j, P as e, d as Z, e as h } from "../.chunks/DefaultPropsProvider.js";
5
+ import { m as oo } from "../.chunks/memoTheme.js";
6
+ import { c as to } from "../.chunks/createSimplePaletteValueFilter.js";
7
7
  import { B as k } from "../.chunks/ButtonBase.js";
8
- import { r as to } from "../.chunks/resolveProps.js";
9
- import { i as ro } from "../.chunks/emotion-styled.browser.esm.js";
8
+ import { r as ro } from "../.chunks/resolveProps.js";
9
+ import { i as eo } from "../.chunks/emotion-styled.browser.esm.js";
10
10
  import { c as g } from "../.chunks/emotion-react.browser.esm.js";
11
11
  import t from "../theme.js";
12
- import { Tooltip as eo } from "../Tooltip/Tooltip.js";
12
+ import { Tooltip as no } from "../Tooltip/Tooltip.js";
13
13
  import { useThemeColors as ao } from "../ThemeContext.js";
14
- import { C as no } from "../.chunks/check.js";
15
- function io(o) {
16
- return J("MuiButton", o);
14
+ import { C as io } from "../.chunks/check.js";
15
+ function so(o) {
16
+ return K("MuiButton", o);
17
17
  }
18
- const x = K("MuiButton", ["root", "text", "textInherit", "textPrimary", "textSecondary", "textSuccess", "textError", "textInfo", "textWarning", "outlined", "outlinedInherit", "outlinedPrimary", "outlinedSecondary", "outlinedSuccess", "outlinedError", "outlinedInfo", "outlinedWarning", "contained", "containedInherit", "containedPrimary", "containedSecondary", "containedSuccess", "containedError", "containedInfo", "containedWarning", "disableElevation", "focusVisible", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorSuccess", "colorError", "colorInfo", "colorWarning", "textSizeSmall", "textSizeMedium", "textSizeLarge", "outlinedSizeSmall", "outlinedSizeMedium", "outlinedSizeLarge", "containedSizeSmall", "containedSizeMedium", "containedSizeLarge", "sizeMedium", "sizeSmall", "sizeLarge", "fullWidth", "startIcon", "endIcon", "icon", "iconSizeSmall", "iconSizeMedium", "iconSizeLarge"]), j = /* @__PURE__ */ B.createContext({});
19
- process.env.NODE_ENV !== "production" && (j.displayName = "ButtonGroupContext");
20
- const V = /* @__PURE__ */ B.createContext(void 0);
21
- process.env.NODE_ENV !== "production" && (V.displayName = "ButtonGroupButtonContext");
22
- const so = (o) => {
18
+ const x = Q("MuiButton", ["root", "text", "textInherit", "textPrimary", "textSecondary", "textSuccess", "textError", "textInfo", "textWarning", "outlined", "outlinedInherit", "outlinedPrimary", "outlinedSecondary", "outlinedSuccess", "outlinedError", "outlinedInfo", "outlinedWarning", "contained", "containedInherit", "containedPrimary", "containedSecondary", "containedSuccess", "containedError", "containedInfo", "containedWarning", "disableElevation", "focusVisible", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorSuccess", "colorError", "colorInfo", "colorWarning", "textSizeSmall", "textSizeMedium", "textSizeLarge", "outlinedSizeSmall", "outlinedSizeMedium", "outlinedSizeLarge", "containedSizeSmall", "containedSizeMedium", "containedSizeLarge", "sizeMedium", "sizeSmall", "sizeLarge", "fullWidth", "startIcon", "endIcon", "icon", "iconSizeSmall", "iconSizeMedium", "iconSizeLarge"]), F = /* @__PURE__ */ B.createContext({});
19
+ process.env.NODE_ENV !== "production" && (F.displayName = "ButtonGroupContext");
20
+ const P = /* @__PURE__ */ B.createContext(void 0);
21
+ process.env.NODE_ENV !== "production" && (P.displayName = "ButtonGroupButtonContext");
22
+ const lo = (o) => {
23
23
  const {
24
24
  color: r,
25
- disableElevation: a,
26
- fullWidth: n,
27
- size: c,
25
+ disableElevation: n,
26
+ fullWidth: a,
27
+ size: d,
28
28
  variant: u,
29
29
  classes: b
30
- } = o, v = {
31
- root: ["root", u, `${u}${p(r)}`, `size${p(c)}`, `${u}Size${p(c)}`, `color${p(r)}`, a && "disableElevation", n && "fullWidth"],
30
+ } = o, f = {
31
+ root: ["root", u, `${u}${p(r)}`, `size${p(d)}`, `${u}Size${p(d)}`, `color${p(r)}`, n && "disableElevation", a && "fullWidth"],
32
32
  label: ["label"],
33
- startIcon: ["icon", "startIcon", `iconSize${p(c)}`],
34
- endIcon: ["icon", "endIcon", `iconSize${p(c)}`]
35
- }, f = Y(v, io, b);
33
+ startIcon: ["icon", "startIcon", `iconSize${p(d)}`],
34
+ endIcon: ["icon", "endIcon", `iconSize${p(d)}`]
35
+ }, v = Z(f, so, b);
36
36
  return {
37
37
  ...b,
38
38
  // forward the focused, disabled, etc. classes to the ButtonBase
39
- ...f
39
+ ...v
40
40
  };
41
- }, F = [{
41
+ }, V = [{
42
42
  props: {
43
43
  size: "small"
44
44
  },
@@ -65,20 +65,20 @@ const so = (o) => {
65
65
  fontSize: 22
66
66
  }
67
67
  }
68
- }], lo = s(k, {
69
- shouldForwardProp: (o) => Q(o) || o === "classes",
68
+ }], co = s(k, {
69
+ shouldForwardProp: (o) => X(o) || o === "classes",
70
70
  name: "MuiButton",
71
71
  slot: "Root",
72
72
  overridesResolver: (o, r) => {
73
73
  const {
74
- ownerState: a
74
+ ownerState: n
75
75
  } = o;
76
- return [r.root, r[a.variant], r[`${a.variant}${p(a.color)}`], r[`size${p(a.size)}`], r[`${a.variant}Size${p(a.size)}`], a.color === "inherit" && r.colorInherit, a.disableElevation && r.disableElevation, a.fullWidth && r.fullWidth];
76
+ return [r.root, r[n.variant], r[`${n.variant}${p(n.color)}`], r[`size${p(n.size)}`], r[`${n.variant}Size${p(n.size)}`], n.color === "inherit" && r.colorInherit, n.disableElevation && r.disableElevation, n.fullWidth && r.fullWidth];
77
77
  }
78
- })(Z(({
78
+ })(oo(({
79
79
  theme: o
80
80
  }) => {
81
- const r = o.palette.mode === "light" ? o.palette.grey[300] : o.palette.grey[800], a = o.palette.mode === "light" ? o.palette.grey.A100 : o.palette.grey[700];
81
+ const r = o.palette.mode === "light" ? o.palette.grey[300] : o.palette.grey[800], n = o.palette.mode === "light" ? o.palette.grey.A100 : o.palette.grey[700];
82
82
  return {
83
83
  ...o.typography.button,
84
84
  minWidth: 64,
@@ -144,22 +144,22 @@ const so = (o) => {
144
144
  color: "var(--variant-textColor)",
145
145
  backgroundColor: "var(--variant-textBg)"
146
146
  }
147
- }, ...Object.entries(o.palette).filter(oo()).map(([n]) => ({
147
+ }, ...Object.entries(o.palette).filter(to()).map(([a]) => ({
148
148
  props: {
149
- color: n
149
+ color: a
150
150
  },
151
151
  style: {
152
- "--variant-textColor": (o.vars || o).palette[n].main,
153
- "--variant-outlinedColor": (o.vars || o).palette[n].main,
154
- "--variant-outlinedBorder": o.vars ? `rgba(${o.vars.palette[n].mainChannel} / 0.5)` : h(o.palette[n].main, 0.5),
155
- "--variant-containedColor": (o.vars || o).palette[n].contrastText,
156
- "--variant-containedBg": (o.vars || o).palette[n].main,
152
+ "--variant-textColor": (o.vars || o).palette[a].main,
153
+ "--variant-outlinedColor": (o.vars || o).palette[a].main,
154
+ "--variant-outlinedBorder": o.vars ? `rgba(${o.vars.palette[a].mainChannel} / 0.5)` : h(o.palette[a].main, 0.5),
155
+ "--variant-containedColor": (o.vars || o).palette[a].contrastText,
156
+ "--variant-containedBg": (o.vars || o).palette[a].main,
157
157
  "@media (hover: hover)": {
158
158
  "&:hover": {
159
- "--variant-containedBg": (o.vars || o).palette[n].dark,
160
- "--variant-textBg": o.vars ? `rgba(${o.vars.palette[n].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : h(o.palette[n].main, o.palette.action.hoverOpacity),
161
- "--variant-outlinedBorder": (o.vars || o).palette[n].main,
162
- "--variant-outlinedBg": o.vars ? `rgba(${o.vars.palette[n].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : h(o.palette[n].main, o.palette.action.hoverOpacity)
159
+ "--variant-containedBg": (o.vars || o).palette[a].dark,
160
+ "--variant-textBg": o.vars ? `rgba(${o.vars.palette[a].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : h(o.palette[a].main, o.palette.action.hoverOpacity),
161
+ "--variant-outlinedBorder": (o.vars || o).palette[a].main,
162
+ "--variant-outlinedBg": o.vars ? `rgba(${o.vars.palette[a].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : h(o.palette[a].main, o.palette.action.hoverOpacity)
163
163
  }
164
164
  }
165
165
  }
@@ -173,7 +173,7 @@ const so = (o) => {
173
173
  "--variant-containedBg": o.vars ? o.vars.palette.Button.inheritContainedBg : r,
174
174
  "@media (hover: hover)": {
175
175
  "&:hover": {
176
- "--variant-containedBg": o.vars ? o.vars.palette.Button.inheritContainedHoverBg : a,
176
+ "--variant-containedBg": o.vars ? o.vars.palette.Button.inheritContainedHoverBg : n,
177
177
  "--variant-textBg": o.vars ? `rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})` : h(o.palette.text.primary, o.palette.action.hoverOpacity),
178
178
  "--variant-outlinedBg": o.vars ? `rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})` : h(o.palette.text.primary, o.palette.action.hoverOpacity)
179
179
  }
@@ -261,14 +261,14 @@ const so = (o) => {
261
261
  }
262
262
  }]
263
263
  };
264
- })), co = s("span", {
264
+ })), po = s("span", {
265
265
  name: "MuiButton",
266
266
  slot: "StartIcon",
267
267
  overridesResolver: (o, r) => {
268
268
  const {
269
- ownerState: a
269
+ ownerState: n
270
270
  } = o;
271
- return [r.startIcon, r[`iconSize${p(a.size)}`]];
271
+ return [r.startIcon, r[`iconSize${p(n.size)}`]];
272
272
  }
273
273
  })({
274
274
  display: "inherit",
@@ -281,15 +281,15 @@ const so = (o) => {
281
281
  style: {
282
282
  marginLeft: -2
283
283
  }
284
- }, ...F]
285
- }), po = s("span", {
284
+ }, ...V]
285
+ }), uo = s("span", {
286
286
  name: "MuiButton",
287
287
  slot: "EndIcon",
288
288
  overridesResolver: (o, r) => {
289
289
  const {
290
- ownerState: a
290
+ ownerState: n
291
291
  } = o;
292
- return [r.endIcon, r[`iconSize${p(a.size)}`]];
292
+ return [r.endIcon, r[`iconSize${p(n.size)}`]];
293
293
  }
294
294
  })({
295
295
  display: "inherit",
@@ -302,59 +302,59 @@ const so = (o) => {
302
302
  style: {
303
303
  marginRight: -2
304
304
  }
305
- }, ...F]
306
- }), M = /* @__PURE__ */ B.forwardRef(function(r, a) {
307
- const n = B.useContext(j), c = B.useContext(V), u = to(n, r), b = X({
305
+ }, ...V]
306
+ }), M = /* @__PURE__ */ B.forwardRef(function(r, n) {
307
+ const a = B.useContext(F), d = B.useContext(P), u = ro(a, r), b = Y({
308
308
  props: u,
309
309
  name: "MuiButton"
310
310
  }), {
311
- children: v,
312
- color: f = "primary",
311
+ children: f,
312
+ color: v = "primary",
313
313
  component: l = "button",
314
314
  className: I,
315
315
  disabled: S = !1,
316
- disableElevation: d = !1,
316
+ disableElevation: c = !1,
317
317
  disableFocusRipple: y = !1,
318
318
  endIcon: m,
319
319
  focusVisibleClassName: z,
320
320
  fullWidth: R = !1,
321
321
  size: O = "medium",
322
322
  startIcon: E,
323
- type: P,
324
- variant: H = "text",
325
- ...D
323
+ type: W,
324
+ variant: D = "text",
325
+ ...U
326
326
  } = b, C = {
327
327
  ...b,
328
- color: f,
328
+ color: v,
329
329
  component: l,
330
330
  disabled: S,
331
- disableElevation: d,
331
+ disableElevation: c,
332
332
  disableFocusRipple: y,
333
333
  fullWidth: R,
334
334
  size: O,
335
- type: P,
336
- variant: H
337
- }, $ = so(C), U = E && /* @__PURE__ */ i(co, {
335
+ type: W,
336
+ variant: D
337
+ }, $ = lo(C), _ = E && /* @__PURE__ */ i(po, {
338
338
  className: $.startIcon,
339
339
  ownerState: C,
340
340
  children: E
341
- }), _ = m && /* @__PURE__ */ i(po, {
341
+ }), A = m && /* @__PURE__ */ i(uo, {
342
342
  className: $.endIcon,
343
343
  ownerState: C,
344
344
  children: m
345
- }), A = c || "";
346
- return /* @__PURE__ */ T(lo, {
345
+ }), q = d || "";
346
+ return /* @__PURE__ */ N(co, {
347
347
  ownerState: C,
348
- className: W(n.className, $.root, I, A),
348
+ className: j(a.className, $.root, I, q),
349
349
  component: l,
350
350
  disabled: S,
351
351
  focusRipple: !y,
352
- focusVisibleClassName: W($.focusVisible, z),
353
- ref: a,
354
- type: P,
355
- ...D,
352
+ focusVisibleClassName: j($.focusVisible, z),
353
+ ref: n,
354
+ type: W,
355
+ ...U,
356
356
  classes: $,
357
- children: [U, v, _]
357
+ children: [_, f, A]
358
358
  });
359
359
  });
360
360
  process.env.NODE_ENV !== "production" && (M.propTypes = {
@@ -471,7 +471,7 @@ const G = [
471
471
  span {
472
472
  align-items: center !important;
473
473
  }
474
- `, uo = s(w)`
474
+ `, bo = s(w)`
475
475
  background-color: ${t.colors.green};
476
476
  height: 2.5rem;
477
477
  border: 2px solid transparent;
@@ -490,39 +490,39 @@ const G = [
490
490
  &:disabled {
491
491
  background-color: ${t.colors.darkGreen};
492
492
  }
493
- `, bo = s(w, {
493
+ `, go = s(w, {
494
494
  shouldForwardProp: (o) => !G.includes(o)
495
495
  })(
496
496
  ({
497
497
  customBackgroundColor: o = t.colors.green,
498
498
  customHoverColor: r = t.colors.darkGreen,
499
- customTextColor: a = t.colors.white,
500
- customShadow1: n = t.boxShadows.gray63,
501
- customShadow2: c = t.boxShadows.black63
499
+ customTextColor: n = t.colors.white,
500
+ customShadow1: a = t.boxShadows.gray63,
501
+ customShadow2: d = t.boxShadows.black63
502
502
  }) => ({
503
503
  ...g`
504
504
  background-color: ${o};
505
505
  border-radius: 0;
506
506
  height: 2.5rem;
507
507
  border: 2px solid transparent;
508
- color: ${a};
508
+ color: ${n};
509
509
  transition: 313ms all ease-in;
510
510
  border-radius: 32px;
511
511
  font-weight: 400;
512
512
  padding: 0.75rem 2rem;
513
513
  font-size: 1rem;
514
- box-shadow: ${n};
514
+ box-shadow: ${a};
515
515
  &:hover,
516
516
  :focus-visible {
517
517
  background-color: ${r};
518
- box-shadow: ${c};
518
+ box-shadow: ${d};
519
519
  }
520
520
  &:disabled {
521
521
  background-color: ${r};
522
522
  }
523
523
  `
524
524
  })
525
- ), go = s(w)`
525
+ ), L = s(w)`
526
526
  background-color: ${t.colors.gold};
527
527
  height: 2.5rem;
528
528
  border: 2px solid transparent;
@@ -541,7 +541,10 @@ const G = [
541
541
  &:disabled {
542
542
  background-color: ${t.colors.goldHover};
543
543
  }
544
- `, N = s(w)(({ width: o = "114px" }) => ({
544
+ `, xo = s(L)`
545
+ width: 447px;
546
+ align-self: center;
547
+ `, T = s(w)(({ width: o = "114px" }) => ({
545
548
  ...g`
546
549
  box-sizing: border-box;
547
550
  background-color: ${t.colors.bibiBlue};
@@ -559,7 +562,7 @@ const G = [
559
562
  background-color: ${t.colors.bibiBlueHover};
560
563
  }
561
564
  `
562
- })), xo = s(N)(({ active: o }) => ({
565
+ })), fo = s(T)(({ active: o }) => ({
563
566
  ...g`
564
567
  background-color: ${o && t.colors.white};
565
568
  color: ${o && t.colors.bibiBlue};
@@ -569,7 +572,7 @@ const G = [
569
572
  color: ${t.colors.bibiBlue};
570
573
  }
571
574
  `
572
- })), vo = s(N)(() => ({
575
+ })), vo = s(T)(() => ({
573
576
  ...g`
574
577
  background-color: ${t.colors.white};
575
578
  color: ${t.colors.bibiBlue};
@@ -580,13 +583,13 @@ const G = [
580
583
  color: ${t.colors.white};
581
584
  }
582
585
  `
583
- })), L = s(k)`
586
+ })), H = s(k)`
584
587
  display: block;
585
- `, fo = s(L)`
588
+ `, yo = s(H)`
586
589
  font-family: inherit;
587
590
  font-size: inherit;
588
591
  font-weight: inherit;
589
- `, yo = s("div")`
592
+ `, mo = s("div")`
590
593
  display: flex;
591
594
  .isCopied {
592
595
  color: ${t.colors.gray};
@@ -601,10 +604,10 @@ const G = [
601
604
  width: 14px !important;
602
605
  margin: 0;
603
606
  }
604
- `, mo = s(k, {
605
- shouldForwardProp: (o) => typeof o == "string" && ro(o)
607
+ `, $o = s(k, {
608
+ shouldForwardProp: (o) => typeof o == "string" && eo(o)
606
609
  })(
607
- ({ size: o, color: r, highlightColor: a, hoverColor: n }) => ({
610
+ ({ size: o, color: r, highlightColor: n, hoverColor: a }) => ({
608
611
  ...g`
609
612
  display: flex;
610
613
  align-items: center;
@@ -615,9 +618,9 @@ const G = [
615
618
  &:hover,
616
619
  :focus-visible {
617
620
  svg {
618
- filter: drop-shadow(0 0 6px ${a}) drop-shadow(0 0 6px ${a})
619
- drop-shadow(0 0 6px ${a}) drop-shadow(0 0 6px ${a});
620
- fill: ${n || r};
621
+ filter: drop-shadow(0 0 6px ${n}) drop-shadow(0 0 6px ${n})
622
+ drop-shadow(0 0 6px ${n}) drop-shadow(0 0 6px ${n});
623
+ fill: ${a || r};
621
624
  }
622
625
  }
623
626
 
@@ -629,7 +632,7 @@ const G = [
629
632
  }
630
633
  `
631
634
  })
632
- ), $o = s(w)(({ active: o }) => ({
635
+ ), ho = s(w)(({ active: o }) => ({
633
636
  ...g`
634
637
  box-sizing: border-box;
635
638
  background-color: ${o ? t.colors.black : t.colors.white};
@@ -648,7 +651,7 @@ const G = [
648
651
  background-color: ${o ? t.colors.charcoal : t.colors.gray2};
649
652
  }
650
653
  `
651
- })), ho = s(k)(
654
+ })), Bo = s(k)(
652
655
  ({ backgroundColor: o, borderColor: r }) => ({
653
656
  ...g`
654
657
  height: 28px;
@@ -684,71 +687,71 @@ const G = [
684
687
  }
685
688
  `
686
689
  })
687
- ), Wo = ({
690
+ ), Fo = ({
688
691
  variant: o = 1,
689
692
  size: r = 50,
690
- color: a,
691
- highlightColor: n,
692
- hoverColor: c,
693
+ color: n,
694
+ highlightColor: a,
695
+ hoverColor: d,
693
696
  backgroundColor: u,
694
697
  textColor: b,
695
- customShadow1: v,
696
- customShadow2: f,
698
+ customShadow1: f,
699
+ customShadow2: v,
697
700
  children: l,
698
701
  textToCopy: I,
699
702
  active: S,
700
- ...d
703
+ ...c
701
704
  }) => {
702
705
  const y = ao();
703
706
  if (o === "custom")
704
707
  return /* @__PURE__ */ i(
705
- bo,
708
+ go,
706
709
  {
707
710
  customBackgroundColor: u,
708
- customHoverColor: c,
711
+ customHoverColor: d,
709
712
  customTextColor: b,
710
- customShadow1: v,
711
- customShadow2: f,
713
+ customShadow1: f,
714
+ customShadow2: v,
712
715
  className: "jcCustomButton",
713
- ...d,
716
+ ...c,
714
717
  children: l
715
718
  }
716
719
  );
717
720
  if (o === "bibi")
718
- return /* @__PURE__ */ i(N, { ...d, children: l });
721
+ return /* @__PURE__ */ i(T, { ...c, children: l });
719
722
  if (o === "bibiOutlined")
720
- return /* @__PURE__ */ i(xo, { ...d, children: l });
723
+ return /* @__PURE__ */ i(fo, { ...c, children: l });
721
724
  if (o === "bibiInverse")
722
- return /* @__PURE__ */ i(vo, { ...d, children: l });
725
+ return /* @__PURE__ */ i(vo, { ...c, children: l });
723
726
  if (o === "unstyled")
724
- return /* @__PURE__ */ i(L, { ...d, children: l });
727
+ return /* @__PURE__ */ i(H, { ...c, children: l });
725
728
  if (o === "copy") {
726
- const [m, z] = q(!1);
727
- return /* @__PURE__ */ T(yo, { onClick: async () => {
729
+ const [m, z] = J(!1);
730
+ return /* @__PURE__ */ N(mo, { onClick: async () => {
728
731
  try {
729
732
  await navigator.clipboard.writeText(I || String(l)), z(!0), setTimeout(() => z(!1), 1100);
730
733
  } catch (O) {
731
734
  console.error("Failed to copy text: ", O);
732
735
  }
733
736
  }, children: [
734
- /* @__PURE__ */ i(eo, { title: "Copy to clipboard", children: /* @__PURE__ */ i(fo, { ...d, children: l }) }),
735
- m && /* @__PURE__ */ T("span", { className: "isCopied", children: [
736
- /* @__PURE__ */ i(no, { size: 12 }),
737
+ /* @__PURE__ */ i(no, { title: "Copy to clipboard", children: /* @__PURE__ */ i(yo, { ...c, children: l }) }),
738
+ m && /* @__PURE__ */ N("span", { className: "isCopied", children: [
739
+ /* @__PURE__ */ i(io, { size: 12 }),
737
740
  " Copied"
738
741
  ] })
739
742
  ] });
740
743
  }
741
- return o === 2 ? /* @__PURE__ */ i(go, { ...d, children: /* @__PURE__ */ i("span", { children: l }) }) : o === "icon" ? (a = a || t.colors.green, n = n || t.colors.dandelion, c = c || t.colors.green, /* @__PURE__ */ i(mo, { className: "jcIconButton", ...{ size: r, color: a, highlightColor: n, hoverColor: c }, ...d, children: l })) : o === "filter" ? /* @__PURE__ */ i($o, { className: "jcFilterButton", active: S, ...d, children: l }) : o === "pill" ? /* @__PURE__ */ i(
742
- ho,
744
+ return o === 2 ? /* @__PURE__ */ i(L, { ...c, children: /* @__PURE__ */ i("span", { children: l }) }) : o === "icon" ? (n = n || t.colors.green, a = a || t.colors.dandelion, d = d || t.colors.green, /* @__PURE__ */ i($o, { className: "jcIconButton", ...{ size: r, color: n, highlightColor: a, hoverColor: d }, ...c, children: l })) : o === "filter" ? /* @__PURE__ */ i(ho, { className: "jcFilterButton", active: S, ...c, children: l }) : o === "form" ? /* @__PURE__ */ i(xo, { className: "jcFormButton", ...c, children: l }) : o === "pill" ? /* @__PURE__ */ i(
745
+ Bo,
743
746
  {
744
747
  backgroundColor: u || y.themeIconBackgroundB,
745
748
  borderColor: b || y.themeIconBackgroundA,
746
- ...d,
749
+ ...c,
747
750
  children: /* @__PURE__ */ i("span", { children: l })
748
751
  }
749
- ) : /* @__PURE__ */ i(uo, { ...d, children: /* @__PURE__ */ i("span", { children: l }) });
752
+ ) : /* @__PURE__ */ i(bo, { ...c, children: /* @__PURE__ */ i("span", { children: l }) });
750
753
  };
751
754
  export {
752
- Wo as Button,
753
- Wo as default
755
+ Fo as Button,
756
+ Fo as default
754
757
  };
@@ -9,6 +9,7 @@ interface CircularIconWrapperProps {
9
9
  backgroundColor?: string;
10
10
  color?: string;
11
11
  size?: number;
12
+ useThemeColor?: boolean;
12
13
  }
13
14
  declare const CircularIconButton: React.FC<CircularIconButtonProps>;
14
15
  export default CircularIconButton;
@@ -1,11 +1,11 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { n as i } from "../.chunks/emotion-styled.browser.esm.js";
3
- import { c as a } from "../.chunks/emotion-react.browser.esm.js";
4
- import l from "../theme.js";
5
- import { useThemeColors as m } from "../ThemeContext.js";
6
- const u = i("div")(({ backgroundColor: t, size: r, color: o }) => ({
7
- ...a`
8
- background-color: ${t};
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { n as l } from "../.chunks/emotion-styled.browser.esm.js";
3
+ import { c as m } from "../.chunks/emotion-react.browser.esm.js";
4
+ import s from "../theme.js";
5
+ import { useThemeColors as u } from "../ThemeContext.js";
6
+ const f = l("div")(({ backgroundColor: e, size: r, color: o }) => ({
7
+ ...m`
8
+ background-color: ${e};
9
9
  color: ${o};
10
10
  border-radius: 50%;
11
11
  width: ${r}px;
@@ -22,25 +22,26 @@ const u = i("div")(({ backgroundColor: t, size: r, color: o }) => ({
22
22
  transform: scale(1.1);
23
23
  }
24
24
  `
25
- })), x = ({
26
- color: t = l.colors.white,
27
- backgroundColor: r,
25
+ })), b = ({
26
+ color: e = s.colors.white,
27
+ backgroundColor: r = s.colors.green,
28
28
  size: o = 20,
29
29
  onClick: n,
30
- icon: s
30
+ icon: c,
31
+ useThemeColor: i = !1
31
32
  }) => {
32
- const c = m();
33
- return /* @__PURE__ */ e(
34
- u,
33
+ const a = u();
34
+ return /* @__PURE__ */ t(
35
+ f,
35
36
  {
36
- color: t,
37
- backgroundColor: r || c.themeIconBackgroundA,
37
+ color: e,
38
+ backgroundColor: i ? a.themeIconBackgroundA : r,
38
39
  size: o * 1.2,
39
40
  onClick: n,
40
- children: /* @__PURE__ */ e(s, { size: o * 0.8 })
41
+ children: /* @__PURE__ */ t(c, { size: o * 0.8 })
41
42
  }
42
43
  );
43
44
  };
44
45
  export {
45
- x as default
46
+ b as default
46
47
  };
@@ -1,74 +1,82 @@
1
- import { jsx as N } from "react/jsx-runtime";
2
- import { createContext as w, useState as E, useEffect as P, useMemo as $ } from "react";
3
- import { formatPhoneNumber as C } from "../utils.js";
4
- function I(b) {
5
- const { name: n, defaultValues: s = {}, onInputChangeExtensions: u = [], submit: m, debug: a = !1 } = b, i = w({
6
- onFormInputChange: () => console.error(`Failed to update form input. ${n}FormContext not initialized`),
1
+ import { jsx as w } from "react/jsx-runtime";
2
+ import { createContext as E, useState as P, useCallback as C, useEffect as $, useMemo as k } from "react";
3
+ import { formatPhoneNumber as D } from "../utils.js";
4
+ function M(g) {
5
+ const { name: e, defaultValues: s = {}, onInputChangeExtensions: u = [], submit: o, debug: r = !1 } = g, c = E({
6
+ onFormInputChange: () => console.error(`Failed to update form input. ${e}FormContext not initialized`),
7
7
  formData: s,
8
- setFormData: () => console.error(`Failed to set form data. ${n}FormContext not initialized`),
9
- resetForm: () => console.error(`Failed to reset form. ${n}FormContext not initialized`)
8
+ setFormData: () => console.error(`Failed to set form data. ${e}FormContext not initialized`),
9
+ resetForm: () => console.error(`Failed to reset form. ${e}FormContext not initialized`)
10
10
  });
11
- return { Context: i, Provider: ({ children: x }) => {
12
- const [e, r] = E(s), d = (g, t, c) => {
13
- r((l) => {
14
- let o;
15
- if (c === "checkbox")
16
- o = t.target.checked;
17
- else if (c === "multiDropdown") {
18
- const h = t.target.value;
19
- Array.isArray(h) ? o = h.map((D) => D.value) : o = [];
20
- } else if (c === "phone") {
21
- const [, h] = C(t.target.value);
22
- o = h;
11
+ return { Context: c, Provider: ({ children: F }) => {
12
+ const [t, l] = P(s), d = C(
13
+ (n, a, f) => {
14
+ l((m) => {
15
+ let i;
16
+ if (f === "checkbox")
17
+ i = a.target.checked;
18
+ else if (f === "multiDropdown") {
19
+ const v = a.target.value;
20
+ Array.isArray(v) ? i = v.map((N) => N.value) : i = [];
21
+ } else if (f === "phone") {
22
+ const [, v] = D(a.target.value);
23
+ i = v;
24
+ } else
25
+ i = a.target.value;
26
+ return i === "undefined" && (i = void 0), { ...m, [n]: i };
27
+ });
28
+ let b;
29
+ if (f === "checkbox")
30
+ b = a.target.checked;
31
+ else if (f === "phone") {
32
+ const [, m] = D(a.target.value);
33
+ b = m;
23
34
  } else
24
- o = t.target.value;
25
- return o === "undefined" && (o = void 0), { ...l, [g]: o };
26
- });
27
- let p;
28
- if (c === "checkbox")
29
- p = t.target.checked;
30
- else if (c === "phone") {
31
- const [, l] = C(t.target.value);
32
- p = l;
33
- } else
34
- p = t.target.value === "undefined" ? void 0 : t.target.value;
35
- u.forEach((l) => {
36
- l(g, p, r);
37
- });
38
- }, v = () => r(s);
39
- P(() => {
40
- a && console.log(`[${n}Form] Updated form data:`, e);
41
- }, [e]);
42
- const f = $(
35
+ b = a.target.value === "undefined" ? void 0 : a.target.value;
36
+ u.forEach((m) => {
37
+ m(n, b, l);
38
+ });
39
+ },
40
+ [u]
41
+ ), p = C(() => l(s), [s]);
42
+ $(() => {
43
+ r && console.log(`[${e}Form] Updated form data:`, t);
44
+ }, [t]);
45
+ const h = k(
43
46
  () => ({
44
47
  onFormInputChange: d,
45
- formData: e,
46
- setFormData: r,
47
- resetForm: v,
48
- ...m ? { submit: () => m(e) } : {}
48
+ formData: t,
49
+ setFormData: l,
50
+ resetForm: p,
51
+ ...o ? { submit: () => o(t) } : {}
49
52
  }),
50
- [e]
53
+ [t, d, p, o]
51
54
  );
52
- return /* @__PURE__ */ N(i.Provider, { value: f, children: x });
55
+ return /* @__PURE__ */ w(c.Provider, { value: h, children: F });
53
56
  } };
54
57
  }
55
- function M(b = "dateOfBirth", n = "age") {
56
- return (s, u, m) => {
57
- if (s === b && u && typeof u == "string") {
58
- const a = u.split("-");
59
- if (a.length !== 3) return;
60
- const i = Number(a[0]), F = Number(a[1]), x = Number(a[2]), e = /* @__PURE__ */ new Date(), r = e.getFullYear(), d = e.getMonth() + 1, v = e.getDate();
61
- if (i > r || i < 1900)
58
+ function S(g = "dateOfBirth", e = "age") {
59
+ return (s, u, o) => {
60
+ if (s === g && u && typeof u == "string") {
61
+ const r = u.split("-");
62
+ if (r.length !== 3) {
63
+ o((n) => ({ ...n, [e]: void 0 }));
62
64
  return;
63
- let f = r - i;
64
- (F > d || F === d && x > v) && (f -= 1), m((g) => ({
65
- ...g,
66
- [n]: String(f)
65
+ }
66
+ const c = Number(r[0]), x = Number(r[1]), F = Number(r[2]), t = /* @__PURE__ */ new Date(), l = t.getFullYear(), d = t.getMonth() + 1, p = t.getDate();
67
+ if (c > l || c < 1900) {
68
+ o((n) => ({ ...n, [e]: void 0 }));
69
+ return;
70
+ }
71
+ let h = l - c;
72
+ (x > d || x === d && F > p) && (h -= 1), o((n) => ({
73
+ ...n,
74
+ [e]: String(h)
67
75
  }));
68
- }
76
+ } else s === g && o((r) => ({ ...r, [e]: void 0 }));
69
77
  };
70
78
  }
71
79
  export {
72
- M as createDobToAgeExtension,
73
- I as createFormContext
80
+ S as createDobToAgeExtension,
81
+ M as createFormContext
74
82
  };
package/Pill/Pill.d.ts CHANGED
@@ -2,6 +2,7 @@ export interface PillProps {
2
2
  backgroundColor?: string;
3
3
  textColor?: string;
4
4
  type?: 'primary' | 'secondary';
5
+ squared?: boolean;
5
6
  }
6
7
  export declare const Pill: React.FC<PillProps & {
7
8
  children: React.ReactNode;
package/Pill/Pill.js CHANGED
@@ -1,33 +1,44 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { n as a } from "../.chunks/emotion-styled.browser.esm.js";
3
- import { c as i } from "../.chunks/emotion-react.browser.esm.js";
4
- import e from "../theme.js";
5
- import { useThemeColors as p } from "../ThemeContext.js";
6
- const l = a("span")(
7
- ({ backgroundColor: r = e.colors.whiteGreen, textColor: o = e.colors.white }) => ({
8
- ...i`
9
- font-family: ${e.fonts.roboto};
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { n as m } from "../.chunks/emotion-styled.browser.esm.js";
3
+ import { c as p } from "../.chunks/emotion-react.browser.esm.js";
4
+ import t from "../theme.js";
5
+ import { useThemeColors as d } from "../ThemeContext.js";
6
+ const n = m("span")(
7
+ ({ backgroundColor: e = t.colors.whiteGreen, textColor: o = t.colors.white, squared: r = !1 }) => ({
8
+ ...p`
9
+ font-family: ${t.fonts.roboto};
10
10
  font-size: 13px;
11
11
  font-weight: 500;
12
12
  color: ${o};
13
- background-color: ${r};
13
+ background-color: ${e};
14
14
  padding: 3px 13px;
15
- border-radius: 21px;
15
+ border-radius: ${r ? "4px" : "21px"};
16
16
  cursor: default;
17
17
  `
18
18
  })
19
- ), x = (r) => {
20
- const o = p(), { backgroundColor: t, textColor: n, type: m = "primary", children: c } = r;
21
- return m == "secondary" ? /* @__PURE__ */ s(
22
- l,
19
+ ), C = (e) => {
20
+ const o = d(), { backgroundColor: r, textColor: l, type: i = "primary", squared: c = !1, children: s } = e;
21
+ return i == "secondary" ? /* @__PURE__ */ a(
22
+ n,
23
23
  {
24
- backgroundColor: t || o.themeIconBackgroundB,
25
- textColor: n || o.themeIconColorB,
26
- children: c
24
+ backgroundColor: r || o.themeIconBackgroundB,
25
+ textColor: l || o.themeIconColorB,
26
+ squared: c,
27
+ className: "jciclPillWrapper",
28
+ children: s
27
29
  }
28
- ) : /* @__PURE__ */ s(l, { backgroundColor: t || o.themeIconBackgroundA, textColor: n, children: c });
30
+ ) : /* @__PURE__ */ a(
31
+ n,
32
+ {
33
+ backgroundColor: r || o.themeIconBackgroundA,
34
+ textColor: l,
35
+ squared: c,
36
+ className: "jciclPillWrapper",
37
+ children: s
38
+ }
39
+ );
29
40
  };
30
41
  export {
31
- x as Pill,
32
- x as default
42
+ C as Pill,
43
+ C as default
33
44
  };
@@ -8,6 +8,7 @@ interface SquareIconWrapperProps {
8
8
  backgroundColor?: string;
9
9
  color?: string;
10
10
  size?: number;
11
+ useThemeColor?: boolean;
11
12
  }
12
13
  declare const SquareIconButton: React.FC<SquareIconButtonProps>;
13
14
  export default SquareIconButton;
@@ -1,10 +1,10 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { n as c } from "../.chunks/emotion-styled.browser.esm.js";
3
- import { c as a } from "../.chunks/emotion-react.browser.esm.js";
4
- import l from "../theme.js";
5
- import { useThemeColors as u } from "../ThemeContext.js";
6
- const m = c("button")(({ backgroundColor: r, color: e, size: o }) => ({
7
- ...a`
2
+ import { n as a } from "../.chunks/emotion-styled.browser.esm.js";
3
+ import { c as u } from "../.chunks/emotion-react.browser.esm.js";
4
+ import n from "../theme.js";
5
+ import { useThemeColors as m } from "../ThemeContext.js";
6
+ const f = a("button")(({ backgroundColor: r, color: e, size: o }) => ({
7
+ ...u`
8
8
  width: ${o}px;
9
9
  height: ${o}px;
10
10
  background-color: ${r};
@@ -32,25 +32,26 @@ const m = c("button")(({ backgroundColor: r, color: e, size: o }) => ({
32
32
  }
33
33
  }
34
34
  `
35
- })), g = ({
36
- color: r = l.colors.white,
37
- backgroundColor: e,
35
+ })), x = ({
36
+ color: r = n.colors.white,
37
+ backgroundColor: e = n.colors.green,
38
38
  size: o = 20,
39
- onClick: n,
40
- icon: s
39
+ onClick: s,
40
+ icon: c,
41
+ useThemeColor: i = !1
41
42
  }) => {
42
- const i = u();
43
+ const l = m();
43
44
  return /* @__PURE__ */ t(
44
- m,
45
+ f,
45
46
  {
46
- backgroundColor: e || i.themeIconBackgroundA,
47
+ backgroundColor: i ? l.themeIconBackgroundA : e,
47
48
  color: r,
48
49
  size: o * 2,
49
- onClick: n,
50
- children: /* @__PURE__ */ t(s, { size: o })
50
+ onClick: s,
51
+ children: /* @__PURE__ */ t(c, { size: o })
51
52
  }
52
53
  );
53
54
  };
54
55
  export {
55
- g as default
56
+ x as default
56
57
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jcicl",
3
3
  "private": false,
4
- "version": "1.0.30",
4
+ "version": "1.0.32",
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",