jcicl 1.0.11 → 1.0.13
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 +207 -161
- package/Pill/Pill.js +1 -0
- package/package.json +1 -1
- package/utils.js +21 -21
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';
|
|
3
|
+
variant?: 1 | 2 | 'unstyled' | 'copy' | 'icon' | 'bibi' | 'bibiOutlined' | 'bibiInverse' | 'filter' | 'custom' | 'pill';
|
|
4
4
|
size?: number;
|
|
5
5
|
color?: string;
|
|
6
6
|
highlightColor?: string;
|
package/Button/Button.js
CHANGED
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as T, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as B from "react";
|
|
3
3
|
import { useState as q } from "react";
|
|
4
|
-
import { g as J, a as K, s, r as Q, c as p, h as X, u as Y, b as
|
|
4
|
+
import { g as J, a as K, s, r as Q, c as p, h as X, u as Y, b as W, P as e, d as Z, e as h } from "../.chunks/DefaultPropsProvider.js";
|
|
5
5
|
import { m as oo } from "../.chunks/memoTheme.js";
|
|
6
6
|
import { c as to } from "../.chunks/createSimplePaletteValueFilter.js";
|
|
7
|
-
import { B as
|
|
7
|
+
import { B as k } from "../.chunks/ButtonBase.js";
|
|
8
8
|
import { i as ro } from "../.chunks/emotion-styled.browser.esm.js";
|
|
9
|
-
import { c as
|
|
9
|
+
import { c as g } from "../.chunks/emotion-react.browser.esm.js";
|
|
10
10
|
import t from "../theme.js";
|
|
11
|
-
import { Tooltip as
|
|
12
|
-
import {
|
|
13
|
-
|
|
11
|
+
import { Tooltip as eo } from "../Tooltip/Tooltip.js";
|
|
12
|
+
import { useThemeColors as ao } from "../ThemeContext.js";
|
|
13
|
+
import { C as no } from "../.chunks/check.js";
|
|
14
|
+
function io(o) {
|
|
14
15
|
return J("MuiButton", o);
|
|
15
16
|
}
|
|
16
|
-
const
|
|
17
|
-
process.env.NODE_ENV !== "production" && (
|
|
18
|
-
const
|
|
19
|
-
process.env.NODE_ENV !== "production" && (
|
|
20
|
-
const
|
|
17
|
+
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({});
|
|
18
|
+
process.env.NODE_ENV !== "production" && (j.displayName = "ButtonGroupContext");
|
|
19
|
+
const V = /* @__PURE__ */ B.createContext(void 0);
|
|
20
|
+
process.env.NODE_ENV !== "production" && (V.displayName = "ButtonGroupButtonContext");
|
|
21
|
+
const so = (o) => {
|
|
21
22
|
const {
|
|
22
|
-
color:
|
|
23
|
-
disableElevation:
|
|
23
|
+
color: r,
|
|
24
|
+
disableElevation: a,
|
|
24
25
|
fullWidth: n,
|
|
25
|
-
size:
|
|
26
|
+
size: c,
|
|
26
27
|
variant: u,
|
|
27
28
|
classes: b
|
|
28
|
-
} = o,
|
|
29
|
-
root: ["root", u, `${u}${p(
|
|
29
|
+
} = o, v = {
|
|
30
|
+
root: ["root", u, `${u}${p(r)}`, `size${p(c)}`, `${u}Size${p(c)}`, `color${p(r)}`, a && "disableElevation", n && "fullWidth"],
|
|
30
31
|
label: ["label"],
|
|
31
|
-
startIcon: ["icon", "startIcon", `iconSize${p(
|
|
32
|
-
endIcon: ["icon", "endIcon", `iconSize${p(
|
|
33
|
-
}, f = Z(
|
|
32
|
+
startIcon: ["icon", "startIcon", `iconSize${p(c)}`],
|
|
33
|
+
endIcon: ["icon", "endIcon", `iconSize${p(c)}`]
|
|
34
|
+
}, f = Z(v, io, b);
|
|
34
35
|
return {
|
|
35
36
|
...b,
|
|
36
37
|
// forward the focused, disabled, etc. classes to the ButtonBase
|
|
37
38
|
...f
|
|
38
39
|
};
|
|
39
|
-
},
|
|
40
|
+
}, F = [{
|
|
40
41
|
props: {
|
|
41
42
|
size: "small"
|
|
42
43
|
},
|
|
@@ -63,20 +64,20 @@ const io = (o) => {
|
|
|
63
64
|
fontSize: 22
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
|
-
}],
|
|
67
|
+
}], lo = s(k, {
|
|
67
68
|
shouldForwardProp: (o) => Q(o) || o === "classes",
|
|
68
69
|
name: "MuiButton",
|
|
69
70
|
slot: "Root",
|
|
70
|
-
overridesResolver: (o,
|
|
71
|
+
overridesResolver: (o, r) => {
|
|
71
72
|
const {
|
|
72
|
-
ownerState:
|
|
73
|
+
ownerState: a
|
|
73
74
|
} = o;
|
|
74
|
-
return [
|
|
75
|
+
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];
|
|
75
76
|
}
|
|
76
77
|
})(oo(({
|
|
77
78
|
theme: o
|
|
78
79
|
}) => {
|
|
79
|
-
const
|
|
80
|
+
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];
|
|
80
81
|
return {
|
|
81
82
|
...o.typography.button,
|
|
82
83
|
minWidth: 64,
|
|
@@ -89,7 +90,7 @@ const io = (o) => {
|
|
|
89
90
|
"&:hover": {
|
|
90
91
|
textDecoration: "none"
|
|
91
92
|
},
|
|
92
|
-
[`&.${
|
|
93
|
+
[`&.${x.disabled}`]: {
|
|
93
94
|
color: (o.vars || o).palette.action.disabled
|
|
94
95
|
},
|
|
95
96
|
variants: [{
|
|
@@ -110,10 +111,10 @@ const io = (o) => {
|
|
|
110
111
|
"&:active": {
|
|
111
112
|
boxShadow: (o.vars || o).shadows[8]
|
|
112
113
|
},
|
|
113
|
-
[`&.${
|
|
114
|
+
[`&.${x.focusVisible}`]: {
|
|
114
115
|
boxShadow: (o.vars || o).shadows[6]
|
|
115
116
|
},
|
|
116
|
-
[`&.${
|
|
117
|
+
[`&.${x.disabled}`]: {
|
|
117
118
|
color: (o.vars || o).palette.action.disabled,
|
|
118
119
|
boxShadow: (o.vars || o).shadows[0],
|
|
119
120
|
backgroundColor: (o.vars || o).palette.action.disabledBackground
|
|
@@ -129,7 +130,7 @@ const io = (o) => {
|
|
|
129
130
|
borderColor: "var(--variant-outlinedBorder, currentColor)",
|
|
130
131
|
backgroundColor: "var(--variant-outlinedBg)",
|
|
131
132
|
color: "var(--variant-outlinedColor)",
|
|
132
|
-
[`&.${
|
|
133
|
+
[`&.${x.disabled}`]: {
|
|
133
134
|
border: `1px solid ${(o.vars || o).palette.action.disabledBackground}`
|
|
134
135
|
}
|
|
135
136
|
}
|
|
@@ -149,15 +150,15 @@ const io = (o) => {
|
|
|
149
150
|
style: {
|
|
150
151
|
"--variant-textColor": (o.vars || o).palette[n].main,
|
|
151
152
|
"--variant-outlinedColor": (o.vars || o).palette[n].main,
|
|
152
|
-
"--variant-outlinedBorder": o.vars ? `rgba(${o.vars.palette[n].mainChannel} / 0.5)` :
|
|
153
|
+
"--variant-outlinedBorder": o.vars ? `rgba(${o.vars.palette[n].mainChannel} / 0.5)` : h(o.palette[n].main, 0.5),
|
|
153
154
|
"--variant-containedColor": (o.vars || o).palette[n].contrastText,
|
|
154
155
|
"--variant-containedBg": (o.vars || o).palette[n].main,
|
|
155
156
|
"@media (hover: hover)": {
|
|
156
157
|
"&:hover": {
|
|
157
158
|
"--variant-containedBg": (o.vars || o).palette[n].dark,
|
|
158
|
-
"--variant-textBg": o.vars ? `rgba(${o.vars.palette[n].mainChannel} / ${o.vars.palette.action.hoverOpacity})` :
|
|
159
|
+
"--variant-textBg": o.vars ? `rgba(${o.vars.palette[n].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : h(o.palette[n].main, o.palette.action.hoverOpacity),
|
|
159
160
|
"--variant-outlinedBorder": (o.vars || o).palette[n].main,
|
|
160
|
-
"--variant-outlinedBg": o.vars ? `rgba(${o.vars.palette[n].mainChannel} / ${o.vars.palette.action.hoverOpacity})` :
|
|
161
|
+
"--variant-outlinedBg": o.vars ? `rgba(${o.vars.palette[n].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : h(o.palette[n].main, o.palette.action.hoverOpacity)
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
164
|
}
|
|
@@ -168,12 +169,12 @@ const io = (o) => {
|
|
|
168
169
|
style: {
|
|
169
170
|
color: "inherit",
|
|
170
171
|
borderColor: "currentColor",
|
|
171
|
-
"--variant-containedBg": o.vars ? o.vars.palette.Button.inheritContainedBg :
|
|
172
|
+
"--variant-containedBg": o.vars ? o.vars.palette.Button.inheritContainedBg : r,
|
|
172
173
|
"@media (hover: hover)": {
|
|
173
174
|
"&:hover": {
|
|
174
|
-
"--variant-containedBg": o.vars ? o.vars.palette.Button.inheritContainedHoverBg :
|
|
175
|
-
"--variant-textBg": o.vars ? `rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})` :
|
|
176
|
-
"--variant-outlinedBg": o.vars ? `rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})` :
|
|
175
|
+
"--variant-containedBg": o.vars ? o.vars.palette.Button.inheritContainedHoverBg : a,
|
|
176
|
+
"--variant-textBg": o.vars ? `rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})` : h(o.palette.text.primary, o.palette.action.hoverOpacity),
|
|
177
|
+
"--variant-outlinedBg": o.vars ? `rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})` : h(o.palette.text.primary, o.palette.action.hoverOpacity)
|
|
177
178
|
}
|
|
178
179
|
}
|
|
179
180
|
}
|
|
@@ -240,13 +241,13 @@ const io = (o) => {
|
|
|
240
241
|
"&:hover": {
|
|
241
242
|
boxShadow: "none"
|
|
242
243
|
},
|
|
243
|
-
[`&.${
|
|
244
|
+
[`&.${x.focusVisible}`]: {
|
|
244
245
|
boxShadow: "none"
|
|
245
246
|
},
|
|
246
247
|
"&:active": {
|
|
247
248
|
boxShadow: "none"
|
|
248
249
|
},
|
|
249
|
-
[`&.${
|
|
250
|
+
[`&.${x.disabled}`]: {
|
|
250
251
|
boxShadow: "none"
|
|
251
252
|
}
|
|
252
253
|
}
|
|
@@ -259,14 +260,14 @@ const io = (o) => {
|
|
|
259
260
|
}
|
|
260
261
|
}]
|
|
261
262
|
};
|
|
262
|
-
})),
|
|
263
|
+
})), co = s("span", {
|
|
263
264
|
name: "MuiButton",
|
|
264
265
|
slot: "StartIcon",
|
|
265
|
-
overridesResolver: (o,
|
|
266
|
+
overridesResolver: (o, r) => {
|
|
266
267
|
const {
|
|
267
|
-
ownerState:
|
|
268
|
+
ownerState: a
|
|
268
269
|
} = o;
|
|
269
|
-
return [
|
|
270
|
+
return [r.startIcon, r[`iconSize${p(a.size)}`]];
|
|
270
271
|
}
|
|
271
272
|
})({
|
|
272
273
|
display: "inherit",
|
|
@@ -279,15 +280,15 @@ const io = (o) => {
|
|
|
279
280
|
style: {
|
|
280
281
|
marginLeft: -2
|
|
281
282
|
}
|
|
282
|
-
}, ...
|
|
283
|
-
}),
|
|
283
|
+
}, ...F]
|
|
284
|
+
}), po = s("span", {
|
|
284
285
|
name: "MuiButton",
|
|
285
286
|
slot: "EndIcon",
|
|
286
|
-
overridesResolver: (o,
|
|
287
|
+
overridesResolver: (o, r) => {
|
|
287
288
|
const {
|
|
288
|
-
ownerState:
|
|
289
|
+
ownerState: a
|
|
289
290
|
} = o;
|
|
290
|
-
return [
|
|
291
|
+
return [r.endIcon, r[`iconSize${p(a.size)}`]];
|
|
291
292
|
}
|
|
292
293
|
})({
|
|
293
294
|
display: "inherit",
|
|
@@ -300,62 +301,62 @@ const io = (o) => {
|
|
|
300
301
|
style: {
|
|
301
302
|
marginRight: -2
|
|
302
303
|
}
|
|
303
|
-
}, ...
|
|
304
|
-
}),
|
|
305
|
-
const n =
|
|
304
|
+
}, ...F]
|
|
305
|
+
}), M = /* @__PURE__ */ B.forwardRef(function(r, a) {
|
|
306
|
+
const n = B.useContext(j), c = B.useContext(V), u = X(n, r), b = Y({
|
|
306
307
|
props: u,
|
|
307
308
|
name: "MuiButton"
|
|
308
309
|
}), {
|
|
309
|
-
children:
|
|
310
|
+
children: v,
|
|
310
311
|
color: f = "primary",
|
|
311
312
|
component: l = "button",
|
|
312
|
-
className:
|
|
313
|
-
disabled:
|
|
314
|
-
disableElevation:
|
|
313
|
+
className: I,
|
|
314
|
+
disabled: S = !1,
|
|
315
|
+
disableElevation: d = !1,
|
|
315
316
|
disableFocusRipple: y = !1,
|
|
316
317
|
endIcon: m,
|
|
317
|
-
focusVisibleClassName:
|
|
318
|
-
fullWidth:
|
|
319
|
-
size:
|
|
320
|
-
startIcon:
|
|
321
|
-
type:
|
|
318
|
+
focusVisibleClassName: z,
|
|
319
|
+
fullWidth: R = !1,
|
|
320
|
+
size: O = "medium",
|
|
321
|
+
startIcon: E,
|
|
322
|
+
type: P,
|
|
322
323
|
variant: H = "text",
|
|
323
324
|
...D
|
|
324
325
|
} = b, C = {
|
|
325
326
|
...b,
|
|
326
327
|
color: f,
|
|
327
328
|
component: l,
|
|
328
|
-
disabled:
|
|
329
|
-
disableElevation:
|
|
329
|
+
disabled: S,
|
|
330
|
+
disableElevation: d,
|
|
330
331
|
disableFocusRipple: y,
|
|
331
|
-
fullWidth:
|
|
332
|
-
size:
|
|
333
|
-
type:
|
|
332
|
+
fullWidth: R,
|
|
333
|
+
size: O,
|
|
334
|
+
type: P,
|
|
334
335
|
variant: H
|
|
335
|
-
},
|
|
336
|
-
className:
|
|
336
|
+
}, $ = so(C), U = E && /* @__PURE__ */ i(co, {
|
|
337
|
+
className: $.startIcon,
|
|
337
338
|
ownerState: C,
|
|
338
|
-
children:
|
|
339
|
-
}), _ = m && /* @__PURE__ */ i(
|
|
340
|
-
className:
|
|
339
|
+
children: E
|
|
340
|
+
}), _ = m && /* @__PURE__ */ i(po, {
|
|
341
|
+
className: $.endIcon,
|
|
341
342
|
ownerState: C,
|
|
342
343
|
children: m
|
|
343
|
-
}), A =
|
|
344
|
-
return /* @__PURE__ */
|
|
344
|
+
}), A = c || "";
|
|
345
|
+
return /* @__PURE__ */ T(lo, {
|
|
345
346
|
ownerState: C,
|
|
346
|
-
className:
|
|
347
|
+
className: W(n.className, $.root, I, A),
|
|
347
348
|
component: l,
|
|
348
|
-
disabled:
|
|
349
|
+
disabled: S,
|
|
349
350
|
focusRipple: !y,
|
|
350
|
-
focusVisibleClassName:
|
|
351
|
-
ref:
|
|
352
|
-
type:
|
|
351
|
+
focusVisibleClassName: W($.focusVisible, z),
|
|
352
|
+
ref: a,
|
|
353
|
+
type: P,
|
|
353
354
|
...D,
|
|
354
|
-
classes:
|
|
355
|
-
children: [U,
|
|
355
|
+
classes: $,
|
|
356
|
+
children: [U, v, _]
|
|
356
357
|
});
|
|
357
358
|
});
|
|
358
|
-
process.env.NODE_ENV !== "production" && (
|
|
359
|
+
process.env.NODE_ENV !== "production" && (M.propTypes = {
|
|
359
360
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
360
361
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
361
362
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
@@ -363,42 +364,42 @@ process.env.NODE_ENV !== "production" && (F.propTypes = {
|
|
|
363
364
|
/**
|
|
364
365
|
* The content of the component.
|
|
365
366
|
*/
|
|
366
|
-
children:
|
|
367
|
+
children: e.node,
|
|
367
368
|
/**
|
|
368
369
|
* Override or extend the styles applied to the component.
|
|
369
370
|
*/
|
|
370
|
-
classes:
|
|
371
|
+
classes: e.object,
|
|
371
372
|
/**
|
|
372
373
|
* @ignore
|
|
373
374
|
*/
|
|
374
|
-
className:
|
|
375
|
+
className: e.string,
|
|
375
376
|
/**
|
|
376
377
|
* The color of the component.
|
|
377
378
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
378
379
|
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
379
380
|
* @default 'primary'
|
|
380
381
|
*/
|
|
381
|
-
color:
|
|
382
|
+
color: e.oneOfType([e.oneOf(["inherit", "primary", "secondary", "success", "error", "info", "warning"]), e.string]),
|
|
382
383
|
/**
|
|
383
384
|
* The component used for the root node.
|
|
384
385
|
* Either a string to use a HTML element or a component.
|
|
385
386
|
*/
|
|
386
|
-
component:
|
|
387
|
+
component: e.elementType,
|
|
387
388
|
/**
|
|
388
389
|
* If `true`, the component is disabled.
|
|
389
390
|
* @default false
|
|
390
391
|
*/
|
|
391
|
-
disabled:
|
|
392
|
+
disabled: e.bool,
|
|
392
393
|
/**
|
|
393
394
|
* If `true`, no elevation is used.
|
|
394
395
|
* @default false
|
|
395
396
|
*/
|
|
396
|
-
disableElevation:
|
|
397
|
+
disableElevation: e.bool,
|
|
397
398
|
/**
|
|
398
399
|
* If `true`, the keyboard focus ripple is disabled.
|
|
399
400
|
* @default false
|
|
400
401
|
*/
|
|
401
|
-
disableFocusRipple:
|
|
402
|
+
disableFocusRipple: e.bool,
|
|
402
403
|
/**
|
|
403
404
|
* If `true`, the ripple effect is disabled.
|
|
404
405
|
*
|
|
@@ -406,57 +407,57 @@ process.env.NODE_ENV !== "production" && (F.propTypes = {
|
|
|
406
407
|
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
|
|
407
408
|
* @default false
|
|
408
409
|
*/
|
|
409
|
-
disableRipple:
|
|
410
|
+
disableRipple: e.bool,
|
|
410
411
|
/**
|
|
411
412
|
* Element placed after the children.
|
|
412
413
|
*/
|
|
413
|
-
endIcon:
|
|
414
|
+
endIcon: e.node,
|
|
414
415
|
/**
|
|
415
416
|
* @ignore
|
|
416
417
|
*/
|
|
417
|
-
focusVisibleClassName:
|
|
418
|
+
focusVisibleClassName: e.string,
|
|
418
419
|
/**
|
|
419
420
|
* If `true`, the button will take up the full width of its container.
|
|
420
421
|
* @default false
|
|
421
422
|
*/
|
|
422
|
-
fullWidth:
|
|
423
|
+
fullWidth: e.bool,
|
|
423
424
|
/**
|
|
424
425
|
* The URL to link to when the button is clicked.
|
|
425
426
|
* If defined, an `a` element will be used as the root node.
|
|
426
427
|
*/
|
|
427
|
-
href:
|
|
428
|
+
href: e.string,
|
|
428
429
|
/**
|
|
429
430
|
* The size of the component.
|
|
430
431
|
* `small` is equivalent to the dense button styling.
|
|
431
432
|
* @default 'medium'
|
|
432
433
|
*/
|
|
433
|
-
size:
|
|
434
|
+
size: e.oneOfType([e.oneOf(["small", "medium", "large"]), e.string]),
|
|
434
435
|
/**
|
|
435
436
|
* Element placed before the children.
|
|
436
437
|
*/
|
|
437
|
-
startIcon:
|
|
438
|
+
startIcon: e.node,
|
|
438
439
|
/**
|
|
439
440
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
440
441
|
*/
|
|
441
|
-
sx:
|
|
442
|
+
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
|
|
442
443
|
/**
|
|
443
444
|
* @ignore
|
|
444
445
|
*/
|
|
445
|
-
type:
|
|
446
|
+
type: e.oneOfType([e.oneOf(["button", "reset", "submit"]), e.string]),
|
|
446
447
|
/**
|
|
447
448
|
* The variant to use.
|
|
448
449
|
* @default 'text'
|
|
449
450
|
*/
|
|
450
|
-
variant:
|
|
451
|
+
variant: e.oneOfType([e.oneOf(["contained", "outlined", "text"]), e.string])
|
|
451
452
|
});
|
|
452
|
-
const
|
|
453
|
+
const G = [
|
|
453
454
|
"active",
|
|
454
455
|
"customBackgroundColor",
|
|
455
456
|
"customHoverColor",
|
|
456
457
|
"customTextColor",
|
|
457
458
|
"customShadow1",
|
|
458
459
|
"customShadow2"
|
|
459
|
-
],
|
|
460
|
+
], w = s(M, { shouldForwardProp: (o) => !G.includes(o) })`
|
|
460
461
|
text-transform: none;
|
|
461
462
|
&:disabled {
|
|
462
463
|
opacity: 0.5;
|
|
@@ -469,7 +470,7 @@ const M = [
|
|
|
469
470
|
span {
|
|
470
471
|
align-items: center !important;
|
|
471
472
|
}
|
|
472
|
-
`,
|
|
473
|
+
`, uo = s(w)`
|
|
473
474
|
background-color: ${t.colors.green};
|
|
474
475
|
height: 2.5rem;
|
|
475
476
|
border: 2px solid transparent;
|
|
@@ -488,22 +489,22 @@ const M = [
|
|
|
488
489
|
&:disabled {
|
|
489
490
|
background-color: ${t.colors.darkGreen};
|
|
490
491
|
}
|
|
491
|
-
`,
|
|
492
|
-
shouldForwardProp: (o) => !
|
|
492
|
+
`, bo = s(w, {
|
|
493
|
+
shouldForwardProp: (o) => !G.includes(o)
|
|
493
494
|
})(
|
|
494
495
|
({
|
|
495
496
|
customBackgroundColor: o = t.colors.green,
|
|
496
|
-
customHoverColor:
|
|
497
|
-
customTextColor:
|
|
497
|
+
customHoverColor: r = t.colors.darkGreen,
|
|
498
|
+
customTextColor: a = t.colors.white,
|
|
498
499
|
customShadow1: n = t.boxShadows.gray63,
|
|
499
|
-
customShadow2:
|
|
500
|
+
customShadow2: c = t.boxShadows.black63
|
|
500
501
|
}) => ({
|
|
501
|
-
...
|
|
502
|
+
...g`
|
|
502
503
|
background-color: ${o};
|
|
503
504
|
border-radius: 0;
|
|
504
505
|
height: 2.5rem;
|
|
505
506
|
border: 2px solid transparent;
|
|
506
|
-
color: ${
|
|
507
|
+
color: ${a};
|
|
507
508
|
transition: 313ms all ease-in;
|
|
508
509
|
border-radius: 32px;
|
|
509
510
|
font-weight: 400;
|
|
@@ -512,15 +513,15 @@ const M = [
|
|
|
512
513
|
box-shadow: ${n};
|
|
513
514
|
&:hover,
|
|
514
515
|
:focus-visible {
|
|
515
|
-
background-color: ${
|
|
516
|
-
box-shadow: ${
|
|
516
|
+
background-color: ${r};
|
|
517
|
+
box-shadow: ${c};
|
|
517
518
|
}
|
|
518
519
|
&:disabled {
|
|
519
|
-
background-color: ${
|
|
520
|
+
background-color: ${r};
|
|
520
521
|
}
|
|
521
522
|
`
|
|
522
523
|
})
|
|
523
|
-
),
|
|
524
|
+
), go = s(w)`
|
|
524
525
|
background-color: ${t.colors.gold};
|
|
525
526
|
height: 2.5rem;
|
|
526
527
|
border: 2px solid transparent;
|
|
@@ -539,8 +540,8 @@ const M = [
|
|
|
539
540
|
&:disabled {
|
|
540
541
|
background-color: ${t.colors.goldHover};
|
|
541
542
|
}
|
|
542
|
-
`, N = s(
|
|
543
|
-
...
|
|
543
|
+
`, N = s(w)(({ width: o = "114px" }) => ({
|
|
544
|
+
...g`
|
|
544
545
|
box-sizing: border-box;
|
|
545
546
|
background-color: ${t.colors.bibiBlue};
|
|
546
547
|
border-radius: 0;
|
|
@@ -557,8 +558,8 @@ const M = [
|
|
|
557
558
|
background-color: ${t.colors.bibiBlueHover};
|
|
558
559
|
}
|
|
559
560
|
`
|
|
560
|
-
})),
|
|
561
|
-
...
|
|
561
|
+
})), xo = s(N)(({ active: o }) => ({
|
|
562
|
+
...g`
|
|
562
563
|
background-color: ${o && t.colors.white};
|
|
563
564
|
color: ${o && t.colors.bibiBlue};
|
|
564
565
|
&:hover,
|
|
@@ -568,7 +569,7 @@ const M = [
|
|
|
568
569
|
}
|
|
569
570
|
`
|
|
570
571
|
})), vo = s(N)(() => ({
|
|
571
|
-
...
|
|
572
|
+
...g`
|
|
572
573
|
background-color: ${t.colors.white};
|
|
573
574
|
color: ${t.colors.bibiBlue};
|
|
574
575
|
&:hover,
|
|
@@ -578,13 +579,13 @@ const M = [
|
|
|
578
579
|
color: ${t.colors.white};
|
|
579
580
|
}
|
|
580
581
|
`
|
|
581
|
-
})),
|
|
582
|
+
})), L = s(k)`
|
|
582
583
|
display: block;
|
|
583
|
-
`,
|
|
584
|
+
`, fo = s(L)`
|
|
584
585
|
font-family: inherit;
|
|
585
586
|
font-size: inherit;
|
|
586
587
|
font-weight: inherit;
|
|
587
|
-
`,
|
|
588
|
+
`, yo = s("div")`
|
|
588
589
|
display: flex;
|
|
589
590
|
.isCopied {
|
|
590
591
|
color: ${t.colors.gray};
|
|
@@ -599,11 +600,11 @@ const M = [
|
|
|
599
600
|
width: 14px !important;
|
|
600
601
|
margin: 0;
|
|
601
602
|
}
|
|
602
|
-
`,
|
|
603
|
+
`, mo = s(k, {
|
|
603
604
|
shouldForwardProp: (o) => typeof o == "string" && ro(o)
|
|
604
605
|
})(
|
|
605
|
-
({ size: o, color:
|
|
606
|
-
...
|
|
606
|
+
({ size: o, color: r, highlightColor: a, hoverColor: n }) => ({
|
|
607
|
+
...g`
|
|
607
608
|
display: flex;
|
|
608
609
|
align-items: center;
|
|
609
610
|
justify-content: center;
|
|
@@ -613,22 +614,22 @@ const M = [
|
|
|
613
614
|
&:hover,
|
|
614
615
|
:focus-visible {
|
|
615
616
|
svg {
|
|
616
|
-
filter: drop-shadow(0 0 6px ${
|
|
617
|
-
drop-shadow(0 0 6px ${
|
|
618
|
-
fill: ${n ||
|
|
617
|
+
filter: drop-shadow(0 0 6px ${a}) drop-shadow(0 0 6px ${a})
|
|
618
|
+
drop-shadow(0 0 6px ${a}) drop-shadow(0 0 6px ${a});
|
|
619
|
+
fill: ${n || r};
|
|
619
620
|
}
|
|
620
621
|
}
|
|
621
622
|
|
|
622
623
|
svg {
|
|
623
624
|
transition: 313ms all ease-in-out;
|
|
624
|
-
fill: ${
|
|
625
|
+
fill: ${r};
|
|
625
626
|
width: ${o}px;
|
|
626
627
|
height: ${o}px;
|
|
627
628
|
}
|
|
628
629
|
`
|
|
629
630
|
})
|
|
630
|
-
),
|
|
631
|
-
...
|
|
631
|
+
), $o = s(w)(({ active: o }) => ({
|
|
632
|
+
...g`
|
|
632
633
|
box-sizing: border-box;
|
|
633
634
|
background-color: ${o ? t.colors.black : t.colors.white};
|
|
634
635
|
height: 28px;
|
|
@@ -646,62 +647,107 @@ const M = [
|
|
|
646
647
|
background-color: ${o ? t.colors.charcoal : t.colors.gray2};
|
|
647
648
|
}
|
|
648
649
|
`
|
|
649
|
-
})),
|
|
650
|
+
})), ho = s(k)(
|
|
651
|
+
({ backgroundColor: o, borderColor: r }) => ({
|
|
652
|
+
...g`
|
|
653
|
+
height: 28px;
|
|
654
|
+
border-radius: 20px;
|
|
655
|
+
border-width: 2px;
|
|
656
|
+
border-style: solid;
|
|
657
|
+
border-color: ${r}aa ${r} ${r} ${r}aa;
|
|
658
|
+
background: ${o};
|
|
659
|
+
color: ${r};
|
|
660
|
+
padding: 10px;
|
|
661
|
+
font-size: 0.9rem !important;
|
|
662
|
+
font-weight: 500;
|
|
663
|
+
font-family: inherit;
|
|
664
|
+
transition: all 313ms ease;
|
|
665
|
+
|
|
666
|
+
span {
|
|
667
|
+
display: flex;
|
|
668
|
+
align-items: center !important;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
.lucide {
|
|
672
|
+
height: 15px;
|
|
673
|
+
margin-left: 5px;
|
|
674
|
+
margin-right: -8px;
|
|
675
|
+
stroke: ${r};
|
|
676
|
+
transition: all 313ms ease;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
&:hover .lucide {
|
|
680
|
+
height: 17px;
|
|
681
|
+
stroke-width: 3;
|
|
682
|
+
margin-left: 17px;
|
|
683
|
+
}
|
|
684
|
+
`
|
|
685
|
+
})
|
|
686
|
+
), Po = ({
|
|
650
687
|
variant: o = 1,
|
|
651
|
-
size:
|
|
652
|
-
color:
|
|
653
|
-
highlightColor: n
|
|
654
|
-
hoverColor:
|
|
655
|
-
backgroundColor: u
|
|
656
|
-
textColor: b
|
|
657
|
-
customShadow1:
|
|
658
|
-
customShadow2: f
|
|
688
|
+
size: r = 50,
|
|
689
|
+
color: a,
|
|
690
|
+
highlightColor: n,
|
|
691
|
+
hoverColor: c,
|
|
692
|
+
backgroundColor: u,
|
|
693
|
+
textColor: b,
|
|
694
|
+
customShadow1: v,
|
|
695
|
+
customShadow2: f,
|
|
659
696
|
children: l,
|
|
660
|
-
textToCopy:
|
|
661
|
-
active:
|
|
662
|
-
...
|
|
697
|
+
textToCopy: I,
|
|
698
|
+
active: S,
|
|
699
|
+
...d
|
|
663
700
|
}) => {
|
|
701
|
+
const y = ao();
|
|
664
702
|
if (o === "custom")
|
|
665
703
|
return /* @__PURE__ */ i(
|
|
666
|
-
|
|
704
|
+
bo,
|
|
667
705
|
{
|
|
668
706
|
customBackgroundColor: u,
|
|
669
|
-
customHoverColor:
|
|
707
|
+
customHoverColor: c,
|
|
670
708
|
customTextColor: b,
|
|
671
|
-
customShadow1:
|
|
709
|
+
customShadow1: v,
|
|
672
710
|
customShadow2: f,
|
|
673
711
|
className: "jcCustomButton",
|
|
674
|
-
...
|
|
712
|
+
...d,
|
|
675
713
|
children: l
|
|
676
714
|
}
|
|
677
715
|
);
|
|
678
716
|
if (o === "bibi")
|
|
679
|
-
return /* @__PURE__ */ i(N, { ...
|
|
717
|
+
return /* @__PURE__ */ i(N, { ...d, children: l });
|
|
680
718
|
if (o === "bibiOutlined")
|
|
681
|
-
return /* @__PURE__ */ i(
|
|
719
|
+
return /* @__PURE__ */ i(xo, { ...d, children: l });
|
|
682
720
|
if (o === "bibiInverse")
|
|
683
|
-
return /* @__PURE__ */ i(vo, { ...
|
|
721
|
+
return /* @__PURE__ */ i(vo, { ...d, children: l });
|
|
684
722
|
if (o === "unstyled")
|
|
685
|
-
return /* @__PURE__ */ i(
|
|
723
|
+
return /* @__PURE__ */ i(L, { ...d, children: l });
|
|
686
724
|
if (o === "copy") {
|
|
687
|
-
const [
|
|
688
|
-
return /* @__PURE__ */
|
|
725
|
+
const [m, z] = q(!1);
|
|
726
|
+
return /* @__PURE__ */ T(yo, { onClick: async () => {
|
|
689
727
|
try {
|
|
690
|
-
await navigator.clipboard.writeText(
|
|
691
|
-
} catch (
|
|
692
|
-
console.error("Failed to copy text: ",
|
|
728
|
+
await navigator.clipboard.writeText(I || String(l)), z(!0), setTimeout(() => z(!1), 1100);
|
|
729
|
+
} catch (O) {
|
|
730
|
+
console.error("Failed to copy text: ", O);
|
|
693
731
|
}
|
|
694
732
|
}, children: [
|
|
695
|
-
/* @__PURE__ */ i(
|
|
696
|
-
|
|
697
|
-
/* @__PURE__ */ i(
|
|
733
|
+
/* @__PURE__ */ i(eo, { title: "Copy to clipboard", children: /* @__PURE__ */ i(fo, { ...d, children: l }) }),
|
|
734
|
+
m && /* @__PURE__ */ T("span", { className: "isCopied", children: [
|
|
735
|
+
/* @__PURE__ */ i(no, { size: 12 }),
|
|
698
736
|
" Copied"
|
|
699
737
|
] })
|
|
700
738
|
] });
|
|
701
739
|
}
|
|
702
|
-
return o === 2 ? /* @__PURE__ */ i(
|
|
740
|
+
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(
|
|
741
|
+
ho,
|
|
742
|
+
{
|
|
743
|
+
backgroundColor: u || y.themeIconBackgroundB,
|
|
744
|
+
borderColor: b || y.themeIconBackgroundA,
|
|
745
|
+
...d,
|
|
746
|
+
children: /* @__PURE__ */ i("span", { children: l })
|
|
747
|
+
}
|
|
748
|
+
) : /* @__PURE__ */ i(uo, { ...d, children: /* @__PURE__ */ i("span", { children: l }) });
|
|
703
749
|
};
|
|
704
750
|
export {
|
|
705
|
-
|
|
706
|
-
|
|
751
|
+
Po as Button,
|
|
752
|
+
Po as default
|
|
707
753
|
};
|
package/Pill/Pill.js
CHANGED
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.13",
|
|
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",
|
package/utils.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const
|
|
1
|
+
const $ = (r, t = "mmddyyyy") => t === "mmddyyyy" ? new Date(r).toLocaleDateString("en-US", {
|
|
2
2
|
month: "numeric",
|
|
3
3
|
day: "numeric",
|
|
4
4
|
year: "numeric"
|
|
5
|
-
}) :
|
|
6
|
-
const { line1: t, line2:
|
|
7
|
-
let
|
|
8
|
-
return
|
|
9
|
-
},
|
|
10
|
-
if (
|
|
11
|
-
switch (
|
|
5
|
+
}) : r, g = (r) => {
|
|
6
|
+
const { line1: t, line2: i, city: o, state: n, zip: c } = r;
|
|
7
|
+
let e = t || "";
|
|
8
|
+
return i && (e.length > 0 && (e += ", "), e += i), o && (e.length > 0 && (e += ", "), e += o), n && (e.length > 0 && (e += ", "), e += n), c && (e += ` ${c}`), e;
|
|
9
|
+
}, y = (r) => {
|
|
10
|
+
if (r > 3 && r < 21) return "th";
|
|
11
|
+
switch (r % 10) {
|
|
12
12
|
case 1:
|
|
13
13
|
return "st";
|
|
14
14
|
case 2:
|
|
@@ -18,9 +18,9 @@ const h = (e, t = "mmddyyyy") => t === "mmddyyyy" ? new Date(e).toLocaleDateStri
|
|
|
18
18
|
default:
|
|
19
19
|
return "th";
|
|
20
20
|
}
|
|
21
|
-
}, p = (
|
|
21
|
+
}, p = (r) => {
|
|
22
22
|
try {
|
|
23
|
-
const t = /* @__PURE__ */ new Date(
|
|
23
|
+
const t = /* @__PURE__ */ new Date(r.replace(" ", "T") + "Z"), o = new Intl.DateTimeFormat("en-US", {
|
|
24
24
|
timeZone: "America/Chicago",
|
|
25
25
|
month: "short",
|
|
26
26
|
day: "numeric",
|
|
@@ -30,23 +30,23 @@ const h = (e, t = "mmddyyyy") => t === "mmddyyyy" ? new Date(e).toLocaleDateStri
|
|
|
30
30
|
hour12: !0
|
|
31
31
|
}).formatToParts(t), n = (l) => {
|
|
32
32
|
var a;
|
|
33
|
-
return ((a =
|
|
34
|
-
}, c = n("month") + ".",
|
|
35
|
-
return `${c} ${
|
|
33
|
+
return ((a = o.find((h) => h.type === l)) == null ? void 0 : a.value) ?? "";
|
|
34
|
+
}, c = n("month") + ".", e = Number(n("day")), s = n("year"), m = n("hour"), u = n("minute"), d = n("dayPeriod").toLowerCase(), f = y(e);
|
|
35
|
+
return `${c} ${e}${f}, ${s}, ${m}:${u}${d}`;
|
|
36
36
|
} catch {
|
|
37
|
-
return
|
|
37
|
+
return r;
|
|
38
38
|
}
|
|
39
|
-
}, D = (
|
|
40
|
-
if (
|
|
41
|
-
let t =
|
|
39
|
+
}, D = (r) => {
|
|
40
|
+
if (r == null) return ["", void 0];
|
|
41
|
+
let t = r.replace(/\D/g, "") || "";
|
|
42
42
|
t.at(0) == "1" && (t = t.slice(1));
|
|
43
|
-
const
|
|
44
|
-
let
|
|
45
|
-
return t.length >= 4 && (
|
|
43
|
+
const i = t.slice(0, 3), o = t.slice(3, 6), n = t.slice(6, 10), c = t.slice(10);
|
|
44
|
+
let e = t;
|
|
45
|
+
return t.length >= 4 && (e = `(${i}) ${t.slice(3)}`), t.length >= 7 && (e = `(${i}) ${o}-${t.slice(6)}`), t.length > 10 && (e = `(${i}) ${o}-${n} ext. ${c}`), [e, t];
|
|
46
46
|
};
|
|
47
47
|
export {
|
|
48
48
|
g as formatAddress,
|
|
49
|
-
|
|
49
|
+
$ as formatDate,
|
|
50
50
|
D as formatPhoneNumber,
|
|
51
51
|
p as formatTimestamp
|
|
52
52
|
};
|