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.
- package/Button/Button.d.ts +1 -1
- package/Button/Button.js +127 -124
- package/CircularIconButton/CircularIconButton.d.ts +1 -0
- package/CircularIconButton/CircularIconButton.js +20 -19
- package/FormContext/createFormContext.js +67 -59
- package/Pill/Pill.d.ts +1 -0
- package/Pill/Pill.js +32 -21
- package/SquareIconButton/SquareIconButton.d.ts +1 -0
- package/SquareIconButton/SquareIconButton.js +18 -17
- package/package.json +1 -1
package/Button/Button.d.ts
CHANGED
|
@@ -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
|
|
1
|
+
import { jsxs as N, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import * as B from "react";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { g as
|
|
5
|
-
import { m as
|
|
6
|
-
import { c as
|
|
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
|
|
9
|
-
import { i as
|
|
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
|
|
12
|
+
import { Tooltip as no } from "../Tooltip/Tooltip.js";
|
|
13
13
|
import { useThemeColors as ao } from "../ThemeContext.js";
|
|
14
|
-
import { C as
|
|
15
|
-
function
|
|
16
|
-
return
|
|
14
|
+
import { C as io } from "../.chunks/check.js";
|
|
15
|
+
function so(o) {
|
|
16
|
+
return K("MuiButton", o);
|
|
17
17
|
}
|
|
18
|
-
const x =
|
|
19
|
-
process.env.NODE_ENV !== "production" && (
|
|
20
|
-
const
|
|
21
|
-
process.env.NODE_ENV !== "production" && (
|
|
22
|
-
const
|
|
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:
|
|
26
|
-
fullWidth:
|
|
27
|
-
size:
|
|
25
|
+
disableElevation: n,
|
|
26
|
+
fullWidth: a,
|
|
27
|
+
size: d,
|
|
28
28
|
variant: u,
|
|
29
29
|
classes: b
|
|
30
|
-
} = o,
|
|
31
|
-
root: ["root", u, `${u}${p(r)}`, `size${p(
|
|
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(
|
|
34
|
-
endIcon: ["icon", "endIcon", `iconSize${p(
|
|
35
|
-
},
|
|
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
|
-
...
|
|
39
|
+
...v
|
|
40
40
|
};
|
|
41
|
-
},
|
|
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
|
-
}],
|
|
69
|
-
shouldForwardProp: (o) =>
|
|
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:
|
|
74
|
+
ownerState: n
|
|
75
75
|
} = o;
|
|
76
|
-
return [r.root, r[
|
|
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
|
-
})(
|
|
78
|
+
})(oo(({
|
|
79
79
|
theme: o
|
|
80
80
|
}) => {
|
|
81
|
-
const r = o.palette.mode === "light" ? o.palette.grey[300] : o.palette.grey[800],
|
|
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(
|
|
147
|
+
}, ...Object.entries(o.palette).filter(to()).map(([a]) => ({
|
|
148
148
|
props: {
|
|
149
|
-
color:
|
|
149
|
+
color: a
|
|
150
150
|
},
|
|
151
151
|
style: {
|
|
152
|
-
"--variant-textColor": (o.vars || o).palette[
|
|
153
|
-
"--variant-outlinedColor": (o.vars || o).palette[
|
|
154
|
-
"--variant-outlinedBorder": o.vars ? `rgba(${o.vars.palette[
|
|
155
|
-
"--variant-containedColor": (o.vars || o).palette[
|
|
156
|
-
"--variant-containedBg": (o.vars || o).palette[
|
|
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[
|
|
160
|
-
"--variant-textBg": o.vars ? `rgba(${o.vars.palette[
|
|
161
|
-
"--variant-outlinedBorder": (o.vars || o).palette[
|
|
162
|
-
"--variant-outlinedBg": o.vars ? `rgba(${o.vars.palette[
|
|
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 :
|
|
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
|
-
})),
|
|
264
|
+
})), po = s("span", {
|
|
265
265
|
name: "MuiButton",
|
|
266
266
|
slot: "StartIcon",
|
|
267
267
|
overridesResolver: (o, r) => {
|
|
268
268
|
const {
|
|
269
|
-
ownerState:
|
|
269
|
+
ownerState: n
|
|
270
270
|
} = o;
|
|
271
|
-
return [r.startIcon, r[`iconSize${p(
|
|
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
|
-
}, ...
|
|
285
|
-
}),
|
|
284
|
+
}, ...V]
|
|
285
|
+
}), uo = s("span", {
|
|
286
286
|
name: "MuiButton",
|
|
287
287
|
slot: "EndIcon",
|
|
288
288
|
overridesResolver: (o, r) => {
|
|
289
289
|
const {
|
|
290
|
-
ownerState:
|
|
290
|
+
ownerState: n
|
|
291
291
|
} = o;
|
|
292
|
-
return [r.endIcon, r[`iconSize${p(
|
|
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
|
-
}, ...
|
|
306
|
-
}), M = /* @__PURE__ */ B.forwardRef(function(r,
|
|
307
|
-
const
|
|
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:
|
|
312
|
-
color:
|
|
311
|
+
children: f,
|
|
312
|
+
color: v = "primary",
|
|
313
313
|
component: l = "button",
|
|
314
314
|
className: I,
|
|
315
315
|
disabled: S = !1,
|
|
316
|
-
disableElevation:
|
|
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:
|
|
324
|
-
variant:
|
|
325
|
-
...
|
|
323
|
+
type: W,
|
|
324
|
+
variant: D = "text",
|
|
325
|
+
...U
|
|
326
326
|
} = b, C = {
|
|
327
327
|
...b,
|
|
328
|
-
color:
|
|
328
|
+
color: v,
|
|
329
329
|
component: l,
|
|
330
330
|
disabled: S,
|
|
331
|
-
disableElevation:
|
|
331
|
+
disableElevation: c,
|
|
332
332
|
disableFocusRipple: y,
|
|
333
333
|
fullWidth: R,
|
|
334
334
|
size: O,
|
|
335
|
-
type:
|
|
336
|
-
variant:
|
|
337
|
-
}, $ =
|
|
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
|
-
}),
|
|
341
|
+
}), A = m && /* @__PURE__ */ i(uo, {
|
|
342
342
|
className: $.endIcon,
|
|
343
343
|
ownerState: C,
|
|
344
344
|
children: m
|
|
345
|
-
}),
|
|
346
|
-
return /* @__PURE__ */
|
|
345
|
+
}), q = d || "";
|
|
346
|
+
return /* @__PURE__ */ N(co, {
|
|
347
347
|
ownerState: C,
|
|
348
|
-
className:
|
|
348
|
+
className: j(a.className, $.root, I, q),
|
|
349
349
|
component: l,
|
|
350
350
|
disabled: S,
|
|
351
351
|
focusRipple: !y,
|
|
352
|
-
focusVisibleClassName:
|
|
353
|
-
ref:
|
|
354
|
-
type:
|
|
355
|
-
...
|
|
352
|
+
focusVisibleClassName: j($.focusVisible, z),
|
|
353
|
+
ref: n,
|
|
354
|
+
type: W,
|
|
355
|
+
...U,
|
|
356
356
|
classes: $,
|
|
357
|
-
children: [
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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:
|
|
500
|
-
customShadow1:
|
|
501
|
-
customShadow2:
|
|
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: ${
|
|
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: ${
|
|
514
|
+
box-shadow: ${a};
|
|
515
515
|
&:hover,
|
|
516
516
|
:focus-visible {
|
|
517
517
|
background-color: ${r};
|
|
518
|
-
box-shadow: ${
|
|
518
|
+
box-shadow: ${d};
|
|
519
519
|
}
|
|
520
520
|
&:disabled {
|
|
521
521
|
background-color: ${r};
|
|
522
522
|
}
|
|
523
523
|
`
|
|
524
524
|
})
|
|
525
|
-
),
|
|
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
|
-
`,
|
|
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
|
-
})),
|
|
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(
|
|
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
|
-
})),
|
|
586
|
+
})), H = s(k)`
|
|
584
587
|
display: block;
|
|
585
|
-
`,
|
|
588
|
+
`, yo = s(H)`
|
|
586
589
|
font-family: inherit;
|
|
587
590
|
font-size: inherit;
|
|
588
591
|
font-weight: inherit;
|
|
589
|
-
`,
|
|
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
|
-
`,
|
|
605
|
-
shouldForwardProp: (o) => typeof o == "string" &&
|
|
607
|
+
`, $o = s(k, {
|
|
608
|
+
shouldForwardProp: (o) => typeof o == "string" && eo(o)
|
|
606
609
|
})(
|
|
607
|
-
({ size: o, color: r, highlightColor:
|
|
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 ${
|
|
619
|
-
drop-shadow(0 0 6px ${
|
|
620
|
-
fill: ${
|
|
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
|
-
),
|
|
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
|
-
})),
|
|
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
|
-
),
|
|
690
|
+
), Fo = ({
|
|
688
691
|
variant: o = 1,
|
|
689
692
|
size: r = 50,
|
|
690
|
-
color:
|
|
691
|
-
highlightColor:
|
|
692
|
-
hoverColor:
|
|
693
|
+
color: n,
|
|
694
|
+
highlightColor: a,
|
|
695
|
+
hoverColor: d,
|
|
693
696
|
backgroundColor: u,
|
|
694
697
|
textColor: b,
|
|
695
|
-
customShadow1:
|
|
696
|
-
customShadow2:
|
|
698
|
+
customShadow1: f,
|
|
699
|
+
customShadow2: v,
|
|
697
700
|
children: l,
|
|
698
701
|
textToCopy: I,
|
|
699
702
|
active: S,
|
|
700
|
-
...
|
|
703
|
+
...c
|
|
701
704
|
}) => {
|
|
702
705
|
const y = ao();
|
|
703
706
|
if (o === "custom")
|
|
704
707
|
return /* @__PURE__ */ i(
|
|
705
|
-
|
|
708
|
+
go,
|
|
706
709
|
{
|
|
707
710
|
customBackgroundColor: u,
|
|
708
|
-
customHoverColor:
|
|
711
|
+
customHoverColor: d,
|
|
709
712
|
customTextColor: b,
|
|
710
|
-
customShadow1:
|
|
711
|
-
customShadow2:
|
|
713
|
+
customShadow1: f,
|
|
714
|
+
customShadow2: v,
|
|
712
715
|
className: "jcCustomButton",
|
|
713
|
-
...
|
|
716
|
+
...c,
|
|
714
717
|
children: l
|
|
715
718
|
}
|
|
716
719
|
);
|
|
717
720
|
if (o === "bibi")
|
|
718
|
-
return /* @__PURE__ */ i(
|
|
721
|
+
return /* @__PURE__ */ i(T, { ...c, children: l });
|
|
719
722
|
if (o === "bibiOutlined")
|
|
720
|
-
return /* @__PURE__ */ i(
|
|
723
|
+
return /* @__PURE__ */ i(fo, { ...c, children: l });
|
|
721
724
|
if (o === "bibiInverse")
|
|
722
|
-
return /* @__PURE__ */ i(vo, { ...
|
|
725
|
+
return /* @__PURE__ */ i(vo, { ...c, children: l });
|
|
723
726
|
if (o === "unstyled")
|
|
724
|
-
return /* @__PURE__ */ i(
|
|
727
|
+
return /* @__PURE__ */ i(H, { ...c, children: l });
|
|
725
728
|
if (o === "copy") {
|
|
726
|
-
const [m, z] =
|
|
727
|
-
return /* @__PURE__ */
|
|
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(
|
|
735
|
-
m && /* @__PURE__ */
|
|
736
|
-
/* @__PURE__ */ i(
|
|
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(
|
|
742
|
-
|
|
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
|
-
...
|
|
749
|
+
...c,
|
|
747
750
|
children: /* @__PURE__ */ i("span", { children: l })
|
|
748
751
|
}
|
|
749
|
-
) : /* @__PURE__ */ i(
|
|
752
|
+
) : /* @__PURE__ */ i(bo, { ...c, children: /* @__PURE__ */ i("span", { children: l }) });
|
|
750
753
|
};
|
|
751
754
|
export {
|
|
752
|
-
|
|
753
|
-
|
|
755
|
+
Fo as Button,
|
|
756
|
+
Fo as default
|
|
754
757
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { n as
|
|
3
|
-
import { c as
|
|
4
|
-
import
|
|
5
|
-
import { useThemeColors as
|
|
6
|
-
const
|
|
7
|
-
...
|
|
8
|
-
background-color: ${
|
|
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
|
-
})),
|
|
26
|
-
color:
|
|
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:
|
|
30
|
+
icon: c,
|
|
31
|
+
useThemeColor: i = !1
|
|
31
32
|
}) => {
|
|
32
|
-
const
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
|
|
33
|
+
const a = u();
|
|
34
|
+
return /* @__PURE__ */ t(
|
|
35
|
+
f,
|
|
35
36
|
{
|
|
36
|
-
color:
|
|
37
|
-
backgroundColor:
|
|
37
|
+
color: e,
|
|
38
|
+
backgroundColor: i ? a.themeIconBackgroundA : r,
|
|
38
39
|
size: o * 1.2,
|
|
39
40
|
onClick: n,
|
|
40
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ t(c, { size: o * 0.8 })
|
|
41
42
|
}
|
|
42
43
|
);
|
|
43
44
|
};
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
+
b as default
|
|
46
47
|
};
|
|
@@ -1,74 +1,82 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { formatPhoneNumber as
|
|
4
|
-
function
|
|
5
|
-
const { name:
|
|
6
|
-
onFormInputChange: () => console.error(`Failed to update form input. ${
|
|
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. ${
|
|
9
|
-
resetForm: () => console.error(`Failed to reset form. ${
|
|
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:
|
|
12
|
-
const [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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:
|
|
46
|
-
setFormData:
|
|
47
|
-
resetForm:
|
|
48
|
-
...
|
|
48
|
+
formData: t,
|
|
49
|
+
setFormData: l,
|
|
50
|
+
resetForm: p,
|
|
51
|
+
...o ? { submit: () => o(t) } : {}
|
|
49
52
|
}),
|
|
50
|
-
[
|
|
53
|
+
[t, d, p, o]
|
|
51
54
|
);
|
|
52
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ w(c.Provider, { value: h, children: F });
|
|
53
56
|
} };
|
|
54
57
|
}
|
|
55
|
-
function
|
|
56
|
-
return (s, u,
|
|
57
|
-
if (s ===
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
|
|
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
|
-
|
|
64
|
-
(
|
|
65
|
-
|
|
66
|
-
[
|
|
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
|
-
|
|
73
|
-
|
|
80
|
+
S as createDobToAgeExtension,
|
|
81
|
+
M as createFormContext
|
|
74
82
|
};
|
package/Pill/Pill.d.ts
CHANGED
package/Pill/Pill.js
CHANGED
|
@@ -1,33 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { n as
|
|
3
|
-
import { c as
|
|
4
|
-
import
|
|
5
|
-
import { useThemeColors as
|
|
6
|
-
const
|
|
7
|
-
({ backgroundColor:
|
|
8
|
-
...
|
|
9
|
-
font-family: ${
|
|
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: ${
|
|
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
|
-
),
|
|
20
|
-
const o =
|
|
21
|
-
return
|
|
22
|
-
|
|
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:
|
|
25
|
-
textColor:
|
|
26
|
-
|
|
24
|
+
backgroundColor: r || o.themeIconBackgroundB,
|
|
25
|
+
textColor: l || o.themeIconColorB,
|
|
26
|
+
squared: c,
|
|
27
|
+
className: "jciclPillWrapper",
|
|
28
|
+
children: s
|
|
27
29
|
}
|
|
28
|
-
) : /* @__PURE__ */
|
|
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
|
-
|
|
32
|
-
|
|
42
|
+
C as Pill,
|
|
43
|
+
C as default
|
|
33
44
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { n as
|
|
3
|
-
import { c as
|
|
4
|
-
import
|
|
5
|
-
import { useThemeColors as
|
|
6
|
-
const
|
|
7
|
-
...
|
|
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
|
-
})),
|
|
36
|
-
color: r =
|
|
37
|
-
backgroundColor: e,
|
|
35
|
+
})), x = ({
|
|
36
|
+
color: r = n.colors.white,
|
|
37
|
+
backgroundColor: e = n.colors.green,
|
|
38
38
|
size: o = 20,
|
|
39
|
-
onClick:
|
|
40
|
-
icon:
|
|
39
|
+
onClick: s,
|
|
40
|
+
icon: c,
|
|
41
|
+
useThemeColor: i = !1
|
|
41
42
|
}) => {
|
|
42
|
-
const
|
|
43
|
+
const l = m();
|
|
43
44
|
return /* @__PURE__ */ t(
|
|
44
|
-
|
|
45
|
+
f,
|
|
45
46
|
{
|
|
46
|
-
backgroundColor:
|
|
47
|
+
backgroundColor: i ? l.themeIconBackgroundA : e,
|
|
47
48
|
color: r,
|
|
48
49
|
size: o * 2,
|
|
49
|
-
onClick:
|
|
50
|
-
children: /* @__PURE__ */ t(
|
|
50
|
+
onClick: s,
|
|
51
|
+
children: /* @__PURE__ */ t(c, { size: o })
|
|
51
52
|
}
|
|
52
53
|
);
|
|
53
54
|
};
|
|
54
55
|
export {
|
|
55
|
-
|
|
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.
|
|
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",
|