@chayns-ui/core 0.2.0 → 0.3.0
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/README.md +51 -1
- package/dist/avatar.css +104 -0
- package/dist/components/accordion/Accordion.d.ts +1 -1
- package/dist/components/accordion/Accordion.d.ts.map +1 -1
- package/dist/components/accordion/Accordion.js +2 -2
- package/dist/components/accordion/Accordion.js.map +1 -1
- package/dist/components/accordion/Accordion.types.d.ts +61 -16
- package/dist/components/accordion/Accordion.types.d.ts.map +1 -1
- package/dist/components/accordion-group/AccordionGroup.d.ts +4 -0
- package/dist/components/accordion-group/AccordionGroup.d.ts.map +1 -0
- package/dist/components/{accordion → accordion-group}/AccordionGroup.js +4 -4
- package/dist/components/accordion-group/AccordionGroup.js.map +1 -0
- package/dist/components/avatar/Avatar.d.ts +4 -0
- package/dist/components/avatar/Avatar.d.ts.map +1 -0
- package/dist/components/avatar/Avatar.js +48 -0
- package/dist/components/avatar/Avatar.js.map +1 -0
- package/dist/components/avatar/Avatar.types.d.ts +46 -0
- package/dist/components/avatar/Avatar.types.d.ts.map +1 -0
- package/dist/components/avatar-group/AvatarGroup.d.ts +4 -0
- package/dist/components/avatar-group/AvatarGroup.d.ts.map +1 -0
- package/dist/components/avatar-group/AvatarGroup.js +26 -0
- package/dist/components/avatar-group/AvatarGroup.js.map +1 -0
- package/dist/components/avatar-group/AvatarGroup.types.d.ts +33 -0
- package/dist/components/avatar-group/AvatarGroup.types.d.ts.map +1 -0
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +6 -3
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button/Button.types.d.ts +39 -25
- package/dist/components/button/Button.types.d.ts.map +1 -1
- package/dist/components/button/button-icon/ButtonIcon.d.ts +7 -0
- package/dist/components/button/button-icon/ButtonIcon.d.ts.map +1 -0
- package/dist/components/button/button-icon/ButtonIcon.js +17 -0
- package/dist/components/button/button-icon/ButtonIcon.js.map +1 -0
- package/dist/components/card/Card.d.ts +1 -1
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +2 -2
- package/dist/components/card/Card.js.map +1 -1
- package/dist/components/card/Card.types.d.ts +16 -3
- package/dist/components/card/Card.types.d.ts.map +1 -1
- package/dist/components/{button → icon-button}/IconButton.d.ts +1 -1
- package/dist/components/icon-button/IconButton.d.ts.map +1 -0
- package/dist/components/{button → icon-button}/IconButton.js +7 -4
- package/dist/components/icon-button/IconButton.js.map +1 -0
- package/dist/components/icon-button/IconButton.types.d.ts +43 -0
- package/dist/components/icon-button/IconButton.types.d.ts.map +1 -0
- package/dist/components/list/List.d.ts +1 -1
- package/dist/components/list/List.d.ts.map +1 -1
- package/dist/components/list/List.js +2 -2
- package/dist/components/list/List.js.map +1 -1
- package/dist/components/list/List.types.d.ts +62 -14
- package/dist/components/list/List.types.d.ts.map +1 -1
- package/dist/components/list-item/ListItem.d.ts +4 -0
- package/dist/components/list-item/ListItem.d.ts.map +1 -0
- package/dist/components/list-item/ListItem.js +42 -0
- package/dist/components/list-item/ListItem.js.map +1 -0
- package/dist/components/list-item/list-item-body/ListItemBody.d.ts +10 -0
- package/dist/components/list-item/list-item-body/ListItemBody.d.ts.map +1 -0
- package/dist/components/list-item/list-item-body/ListItemBody.js +30 -0
- package/dist/components/list-item/list-item-body/ListItemBody.js.map +1 -0
- package/dist/components/popup/Popup.d.ts +4 -0
- package/dist/components/popup/Popup.d.ts.map +1 -0
- package/dist/components/popup/Popup.js +107 -0
- package/dist/components/popup/Popup.js.map +1 -0
- package/dist/components/popup/Popup.types.d.ts +18 -0
- package/dist/components/popup/Popup.types.d.ts.map +1 -0
- package/dist/components/popup/PopupList.d.ts +4 -0
- package/dist/components/popup/PopupList.d.ts.map +1 -0
- package/dist/components/popup/PopupList.js +44 -0
- package/dist/components/popup/PopupList.js.map +1 -0
- package/dist/components/split-button/SplitButton.d.ts +4 -0
- package/dist/components/split-button/SplitButton.d.ts.map +1 -0
- package/dist/components/split-button/SplitButton.js +52 -0
- package/dist/components/split-button/SplitButton.js.map +1 -0
- package/dist/components/split-button/SplitButton.types.d.ts +12 -0
- package/dist/components/split-button/SplitButton.types.d.ts.map +1 -0
- package/dist/index.d.ts +21 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -4
- package/dist/list.css +8 -1
- package/dist/popup.css +34 -0
- package/dist/split-button.css +128 -0
- package/dist/styles.css +3 -0
- package/package.json +11 -19
- package/dist/components/accordion/AccordionGroup.d.ts +0 -4
- package/dist/components/accordion/AccordionGroup.d.ts.map +0 -1
- package/dist/components/accordion/AccordionGroup.js.map +0 -1
- package/dist/components/accordion/index.d.ts +0 -4
- package/dist/components/accordion/index.d.ts.map +0 -1
- package/dist/components/accordion/index.js +0 -3
- package/dist/components/button/ButtonIcon.d.ts +0 -7
- package/dist/components/button/ButtonIcon.d.ts.map +0 -1
- package/dist/components/button/ButtonIcon.js +0 -19
- package/dist/components/button/ButtonIcon.js.map +0 -1
- package/dist/components/button/IconButton.d.ts.map +0 -1
- package/dist/components/button/IconButton.js.map +0 -1
- package/dist/components/button/buttonClassName.d.ts +0 -3
- package/dist/components/button/buttonClassName.d.ts.map +0 -1
- package/dist/components/button/buttonClassName.js +0 -9
- package/dist/components/button/buttonClassName.js.map +0 -1
- package/dist/components/button/index.d.ts +0 -4
- package/dist/components/button/index.d.ts.map +0 -1
- package/dist/components/button/index.js +0 -3
- package/dist/components/card/index.d.ts +0 -3
- package/dist/components/card/index.d.ts.map +0 -1
- package/dist/components/card/index.js +0 -2
- package/dist/components/list/ListItem.d.ts +0 -4
- package/dist/components/list/ListItem.d.ts.map +0 -1
- package/dist/components/list/ListItem.js +0 -67
- package/dist/components/list/ListItem.js.map +0 -1
- package/dist/components/list/index.d.ts +0 -4
- package/dist/components/list/index.d.ts.map +0 -1
- package/dist/components/list/index.js +0 -3
|
@@ -1,35 +1,49 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* @description Supported visual emphasis levels for {@link ButtonProps} and
|
|
4
|
+
* `IconButtonProps`. Milestone 1 supports exactly these four values; there is
|
|
5
|
+
* no default variant and no fifth value.
|
|
6
|
+
* @see {@link https://tappqa.tobit.com/Bodywork/DesignSystem/#buttons | DesignSystem — Buttons & Aktionen}
|
|
7
|
+
*/
|
|
3
8
|
export type ButtonVariant = 'primary' | 'outline' | 'ghost' | 'danger';
|
|
4
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* @description A FontAwesome Classic icon name in its Regular form (e.g.
|
|
11
|
+
* `fa-plus`). Button and IconButton resolve the matching Solid weight
|
|
12
|
+
* internally and cross-fade between the two on hover/active; consumers must
|
|
13
|
+
* not pass a pre-resolved weight and must supply a name that has both a
|
|
14
|
+
* Regular and a Solid glyph available.
|
|
15
|
+
*/
|
|
5
16
|
export type ButtonIcon = `fa-${string}`;
|
|
6
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* @description Visible content that gives a `Button` its accessible name.
|
|
19
|
+
* Excludes `boolean`, `null` and `undefined` so a `Button` can never be
|
|
20
|
+
* rendered without real, visible label content.
|
|
21
|
+
*/
|
|
7
22
|
export type ButtonContent = Exclude<ReactNode, boolean | null | undefined>;
|
|
8
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* @description Props for a visible-label native action button. Renders a
|
|
25
|
+
* native `<button>` and forwards all remaining native button props, events,
|
|
26
|
+
* `className` and `ref`.
|
|
27
|
+
*/
|
|
9
28
|
export interface ButtonProps extends Omit<ComponentPropsWithRef<'button'>, 'children'> {
|
|
10
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* @description Visual emphasis that communicates the action's role within
|
|
31
|
+
* its action scope. At most one `primary` action should exist per closed
|
|
32
|
+
* action scope (page, card, dialog, drawer, form, wizard step, or closed
|
|
33
|
+
* accordion content).
|
|
34
|
+
*/
|
|
11
35
|
variant: ButtonVariant;
|
|
12
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* @description Optional leading FontAwesome Classic icon name. Always
|
|
38
|
+
* rendered before `children`; there is no trailing-icon or icon-only mode
|
|
39
|
+
* on `Button` itself — use `IconButton` for an icon-only action.
|
|
40
|
+
*/
|
|
13
41
|
icon?: ButtonIcon;
|
|
14
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* @description Visible, non-empty content used as the button label. Loading
|
|
44
|
+
* state, polymorphism (rendering as something other than a native button)
|
|
45
|
+
* and navigation are explicitly not part of the Milestone 1 API.
|
|
46
|
+
*/
|
|
15
47
|
children: ButtonContent;
|
|
16
48
|
}
|
|
17
|
-
type IconButtonAccessibleName = {
|
|
18
|
-
/** Localized accessible name when no external label element exists. */
|
|
19
|
-
'aria-label': string;
|
|
20
|
-
'aria-labelledby'?: never;
|
|
21
|
-
} | {
|
|
22
|
-
'aria-label'?: never;
|
|
23
|
-
/** ID of the element that provides the localized accessible name. */
|
|
24
|
-
'aria-labelledby': string;
|
|
25
|
-
};
|
|
26
|
-
interface IconButtonBaseProps extends Omit<ComponentPropsWithRef<'button'>, 'aria-label' | 'aria-labelledby' | 'children'> {
|
|
27
|
-
/** Visual emphasis that communicates the action's role. */
|
|
28
|
-
variant: ButtonVariant;
|
|
29
|
-
/** FontAwesome Classic icon name rendered Regular at rest and Solid on interaction. */
|
|
30
|
-
icon: ButtonIcon;
|
|
31
|
-
}
|
|
32
|
-
/** Props for a compact native action button with a required accessible name. */
|
|
33
|
-
export type IconButtonProps = IconButtonBaseProps & IconButtonAccessibleName;
|
|
34
|
-
export {};
|
|
35
49
|
//# sourceMappingURL=Button.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.types.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D
|
|
1
|
+
{"version":3,"file":"Button.types.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEvE;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,MAAM,EAAE,CAAC;AAExC;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAE3E;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;IACpF;;;;;OAKG;IACH,OAAO,EAAE,aAAa,CAAC;IAEvB;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;;OAIG;IACH,QAAQ,EAAE,aAAa,CAAC;CACzB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ButtonIcon as ButtonIconName } from '../Button.types.js';
|
|
2
|
+
interface ButtonIconProps {
|
|
3
|
+
icon: ButtonIconName;
|
|
4
|
+
}
|
|
5
|
+
declare const ButtonIcon: ({ icon }: ButtonIconProps) => import("react").JSX.Element;
|
|
6
|
+
export default ButtonIcon;
|
|
7
|
+
//# sourceMappingURL=ButtonIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/button/button-icon/ButtonIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEvE,UAAU,eAAe;IACvB,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,QAAA,MAAM,UAAU,GAAI,UAAU,eAAe,gCAS5C,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/button/button-icon/ButtonIcon.tsx
|
|
3
|
+
var ButtonIcon = ({ icon }) => /* @__PURE__ */ jsxs("span", {
|
|
4
|
+
"aria-hidden": "true",
|
|
5
|
+
className: "chayns-button-icon",
|
|
6
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
7
|
+
className: "chayns-button-icon__weight",
|
|
8
|
+
children: /* @__PURE__ */ jsx("i", { className: `far ${icon}` })
|
|
9
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
10
|
+
className: "chayns-button-icon__weight chayns-button-icon__weight--active",
|
|
11
|
+
children: /* @__PURE__ */ jsx("i", { className: `fas ${icon}` })
|
|
12
|
+
})]
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { ButtonIcon as default };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=ButtonIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonIcon.js","names":[],"sources":["../../../../src/components/button/button-icon/ButtonIcon.tsx"],"sourcesContent":["import type { ButtonIcon as ButtonIconName } from '../Button.types.js';\n\ninterface ButtonIconProps {\n icon: ButtonIconName;\n}\n\nconst ButtonIcon = ({ icon }: ButtonIconProps) => (\n <span aria-hidden=\"true\" className=\"chayns-button-icon\">\n <span className=\"chayns-button-icon__weight\">\n <i className={`far ${icon}`} />\n </span>\n <span className=\"chayns-button-icon__weight chayns-button-icon__weight--active\">\n <i className={`fas ${icon}`} />\n </span>\n </span>\n);\n\nexport default ButtonIcon;\n"],"mappings":";;AAMA,IAAM,cAAc,EAAE,WACpB,qBAAC,QAAD;CAAM,eAAY;CAAO,WAAU;CAAnC,UAAA,CACE,oBAAC,QAAD;EAAM,WAAU;EACd,UAAA,oBAAC,KAAD,EAAG,WAAW,OAAO,OAAS,CAAA;CAC1B,CAAA,GACN,oBAAC,QAAD;EAAM,WAAU;EACd,UAAA,oBAAC,KAAD,EAAG,WAAW,OAAO,OAAS,CAAA;CAC1B,CAAA,CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CardProps } from './Card.types.js';
|
|
2
|
-
declare
|
|
2
|
+
declare const Card: ({ children, className, elevated, ...cardProps }: CardProps) => import("react").JSX.Element;
|
|
3
3
|
export default Card;
|
|
4
4
|
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,QAAA,MAAM,IAAI,GAAI,iDAAyD,SAAS,gCAU/E,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
//#region src/components/card/Card.tsx
|
|
3
|
-
|
|
3
|
+
var Card = ({ children, className, elevated = false, ...cardProps }) => {
|
|
4
4
|
const resolvedClassName = [
|
|
5
5
|
"chayns-card",
|
|
6
6
|
elevated ? "chayns-card--elevated" : null,
|
|
@@ -11,7 +11,7 @@ function Card({ children, className, elevated = false, ...cardProps }) {
|
|
|
11
11
|
className: resolvedClassName,
|
|
12
12
|
children
|
|
13
13
|
});
|
|
14
|
-
}
|
|
14
|
+
};
|
|
15
15
|
//#endregion
|
|
16
16
|
export { Card as default };
|
|
17
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","names":[],"sources":["../../../src/components/card/Card.tsx"],"sourcesContent":["import type { CardProps } from './Card.types.js';\n\
|
|
1
|
+
{"version":3,"file":"Card.js","names":[],"sources":["../../../src/components/card/Card.tsx"],"sourcesContent":["import type { CardProps } from './Card.types.js';\n\nconst Card = ({ children, className, elevated = false, ...cardProps }: CardProps) => {\n const resolvedClassName = ['chayns-card', elevated ? 'chayns-card--elevated' : null, className]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div {...cardProps} className={resolvedClassName}>\n {children}\n </div>\n );\n};\n\nexport default Card;\n"],"mappings":";;AAEA,IAAM,QAAQ,EAAE,UAAU,WAAW,WAAW,OAAO,GAAG,gBAA2B;CACnF,MAAM,oBAAoB;EAAC;EAAe,WAAW,0BAA0B;EAAM;CAAS,CAAC,CAC5F,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;CAEX,OACE,oBAAC,OAAD;EAAK,GAAI;EAAW,WAAW;EAC5B;CACE,CAAA;AAET"}
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* @description Props for the presentational surface container. `Card` is
|
|
4
|
+
* purely presentational: it exposes no click or keyboard semantics and no
|
|
5
|
+
* intrinsic padding. Forwards all remaining native `div` props, `className`
|
|
6
|
+
* and `ref`.
|
|
7
|
+
*/
|
|
3
8
|
export interface CardProps extends ComponentPropsWithRef<'div'> {
|
|
4
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* @description Content rendered inside the card surface. Any content may be
|
|
11
|
+
* composed inside; internal spacing is owned by that content or a
|
|
12
|
+
* container, not by `Card`.
|
|
13
|
+
*/
|
|
5
14
|
children?: ReactNode;
|
|
6
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* @description Adds the subtle resting card elevation token on top of the
|
|
17
|
+
* Design System `.card` surface treatment.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
7
20
|
elevated?: boolean;
|
|
8
21
|
}
|
|
9
22
|
//# sourceMappingURL=Card.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.types.d.ts","sourceRoot":"","sources":["../../../src/components/card/Card.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D
|
|
1
|
+
{"version":3,"file":"Card.types.d.ts","sourceRoot":"","sources":["../../../src/components/card/Card.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,WAAW,SAAU,SAAQ,qBAAqB,CAAC,KAAK,CAAC;IAC7D;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IconButtonProps } from './
|
|
1
|
+
import type { IconButtonProps } from './IconButton.types.js';
|
|
2
2
|
declare function IconButton({ className, icon, type, variant, ...buttonProps }: IconButtonProps): import("react").JSX.Element;
|
|
3
3
|
export default IconButton;
|
|
4
4
|
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,IAAI,EACJ,IAAe,EACf,OAAO,EACP,GAAG,WAAW,EACf,EAAE,eAAe,+BAUjB;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import ButtonIcon from "
|
|
2
|
-
import { getButtonClassName } from "./buttonClassName.js";
|
|
1
|
+
import ButtonIcon from "../button/button-icon/ButtonIcon.js";
|
|
3
2
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/button/IconButton.tsx
|
|
3
|
+
//#region src/components/icon-button/IconButton.tsx
|
|
5
4
|
function IconButton({ className, icon, type = "button", variant, ...buttonProps }) {
|
|
6
|
-
const resolvedClassName =
|
|
5
|
+
const resolvedClassName = [
|
|
6
|
+
"chayns-icon-button",
|
|
7
|
+
`chayns-icon-button--${variant}`,
|
|
8
|
+
className
|
|
9
|
+
].filter(Boolean).join(" ");
|
|
7
10
|
return /* @__PURE__ */ jsx("button", {
|
|
8
11
|
...buttonProps,
|
|
9
12
|
className: resolvedClassName,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.js","names":[],"sources":["../../../src/components/icon-button/IconButton.tsx"],"sourcesContent":["import type { IconButtonProps } from './IconButton.types.js';\nimport ButtonIcon from '../button/button-icon/ButtonIcon.js';\n\nfunction IconButton({\n className,\n icon,\n type = 'button',\n variant,\n ...buttonProps\n}: IconButtonProps) {\n const resolvedClassName = ['chayns-icon-button', `chayns-icon-button--${variant}`, className]\n .filter(Boolean)\n .join(' ');\n\n return (\n <button {...buttonProps} className={resolvedClassName} type={type}>\n <ButtonIcon icon={icon} />\n </button>\n );\n}\n\nexport default IconButton;\n"],"mappings":";;;AAGA,SAAS,WAAW,EAClB,WACA,MACA,OAAO,UACP,SACA,GAAG,eACe;CAClB,MAAM,oBAAoB;EAAC;EAAsB,uBAAuB;EAAW;CAAS,CAAC,CAC1F,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;CAEX,OACE,oBAAC,UAAD;EAAQ,GAAI;EAAa,WAAW;EAAyB;EAC3D,UAAA,oBAAC,YAAD,EAAkB,KAAO,CAAA;CACnB,CAAA;AAEZ"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import type { ButtonIcon, ButtonVariant } from '../button/Button.types.js';
|
|
3
|
+
/**
|
|
4
|
+
* @description The two mutually-exclusive accessible-name mechanisms an
|
|
5
|
+
* `IconButton` can use, matching the native accessible-name contract:
|
|
6
|
+
* exactly one of `aria-label` or `aria-labelledby` must be supplied.
|
|
7
|
+
*/
|
|
8
|
+
type IconButtonAccessibleName = {
|
|
9
|
+
/**
|
|
10
|
+
* @description Localized accessible name when no external label
|
|
11
|
+
* element exists.
|
|
12
|
+
*/
|
|
13
|
+
'aria-label': string;
|
|
14
|
+
'aria-labelledby'?: never;
|
|
15
|
+
} | {
|
|
16
|
+
'aria-label'?: never;
|
|
17
|
+
/**
|
|
18
|
+
* @description ID of the element that provides the localized
|
|
19
|
+
* accessible name.
|
|
20
|
+
*/
|
|
21
|
+
'aria-labelledby': string;
|
|
22
|
+
};
|
|
23
|
+
interface IconButtonBaseProps extends Omit<ComponentPropsWithRef<'button'>, 'aria-label' | 'aria-labelledby' | 'children'> {
|
|
24
|
+
/**
|
|
25
|
+
* @description Visual emphasis that communicates the action's role within
|
|
26
|
+
* its action scope, using the same four values as `Button`.
|
|
27
|
+
*/
|
|
28
|
+
variant: ButtonVariant;
|
|
29
|
+
/**
|
|
30
|
+
* @description Required FontAwesome Classic icon name rendered Regular at
|
|
31
|
+
* rest and Solid on hover/active. `IconButton` has no visible label, so
|
|
32
|
+
* this is its only visible content.
|
|
33
|
+
*/
|
|
34
|
+
icon: ButtonIcon;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @description Props for a compact, icon-only native action button. Does not
|
|
38
|
+
* accept `children` — it is icon-only by contract — and requires exactly one
|
|
39
|
+
* of `aria-label` or `aria-labelledby` to guarantee an accessible name.
|
|
40
|
+
*/
|
|
41
|
+
export type IconButtonProps = IconButtonBaseProps & IconButtonAccessibleName;
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=IconButton.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.types.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button/IconButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE3E;;;;GAIG;AACH,KAAK,wBAAwB,GACzB;IACE;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,KAAK,CAAC;CAC3B,GACD;IACE,YAAY,CAAC,EAAE,KAAK,CAAC;IAErB;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEN,UAAU,mBAAoB,SAAQ,IAAI,CACxC,qBAAqB,CAAC,QAAQ,CAAC,EAC/B,YAAY,GAAG,iBAAiB,GAAG,UAAU,CAC9C;IACC;;;OAGG;IACH,OAAO,EAAE,aAAa,CAAC;IAEvB;;;;OAIG;IACH,IAAI,EAAE,UAAU,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,wBAAwB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ListProps } from './List.types.js';
|
|
2
|
-
declare
|
|
2
|
+
declare const List: ({ children, className, ...listProps }: ListProps) => import("react").JSX.Element;
|
|
3
3
|
export default List;
|
|
4
4
|
//# sourceMappingURL=List.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../src/components/list/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../src/components/list/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,QAAA,MAAM,IAAI,GAAI,uCAAuC,SAAS,gCAQ7D,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
//#region src/components/list/List.tsx
|
|
3
|
-
|
|
3
|
+
var List = ({ children, className, ...listProps }) => {
|
|
4
4
|
const resolvedClassName = ["chayns-list", className].filter(Boolean).join(" ");
|
|
5
5
|
return /* @__PURE__ */ jsx("ul", {
|
|
6
6
|
...listProps,
|
|
7
7
|
className: resolvedClassName,
|
|
8
8
|
children
|
|
9
9
|
});
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
11
|
//#endregion
|
|
12
12
|
export { List as default };
|
|
13
13
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","names":[],"sources":["../../../src/components/list/List.tsx"],"sourcesContent":["import type { ListProps } from './List.types.js';\n\
|
|
1
|
+
{"version":3,"file":"List.js","names":[],"sources":["../../../src/components/list/List.tsx"],"sourcesContent":["import type { ListProps } from './List.types.js';\n\nconst List = ({ children, className, ...listProps }: ListProps) => {\n const resolvedClassName = ['chayns-list', className].filter(Boolean).join(' ');\n\n return (\n <ul {...listProps} className={resolvedClassName}>\n {children}\n </ul>\n );\n};\n\nexport default List;\n"],"mappings":";;AAEA,IAAM,QAAQ,EAAE,UAAU,WAAW,GAAG,gBAA2B;CACjE,MAAM,oBAAoB,CAAC,eAAe,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;CAE7E,OACE,oBAAC,MAAD;EAAI,GAAI;EAAW,WAAW;EAC3B;CACC,CAAA;AAER"}
|
|
@@ -1,32 +1,80 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, MouseEventHandler, ReactNode } from 'react';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* @description Props for the vertical list container. Renders a native
|
|
4
|
+
* `<ul>` and forwards all remaining native list props, `className` and
|
|
5
|
+
* `ref`.
|
|
6
|
+
*/
|
|
3
7
|
export interface ListProps extends ComponentPropsWithRef<'ul'> {
|
|
4
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* @description List items, typically `ListItem` elements.
|
|
10
|
+
*/
|
|
5
11
|
children?: ReactNode;
|
|
6
12
|
}
|
|
7
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @description Props for a single list row, rendered as a navigation link
|
|
15
|
+
* when `href` is set or as an action button when `onClick` is set.
|
|
16
|
+
*/
|
|
8
17
|
export interface ListItemProps {
|
|
9
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* @description Primary single-line row label.
|
|
20
|
+
*/
|
|
10
21
|
title: ReactNode;
|
|
11
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* @description Optional secondary single-line preview text shown below
|
|
24
|
+
* `title`.
|
|
25
|
+
*/
|
|
12
26
|
subtitle?: ReactNode;
|
|
13
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* @description Optional leading slot, for example an `Avatar` or icon.
|
|
29
|
+
*/
|
|
14
30
|
leading?: ReactNode;
|
|
15
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @description Optional trailing slot for row-level actions or metadata,
|
|
33
|
+
* freely composable as any `ReactNode`. Consumers render their own content
|
|
34
|
+
* here, including any future standard-content sub-components chayns UI
|
|
35
|
+
* provides for recurring trailing content.
|
|
36
|
+
*/
|
|
16
37
|
trailing?: ReactNode;
|
|
17
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* @description Shows an accent unread indicator.
|
|
40
|
+
* @default false
|
|
41
|
+
* @remarks Pending replacement per LIST-006 (CONFIRMED): this boolean
|
|
42
|
+
* contract is planned to be superseded by a generic, non-chat-specific
|
|
43
|
+
* status/accent indicator composed via `trailing`. The exact replacement
|
|
44
|
+
* component/prop name is not yet decided — do not assume a new prop name
|
|
45
|
+
* is already available.
|
|
46
|
+
*/
|
|
18
47
|
unread?: boolean;
|
|
19
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* @description Localized accessible name for the unread indicator. Required
|
|
50
|
+
* for the indicator to be perceivable by assistive technology; see the
|
|
51
|
+
* `unread` remarks regarding its planned replacement.
|
|
52
|
+
*/
|
|
20
53
|
unreadLabel?: string;
|
|
21
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* @description Renders the row as a navigation link (native `<a>`) with
|
|
56
|
+
* this destination. Mutually exclusive in practice with `onClick` — a row
|
|
57
|
+
* represents either navigation or an action, not both.
|
|
58
|
+
*/
|
|
22
59
|
href?: string;
|
|
23
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* @description Renders the row as an action button (native `<button>`)
|
|
62
|
+
* with this click handler.
|
|
63
|
+
*/
|
|
24
64
|
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
25
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* @description Disables the action button variant. Not applicable when the
|
|
67
|
+
* row renders as a navigation link.
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
26
70
|
disabled?: boolean;
|
|
27
|
-
/**
|
|
71
|
+
/**
|
|
72
|
+
* @description Additional class names appended to the list item element.
|
|
73
|
+
*/
|
|
28
74
|
className?: string;
|
|
29
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* @description Optional id on the list item element.
|
|
77
|
+
*/
|
|
30
78
|
id?: string;
|
|
31
79
|
}
|
|
32
80
|
//# sourceMappingURL=List.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.types.d.ts","sourceRoot":"","sources":["../../../src/components/list/List.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjF
|
|
1
|
+
{"version":3,"file":"List.types.d.ts","sourceRoot":"","sources":["../../../src/components/list/List.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjF;;;;GAIG;AACH,MAAM,WAAW,SAAU,SAAQ,qBAAqB,CAAC,IAAI,CAAC;IAC5D;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAE/C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ListItemProps } from '../list/List.types.js';
|
|
2
|
+
declare const ListItem: ({ className, disabled, href, id, leading, onClick, subtitle, title, trailing, unread, unreadLabel, }: ListItemProps) => import("react").JSX.Element;
|
|
3
|
+
export default ListItem;
|
|
4
|
+
//# sourceMappingURL=ListItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/components/list-item/ListItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D,QAAA,MAAM,QAAQ,GAAI,sGAYf,aAAa,gCA0Cf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import ListItemBody from "./list-item-body/ListItemBody.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/list-item/ListItem.tsx
|
|
4
|
+
var ListItem = ({ className, disabled = false, href, id, leading, onClick, subtitle, title, trailing, unread = false, unreadLabel }) => {
|
|
5
|
+
const actionClassName = ["chayns-list-item__action", Boolean(href) || Boolean(onClick) ? "chayns-list-item__action--interactive" : null].filter(Boolean).join(" ");
|
|
6
|
+
const body = /* @__PURE__ */ jsx(ListItemBody, {
|
|
7
|
+
leading,
|
|
8
|
+
subtitle,
|
|
9
|
+
title,
|
|
10
|
+
unread,
|
|
11
|
+
unreadLabel
|
|
12
|
+
});
|
|
13
|
+
let action;
|
|
14
|
+
if (href) action = /* @__PURE__ */ jsx("a", {
|
|
15
|
+
className: actionClassName,
|
|
16
|
+
href,
|
|
17
|
+
children: body
|
|
18
|
+
});
|
|
19
|
+
else if (onClick) action = /* @__PURE__ */ jsx("button", {
|
|
20
|
+
className: actionClassName,
|
|
21
|
+
disabled,
|
|
22
|
+
onClick,
|
|
23
|
+
type: "button",
|
|
24
|
+
children: body
|
|
25
|
+
});
|
|
26
|
+
else action = /* @__PURE__ */ jsx("div", {
|
|
27
|
+
className: actionClassName,
|
|
28
|
+
children: body
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
31
|
+
className: ["chayns-list-item", className].filter(Boolean).join(" "),
|
|
32
|
+
id,
|
|
33
|
+
children: [action, trailing ? /* @__PURE__ */ jsx("span", {
|
|
34
|
+
className: "chayns-list-item__trailing",
|
|
35
|
+
children: trailing
|
|
36
|
+
}) : null]
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { ListItem as default };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=ListItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItem.js","names":[],"sources":["../../../src/components/list-item/ListItem.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { ListItemProps } from '../list/List.types.js';\nimport ListItemBody from './list-item-body/ListItemBody.js';\n\nconst ListItem = ({\n className,\n disabled = false,\n href,\n id,\n leading,\n onClick,\n subtitle,\n title,\n trailing,\n unread = false,\n unreadLabel,\n}: ListItemProps) => {\n const interactive = Boolean(href) || Boolean(onClick);\n const actionClassName = [\n 'chayns-list-item__action',\n interactive ? 'chayns-list-item__action--interactive' : null,\n ]\n .filter(Boolean)\n .join(' ');\n\n const body = (\n <ListItemBody\n leading={leading}\n subtitle={subtitle}\n title={title}\n unread={unread}\n unreadLabel={unreadLabel}\n />\n );\n\n let action: ReactNode;\n if (href) {\n action = (\n <a className={actionClassName} href={href}>\n {body}\n </a>\n );\n } else if (onClick) {\n action = (\n <button className={actionClassName} disabled={disabled} onClick={onClick} type=\"button\">\n {body}\n </button>\n );\n } else {\n action = <div className={actionClassName}>{body}</div>;\n }\n\n return (\n <li className={['chayns-list-item', className].filter(Boolean).join(' ')} id={id}>\n {action}\n {trailing ? <span className=\"chayns-list-item__trailing\">{trailing}</span> : null}\n </li>\n );\n};\n\nexport default ListItem;\n"],"mappings":";;;AAKA,IAAM,YAAY,EAChB,WACA,WAAW,OACX,MACA,IACA,SACA,SACA,UACA,OACA,UACA,SAAS,OACT,kBACmB;CAEnB,MAAM,kBAAkB,CACtB,4BAFkB,QAAQ,IAAI,KAAK,QAAQ,OAAO,IAGpC,0CAA0C,IAC1D,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;CAEX,MAAM,OACJ,oBAAC,cAAD;EACW;EACC;EACH;EACC;EACK;CACd,CAAA;CAGH,IAAI;CACJ,IAAI,MACF,SACE,oBAAC,KAAD;EAAG,WAAW;EAAuB;EAClC,UAAA;CACA,CAAA;MAEA,IAAI,SACT,SACE,oBAAC,UAAD;EAAQ,WAAW;EAA2B;EAAmB;EAAS,MAAK;EAC5E,UAAA;CACK,CAAA;MAGV,SAAS,oBAAC,OAAD;EAAK,WAAW;EAAkB,UAAA;CAAU,CAAA;CAGvD,OACE,qBAAC,MAAD;EAAI,WAAW,CAAC,oBAAoB,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAAO;EAA9E,UAAA,CACG,QACA,WAAW,oBAAC,QAAD;GAAM,WAAU;GAA8B,UAAA;EAAe,CAAA,IAAI,IAC3E;;AAER"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
declare const ListItemBody: ({ leading, subtitle, title, unread, unreadLabel, }: {
|
|
3
|
+
leading?: ReactNode;
|
|
4
|
+
subtitle?: ReactNode;
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
unread?: boolean;
|
|
7
|
+
unreadLabel?: string | undefined;
|
|
8
|
+
}) => import("react").JSX.Element;
|
|
9
|
+
export default ListItemBody;
|
|
10
|
+
//# sourceMappingURL=ListItemBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemBody.d.ts","sourceRoot":"","sources":["../../../../src/components/list-item/list-item-body/ListItemBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,QAAA,MAAM,YAAY,GAAI,oDAMnB;IACD,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,gCAaA,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/list-item/list-item-body/ListItemBody.tsx
|
|
3
|
+
var ListItemBody = ({ leading, subtitle, title, unread, unreadLabel }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4
|
+
unread ? /* @__PURE__ */ jsx("span", {
|
|
5
|
+
className: "chayns-list-item__unread",
|
|
6
|
+
"aria-hidden": unreadLabel ? void 0 : true,
|
|
7
|
+
children: unreadLabel ? /* @__PURE__ */ jsx("span", {
|
|
8
|
+
className: "chayns-visually-hidden",
|
|
9
|
+
children: unreadLabel
|
|
10
|
+
}) : null
|
|
11
|
+
}) : null,
|
|
12
|
+
leading ? /* @__PURE__ */ jsx("span", {
|
|
13
|
+
className: "chayns-list-item__leading",
|
|
14
|
+
children: leading
|
|
15
|
+
}) : null,
|
|
16
|
+
/* @__PURE__ */ jsxs("span", {
|
|
17
|
+
className: "chayns-list-item__body",
|
|
18
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
19
|
+
className: "chayns-list-item__title",
|
|
20
|
+
children: title
|
|
21
|
+
}), subtitle ? /* @__PURE__ */ jsx("span", {
|
|
22
|
+
className: "chayns-list-item__subtitle",
|
|
23
|
+
children: subtitle
|
|
24
|
+
}) : null]
|
|
25
|
+
})
|
|
26
|
+
] });
|
|
27
|
+
//#endregion
|
|
28
|
+
export { ListItemBody as default };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=ListItemBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemBody.js","names":[],"sources":["../../../../src/components/list-item/list-item-body/ListItemBody.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nconst ListItemBody = ({\n leading,\n subtitle,\n title,\n unread,\n unreadLabel,\n}: {\n leading?: ReactNode;\n subtitle?: ReactNode;\n title: ReactNode;\n unread?: boolean;\n unreadLabel?: string | undefined;\n}) => (\n <>\n {unread ? (\n <span className=\"chayns-list-item__unread\" aria-hidden={unreadLabel ? undefined : true}>\n {unreadLabel ? <span className=\"chayns-visually-hidden\">{unreadLabel}</span> : null}\n </span>\n ) : null}\n {leading ? <span className=\"chayns-list-item__leading\">{leading}</span> : null}\n <span className=\"chayns-list-item__body\">\n <span className=\"chayns-list-item__title\">{title}</span>\n {subtitle ? <span className=\"chayns-list-item__subtitle\">{subtitle}</span> : null}\n </span>\n </>\n);\n\nexport default ListItemBody;\n"],"mappings":";;AAEA,IAAM,gBAAgB,EACpB,SACA,UACA,OACA,QACA,kBAQA,qBAAA,UAAA,EAAA,UAAA;CACG,SACC,oBAAC,QAAD;EAAM,WAAU;EAA2B,eAAa,cAAc,KAAA,IAAY;EAC/E,UAAA,cAAc,oBAAC,QAAD;GAAM,WAAU;GAA0B,UAAA;EAAkB,CAAA,IAAI;CAC3E,CAAA,IACJ;CACH,UAAU,oBAAC,QAAD;EAAM,WAAU;EAA6B,UAAA;CAAc,CAAA,IAAI;CAC1E,qBAAC,QAAD;EAAM,WAAU;EAAhB,UAAA,CACE,oBAAC,QAAD;GAAM,WAAU;GAA2B,UAAA;EAAY,CAAA,GACtD,WAAW,oBAAC,QAAD;GAAM,WAAU;GAA8B,UAAA;EAAe,CAAA,IAAI,IACzE;;AACN,EAAA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../../../src/components/popup/Popup.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAWnD,QAAA,MAAM,KAAK,GAAI,kCAAkC,UAAU,gCAqI1D,CAAC;AAEF,eAAe,KAAK,CAAC"}
|