@krrli/cm-designsystem 1.20.2 → 1.20.3
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/dist/components/accessible-button/AccessibleButton.js +1 -1
- package/dist/components/button/Button.js +1 -1
- package/dist/components/icon-button/IconButton.js +1 -1
- package/dist/components/icons/IconBase.js +1 -1
- package/dist/components/navi-button/NaviButton.js +1 -1
- package/dist/components/navi-user-button/NaviUserButton.js +1 -1
- package/dist/components/round-button/RoundButton.js +1 -1
- package/dist/components/timed-button/TimedButton.js +1 -1
- package/dist/components/typography/Heading.js +1 -1
- package/dist/components/typography/Label.js +1 -1
- package/dist/components/typography/Paragraph.js +1 -1
- package/dist/components/typography/Placeholder.js +1 -1
- package/dist/components/typography/ValidationMessage.js +1 -1
- package/dist/index.es.js +14 -14
- package/package.json +1 -1
|
@@ -11,5 +11,5 @@ const accessibleButtonStyles = tv({
|
|
|
11
11
|
* A fully accessible button component.
|
|
12
12
|
*/
|
|
13
13
|
export const AccessibleButton = ({ className, ariaLabel, onClick, type = "button", ...props }) => {
|
|
14
|
-
return (_jsx("button", { type: type, className: cn(
|
|
14
|
+
return (_jsx("button", { type: type, className: cn(accessibleButtonStyles({ isClickable: !!onClick }), className), "aria-label": ariaLabel, onClick: onClick, children: props.children }));
|
|
15
15
|
};
|
|
@@ -56,5 +56,5 @@ const buttonStyles = tv({
|
|
|
56
56
|
* A fully accessible, stylable button component.
|
|
57
57
|
*/
|
|
58
58
|
export const Button = ({ className, ...props }) => {
|
|
59
|
-
return (_jsxs(AccessibleButton, { className: cn(
|
|
59
|
+
return (_jsxs(AccessibleButton, { className: cn(buttonStyles(props), className), ...props, children: [_jsx(Label, { as: "span", size: "md", children: props.children }), props.icon && _jsx(props.icon, {})] }));
|
|
60
60
|
};
|
|
@@ -21,5 +21,5 @@ const iconButtonStyles = tv({
|
|
|
21
21
|
*/
|
|
22
22
|
export const IconButton = ({ className, ...props }) => {
|
|
23
23
|
const { base, icon } = iconButtonStyles();
|
|
24
|
-
return (_jsxs(AccessibleButton, { className: cn(
|
|
24
|
+
return (_jsxs(AccessibleButton, { className: cn(base(props), className), ...props, children: [props.icon && _jsx(props.icon, { className: icon(props) }), _jsx(Label, { as: "span", size: "md", children: props.children })] }));
|
|
25
25
|
};
|
|
@@ -7,5 +7,5 @@ const iconStyles = tv({
|
|
|
7
7
|
base: ["w-4", "h-4"],
|
|
8
8
|
});
|
|
9
9
|
export const IconBase = ({ label = "", children, className, ...props }) => {
|
|
10
|
-
return (_jsx(AccessibleIcon, { label: label, children: _jsx("svg", { className: cn(
|
|
10
|
+
return (_jsx(AccessibleIcon, { label: label, children: _jsx("svg", { className: cn(iconStyles(), className), fill: "currentColor", viewBox: props.viewBox || "0 0 16 16", ...props, children: children }) }));
|
|
11
11
|
};
|
|
@@ -30,5 +30,5 @@ const naviButtonStyles = tv({
|
|
|
30
30
|
* keyboard-friendly button foundation with variant-based styling.
|
|
31
31
|
*/
|
|
32
32
|
export const NaviButton = ({ intent = "secondary", className, ...props }) => {
|
|
33
|
-
return (_jsxs(AccessibleButton, { className: cn(
|
|
33
|
+
return (_jsxs(AccessibleButton, { className: cn(naviButtonStyles({ intent, ...props }), className), ...props, children: [props.icon && _jsx(props.icon, { className: props.iconClassName }), _jsx(Label, { as: "span", size: "md", children: props.children })] }));
|
|
34
34
|
};
|
|
@@ -29,5 +29,5 @@ const naviUserButtonStyles = tv({
|
|
|
29
29
|
* like an accessible, keyboard-friendly button.
|
|
30
30
|
*/
|
|
31
31
|
export const NaviUserButton = ({ intent = "secondary", className, ...props }) => {
|
|
32
|
-
return (_jsx(AccessibleButton, { className: cn(
|
|
32
|
+
return (_jsx(AccessibleButton, { className: cn(naviUserButtonStyles({ intent, ...props }), className), ...props, children: _jsx(Avatar, { alt: props.alt, size: "sm", src: props.src }) }));
|
|
33
33
|
};
|
|
@@ -29,5 +29,5 @@ const roundButtonStyles = tv({
|
|
|
29
29
|
* keyboard interaction, and visual feedback through hover and active states.
|
|
30
30
|
*/
|
|
31
31
|
export const RoundButton = ({ intent = "primary", className, ...props }) => {
|
|
32
|
-
return (_jsx(AccessibleButton, { className: cn(
|
|
32
|
+
return (_jsx(AccessibleButton, { className: cn(roundButtonStyles({ intent }), className), ...props, children: _jsx(props.icon, {}) }));
|
|
33
33
|
};
|
|
@@ -105,5 +105,5 @@ export const TimedButton = ({ className, onClick, ...props }) => {
|
|
|
105
105
|
}, 1000);
|
|
106
106
|
timeoutsRef.current.push(timeout2);
|
|
107
107
|
};
|
|
108
|
-
return (_jsxs(AccessibleButton, { className: cn(
|
|
108
|
+
return (_jsxs(AccessibleButton, { className: cn(base(props), className), onClick: handleClick, ...props, children: [props.icon && _jsx(props.icon, { className: iconClass(), "aria-hidden": "true" }), _jsx(Label, { as: "span", size: "md", className: labelClass(), children: pressed ? props.labelActive : props.label })] }));
|
|
109
109
|
};
|
|
@@ -6,6 +6,6 @@ import { headingStyles } from "./styles";
|
|
|
6
6
|
* A semantic, accessible Heading component built on top of the AccessibleTypography component.
|
|
7
7
|
*/
|
|
8
8
|
export const Heading = ({ as, className, ...props }) => {
|
|
9
|
-
const styles = cn(
|
|
9
|
+
const styles = cn(headingStyles(props), className);
|
|
10
10
|
return _jsx(AccessibleTypography, { as: as, className: styles, ...props });
|
|
11
11
|
};
|
|
@@ -6,6 +6,6 @@ import { labelStyles } from "./styles";
|
|
|
6
6
|
* A semantic, accessible Label component built on top of the AccessibleTypography component.
|
|
7
7
|
*/
|
|
8
8
|
export const Label = ({ as = "label", className, ...props }) => {
|
|
9
|
-
const styles = cn(
|
|
9
|
+
const styles = cn(labelStyles(props), className);
|
|
10
10
|
return _jsx(AccessibleTypography, { as: as, className: styles, ...props });
|
|
11
11
|
};
|
|
@@ -6,6 +6,6 @@ import { paragraphStyles } from "./styles";
|
|
|
6
6
|
* A semantic, accessible Paragraph component built on top of the AccessibleTypography component.
|
|
7
7
|
*/
|
|
8
8
|
export const Paragraph = ({ as = "p", className, ...props }) => {
|
|
9
|
-
const styles = cn(
|
|
9
|
+
const styles = cn(paragraphStyles(props), className);
|
|
10
10
|
return _jsx(AccessibleTypography, { as: as, className: styles, ...props });
|
|
11
11
|
};
|
|
@@ -6,6 +6,6 @@ import { placeholderStyles } from "./styles";
|
|
|
6
6
|
* A semantic, accessible Placeholder component built on top of the AccessibleTypography component.
|
|
7
7
|
*/
|
|
8
8
|
export const Placeholder = ({ as = "span", className, ...props }) => {
|
|
9
|
-
const styles = cn(
|
|
9
|
+
const styles = cn(placeholderStyles(props), className);
|
|
10
10
|
return _jsx(AccessibleTypography, { as: as, className: styles, ...props });
|
|
11
11
|
};
|
|
@@ -6,6 +6,6 @@ import { validationMessageStyles } from "./styles";
|
|
|
6
6
|
* A semantic, accessible ValidationMessage component built on top of the AccessibleTypography component.
|
|
7
7
|
*/
|
|
8
8
|
export const ValidationMessage = ({ as = "span", type = "error", className, ...props }) => {
|
|
9
|
-
const styles = cn(
|
|
9
|
+
const styles = cn(validationMessageStyles({ type, ...props }), className);
|
|
10
10
|
return _jsx(AccessibleTypography, { as: as, className: styles, ...props });
|
|
11
11
|
};
|
package/dist/index.es.js
CHANGED
|
@@ -3700,7 +3700,7 @@ const Yr = G({
|
|
|
3700
3700
|
}) => /* @__PURE__ */ c.jsx(J0, { label: e, children: /* @__PURE__ */ c.jsx(
|
|
3701
3701
|
"svg",
|
|
3702
3702
|
{
|
|
3703
|
-
className: e2(
|
|
3703
|
+
className: e2(Yr(), n),
|
|
3704
3704
|
fill: "currentColor",
|
|
3705
3705
|
viewBox: r.viewBox || "0 0 16 16",
|
|
3706
3706
|
...r,
|
|
@@ -3783,8 +3783,8 @@ const Yr = G({
|
|
|
3783
3783
|
{
|
|
3784
3784
|
type: r,
|
|
3785
3785
|
className: e2(
|
|
3786
|
-
|
|
3787
|
-
|
|
3786
|
+
to({ isClickable: !!n }),
|
|
3787
|
+
e
|
|
3788
3788
|
),
|
|
3789
3789
|
"aria-label": t,
|
|
3790
3790
|
onClick: n,
|
|
@@ -3819,7 +3819,7 @@ const Yr = G({
|
|
|
3819
3819
|
}) => /* @__PURE__ */ c.jsx(
|
|
3820
3820
|
k2,
|
|
3821
3821
|
{
|
|
3822
|
-
className: e2(
|
|
3822
|
+
className: e2(no({ intent: e }), t),
|
|
3823
3823
|
...n,
|
|
3824
3824
|
children: /* @__PURE__ */ c.jsx(n.icon, {})
|
|
3825
3825
|
}
|
|
@@ -4164,7 +4164,7 @@ const Yr = G({
|
|
|
4164
4164
|
className: t,
|
|
4165
4165
|
...n
|
|
4166
4166
|
}) => {
|
|
4167
|
-
const r = e2(
|
|
4167
|
+
const r = e2(tt(n), t);
|
|
4168
4168
|
return /* @__PURE__ */ c.jsx(V2, { as: e, className: r, ...n });
|
|
4169
4169
|
}, yo = G({
|
|
4170
4170
|
base: [
|
|
@@ -4218,7 +4218,7 @@ const Yr = G({
|
|
|
4218
4218
|
}), Ao = ({
|
|
4219
4219
|
className: e,
|
|
4220
4220
|
...t
|
|
4221
|
-
}) => /* @__PURE__ */ c.jsxs(k2, { className: e2(
|
|
4221
|
+
}) => /* @__PURE__ */ c.jsxs(k2, { className: e2(yo(t), e), ...t, children: [
|
|
4222
4222
|
/* @__PURE__ */ c.jsx(t2, { as: "span", size: "md", children: t.children }),
|
|
4223
4223
|
t.icon && /* @__PURE__ */ c.jsx(t.icon, {})
|
|
4224
4224
|
] }), Ma = ({
|
|
@@ -4242,7 +4242,7 @@ const Yr = G({
|
|
|
4242
4242
|
className: t,
|
|
4243
4243
|
...n
|
|
4244
4244
|
}) => {
|
|
4245
|
-
const r = e2(
|
|
4245
|
+
const r = e2(vo(n), t);
|
|
4246
4246
|
return /* @__PURE__ */ c.jsx(V2, { as: e, className: r, ...n });
|
|
4247
4247
|
}, Eo = G({
|
|
4248
4248
|
slots: {
|
|
@@ -4850,7 +4850,7 @@ const $o = G({
|
|
|
4850
4850
|
...t
|
|
4851
4851
|
}) => {
|
|
4852
4852
|
const { base: n, icon: r } = $o();
|
|
4853
|
-
return /* @__PURE__ */ c.jsxs(k2, { className: e2(
|
|
4853
|
+
return /* @__PURE__ */ c.jsxs(k2, { className: e2(n(t), e), ...t, children: [
|
|
4854
4854
|
t.icon && /* @__PURE__ */ c.jsx(t.icon, { className: r(t) }),
|
|
4855
4855
|
/* @__PURE__ */ c.jsx(t2, { as: "span", size: "md", children: t.children })
|
|
4856
4856
|
] });
|
|
@@ -4860,7 +4860,7 @@ const $o = G({
|
|
|
4860
4860
|
className: n,
|
|
4861
4861
|
...r
|
|
4862
4862
|
}) => {
|
|
4863
|
-
const o = e2(
|
|
4863
|
+
const o = e2(bo({ type: t, ...r }), n);
|
|
4864
4864
|
return /* @__PURE__ */ c.jsx(V2, { as: e, className: o, ...r });
|
|
4865
4865
|
}, e1 = G({
|
|
4866
4866
|
slots: {
|
|
@@ -6501,7 +6501,7 @@ const Bs = ({
|
|
|
6501
6501
|
className: t,
|
|
6502
6502
|
...n
|
|
6503
6503
|
}) => {
|
|
6504
|
-
const r = e2(
|
|
6504
|
+
const r = e2(go(n), t);
|
|
6505
6505
|
return /* @__PURE__ */ c.jsx(V2, { as: e, className: r, ...n });
|
|
6506
6506
|
}, Qs = G({
|
|
6507
6507
|
slots: {
|
|
@@ -6597,7 +6597,7 @@ const Us = G({
|
|
|
6597
6597
|
}) => /* @__PURE__ */ c.jsxs(
|
|
6598
6598
|
k2,
|
|
6599
6599
|
{
|
|
6600
|
-
className: e2(
|
|
6600
|
+
className: e2(Us({ intent: e, ...n }), t),
|
|
6601
6601
|
...n,
|
|
6602
6602
|
children: [
|
|
6603
6603
|
n.icon && /* @__PURE__ */ c.jsx(n.icon, { className: n.iconClassName }),
|
|
@@ -6632,7 +6632,7 @@ const Us = G({
|
|
|
6632
6632
|
}) => /* @__PURE__ */ c.jsx(
|
|
6633
6633
|
k2,
|
|
6634
6634
|
{
|
|
6635
|
-
className: e2(
|
|
6635
|
+
className: e2(Zs({ intent: e, ...n }), t),
|
|
6636
6636
|
...n,
|
|
6637
6637
|
children: /* @__PURE__ */ c.jsx(so, { alt: n.alt, size: "sm", src: n.src })
|
|
6638
6638
|
}
|
|
@@ -7397,7 +7397,7 @@ const ba = G({}), Oa = (e) => /* @__PURE__ */ c.jsx(va, { value: e.value, classN
|
|
|
7397
7397
|
return /* @__PURE__ */ c.jsxs(
|
|
7398
7398
|
k2,
|
|
7399
7399
|
{
|
|
7400
|
-
className: e2(
|
|
7400
|
+
className: e2(u(n), e),
|
|
7401
7401
|
onClick: f,
|
|
7402
7402
|
...n,
|
|
7403
7403
|
children: [
|
|
@@ -7496,7 +7496,7 @@ const ba = G({}), Oa = (e) => /* @__PURE__ */ c.jsx(va, { value: e.value, classN
|
|
|
7496
7496
|
className: t,
|
|
7497
7497
|
...n
|
|
7498
7498
|
}) => {
|
|
7499
|
-
const r = e2(
|
|
7499
|
+
const r = e2(nt(n), t);
|
|
7500
7500
|
return /* @__PURE__ */ c.jsx(V2, { as: e, className: r, ...n });
|
|
7501
7501
|
};
|
|
7502
7502
|
export {
|