@canonical/react-ds-core 0.10.0-experimental.3 → 0.10.0-experimental.5
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/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/index.js +2 -0
- package/dist/esm/lib/index.js.map +1 -0
- package/dist/esm/lib/types/index.js +2 -0
- package/dist/esm/lib/types/index.js.map +1 -0
- package/dist/esm/lib/types/polymorphic.js +2 -0
- package/dist/esm/lib/types/polymorphic.js.map +1 -0
- package/dist/esm/storybook/decorators.js +16 -0
- package/dist/esm/storybook/decorators.js.map +1 -0
- package/dist/esm/ui/Badge/styles.css +2 -2
- package/dist/esm/ui/Button/styles.css +7 -7
- package/dist/esm/ui/Card/Card.js +16 -0
- package/dist/esm/ui/Card/Card.js.map +1 -0
- package/dist/esm/ui/Card/common/Image/Image.js +14 -0
- package/dist/esm/ui/Card/common/Image/Image.js.map +1 -0
- package/dist/esm/ui/Card/common/Image/index.js +2 -0
- package/dist/esm/ui/Card/common/Image/index.js.map +1 -0
- package/dist/esm/ui/Card/common/Image/styles.css +7 -0
- package/dist/esm/ui/Card/common/Image/types.js +3 -0
- package/dist/esm/ui/Card/common/Image/types.js.map +1 -0
- package/dist/esm/ui/Card/common/Section/Section.js +13 -0
- package/dist/esm/ui/Card/common/Section/Section.js.map +1 -0
- package/dist/esm/ui/Card/common/Section/index.js +2 -0
- package/dist/esm/ui/Card/common/Section/index.js.map +1 -0
- package/dist/esm/ui/Card/common/Section/styles.css +6 -0
- package/dist/esm/ui/Card/common/Section/types.js +3 -0
- package/dist/esm/ui/Card/common/Section/types.js.map +1 -0
- package/dist/esm/ui/Card/common/ThumbnailSection/ThumbnailSection.js +14 -0
- package/dist/esm/ui/Card/common/ThumbnailSection/ThumbnailSection.js.map +1 -0
- package/dist/esm/ui/Card/common/ThumbnailSection/index.js +2 -0
- package/dist/esm/ui/Card/common/ThumbnailSection/index.js.map +1 -0
- package/dist/esm/ui/Card/common/ThumbnailSection/styles.css +11 -0
- package/dist/esm/ui/Card/common/ThumbnailSection/types.js +3 -0
- package/dist/esm/ui/Card/common/ThumbnailSection/types.js.map +1 -0
- package/dist/esm/ui/Card/common/index.js +4 -0
- package/dist/esm/ui/Card/common/index.js.map +1 -0
- package/dist/esm/ui/Card/index.js +3 -0
- package/dist/esm/ui/Card/index.js.map +1 -0
- package/dist/esm/ui/Card/styles.css +23 -0
- package/dist/esm/ui/Card/types.js +3 -0
- package/dist/esm/ui/Card/types.js.map +1 -0
- package/dist/esm/ui/Chip/styles.css +5 -5
- package/dist/esm/ui/Icon/Icon.js +15 -0
- package/dist/esm/ui/Icon/Icon.js.map +1 -0
- package/dist/esm/ui/Icon/index.js +4 -0
- package/dist/esm/ui/Icon/index.js.map +1 -0
- package/dist/esm/ui/Icon/styles.css +12 -0
- package/dist/esm/ui/Icon/types.js +3 -0
- package/dist/esm/ui/Icon/types.js.map +1 -0
- package/dist/esm/ui/Link/Link.js +15 -0
- package/dist/esm/ui/Link/Link.js.map +1 -0
- package/dist/esm/ui/Link/index.js +4 -0
- package/dist/esm/ui/Link/index.js.map +1 -0
- package/dist/esm/ui/Link/styles.css +25 -0
- package/dist/esm/ui/Link/types.js +3 -0
- package/dist/esm/ui/Link/types.js.map +1 -0
- package/dist/esm/ui/Rule/styles.css +3 -3
- package/dist/esm/ui/SkipLink/SkipLink.js +20 -0
- package/dist/esm/ui/SkipLink/SkipLink.js.map +1 -0
- package/dist/esm/ui/SkipLink/index.js +4 -0
- package/dist/esm/ui/SkipLink/index.js.map +1 -0
- package/dist/esm/ui/SkipLink/styles.css +21 -0
- package/dist/esm/ui/SkipLink/types.js +3 -0
- package/dist/esm/ui/SkipLink/types.js.map +1 -0
- package/dist/esm/ui/Tooltip/styles.css +3 -3
- package/dist/esm/ui/index.js +4 -0
- package/dist/esm/ui/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/index.d.ts +2 -0
- package/dist/types/lib/index.d.ts.map +1 -0
- package/dist/types/lib/types/index.d.ts +2 -0
- package/dist/types/lib/types/index.d.ts.map +1 -0
- package/dist/types/lib/types/polymorphic.d.ts +24 -0
- package/dist/types/lib/types/polymorphic.d.ts.map +1 -0
- package/dist/types/storybook/decorators.d.ts +15 -0
- package/dist/types/storybook/decorators.d.ts.map +1 -0
- package/dist/types/ui/Card/Card.d.ts +24 -0
- package/dist/types/ui/Card/Card.d.ts.map +1 -0
- package/dist/types/ui/Card/common/Image/Image.d.ts +14 -0
- package/dist/types/ui/Card/common/Image/Image.d.ts.map +1 -0
- package/dist/types/ui/Card/common/Image/index.d.ts +3 -0
- package/dist/types/ui/Card/common/Image/index.d.ts.map +1 -0
- package/dist/types/ui/Card/common/Image/types.d.ts +5 -0
- package/dist/types/ui/Card/common/Image/types.d.ts.map +1 -0
- package/dist/types/ui/Card/common/Section/Section.d.ts +13 -0
- package/dist/types/ui/Card/common/Section/Section.d.ts.map +1 -0
- package/dist/types/ui/Card/common/Section/index.d.ts +3 -0
- package/dist/types/ui/Card/common/Section/index.d.ts.map +1 -0
- package/dist/types/ui/Card/common/Section/types.d.ts +6 -0
- package/dist/types/ui/Card/common/Section/types.d.ts.map +1 -0
- package/dist/types/ui/Card/common/ThumbnailSection/ThumbnailSection.d.ts +13 -0
- package/dist/types/ui/Card/common/ThumbnailSection/ThumbnailSection.d.ts.map +1 -0
- package/dist/types/ui/Card/common/ThumbnailSection/index.d.ts +3 -0
- package/dist/types/ui/Card/common/ThumbnailSection/index.d.ts.map +1 -0
- package/dist/types/ui/Card/common/ThumbnailSection/types.d.ts +12 -0
- package/dist/types/ui/Card/common/ThumbnailSection/types.d.ts.map +1 -0
- package/dist/types/ui/Card/common/index.d.ts +4 -0
- package/dist/types/ui/Card/common/index.d.ts.map +1 -0
- package/dist/types/ui/Card/index.d.ts +3 -0
- package/dist/types/ui/Card/index.d.ts.map +1 -0
- package/dist/types/ui/Card/types.d.ts +10 -0
- package/dist/types/ui/Card/types.d.ts.map +1 -0
- package/dist/types/ui/Icon/Icon.d.ts +13 -0
- package/dist/types/ui/Icon/Icon.d.ts.map +1 -0
- package/dist/types/ui/Icon/index.d.ts +3 -0
- package/dist/types/ui/Icon/index.d.ts.map +1 -0
- package/dist/types/ui/Icon/types.d.ts +13 -0
- package/dist/types/ui/Icon/types.d.ts.map +1 -0
- package/dist/types/ui/Link/Link.d.ts +10 -0
- package/dist/types/ui/Link/Link.d.ts.map +1 -0
- package/dist/types/ui/Link/index.d.ts +3 -0
- package/dist/types/ui/Link/index.d.ts.map +1 -0
- package/dist/types/ui/Link/types.d.ts +13 -0
- package/dist/types/ui/Link/types.d.ts.map +1 -0
- package/dist/types/ui/Rule/types.d.ts +0 -1
- package/dist/types/ui/Rule/types.d.ts.map +1 -1
- package/dist/types/ui/SkipLink/SkipLink.d.ts +16 -0
- package/dist/types/ui/SkipLink/SkipLink.d.ts.map +1 -0
- package/dist/types/ui/SkipLink/index.d.ts +3 -0
- package/dist/types/ui/SkipLink/index.d.ts.map +1 -0
- package/dist/types/ui/SkipLink/types.d.ts +16 -0
- package/dist/types/ui/SkipLink/types.d.ts.map +1 -0
- package/dist/types/ui/index.d.ts +4 -0
- package/dist/types/ui/index.d.ts.map +1 -1
- package/package.json +11 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ComponentProps, ElementType } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Utility type for creating polymorphic components in React.
|
|
4
|
+
* This type combines the props of the specified element type with the component's own props,
|
|
5
|
+
* allowing the component to be rendered as different HTML elements or custom components.
|
|
6
|
+
* @template TOwnProps - The props specific to the underlying component.
|
|
7
|
+
* @template TElement - The element type to render as.
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import type { PolymorphicComponentProps } from '@canonical/ds-types';
|
|
11
|
+
*
|
|
12
|
+
* interface LinkOwnProps {
|
|
13
|
+
* children?: ReactNode;
|
|
14
|
+
* appearance?: "soft";
|
|
15
|
+
* }
|
|
16
|
+
* // A link that is, by default, an "a" element, but can be changed via the `as` prop
|
|
17
|
+
* export type LinkProps<TElement extends ElementType = "a"> =
|
|
18
|
+
* PolymorphicComponentProps<LinkOwnProps, TElement>;
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export type PolymorphicComponentProps<TOwnProps extends Object, TElement extends ElementType> = TOwnProps & {
|
|
22
|
+
as?: TElement;
|
|
23
|
+
} & Omit<ComponentProps<TElement>, keyof TOwnProps>;
|
|
24
|
+
//# sourceMappingURL=polymorphic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polymorphic.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/polymorphic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEzD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,yBAAyB,CACnC,SAAS,SAAS,MAAM,EACxB,QAAQ,SAAS,WAAW,IAC1B,SAAS,GAAG;IAAE,EAAE,CAAC,EAAE,QAAQ,CAAA;CAAE,GAAG,IAAI,CACpC,cAAc,CAAC,QAAQ,CAAC,EACxB,MAAM,SAAS,CAChB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ElementType, ReactNode } from "react";
|
|
2
|
+
export declare const rtl: () => (Story: ElementType) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const grid: () => (Story: ElementType) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
/**
|
|
5
|
+
* Places the story before a `<main>` element. This is useful for stories that need to be placed before the rest of the page contents in reading order (such as a skip link).
|
|
6
|
+
* @param id - The id of the main element
|
|
7
|
+
* @param children - Content to be rendered inside the main element
|
|
8
|
+
* @TODO this is the first decorator that seems like it may deserve a complex props object, and thus a separate Type.
|
|
9
|
+
* Should the type be declared separately? Should this be a separate file? Should the decorator be simplified somehow?
|
|
10
|
+
*/
|
|
11
|
+
export declare const beforeMain: ({ id, children }: {
|
|
12
|
+
id?: string;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}) => (Story: ElementType) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=decorators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../src/storybook/decorators.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpD,eAAO,MAAM,GAAG,SAAU,OAAO,WAAW,4CAI3C,CAAC;AAEF,eAAO,MAAM,IAAI,SAAU,OAAO,WAAW,4CAU5C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GACpB,kBAA2B;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,MAChE,OAAO,WAAW,4CAOlB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { CardProps } from "./types.js";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
/**
|
|
5
|
+
* Card component
|
|
6
|
+
* @implements syntax:core:component:card:1.0.0
|
|
7
|
+
*/
|
|
8
|
+
declare const Card: {
|
|
9
|
+
({ className, children, emphasis, ...props }: CardProps): React.ReactElement;
|
|
10
|
+
ThumbnailSection: {
|
|
11
|
+
({ className, imageProps, ...props }: import("./common/index.js").ThumbnailSectionProps): React.ReactElement;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
Image: {
|
|
15
|
+
({ className, alt, ...props }: import("./common/index.js").ImageProps): React.ReactElement;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
Section: {
|
|
19
|
+
({ children, className, ...props }: import("./common/index.js").SectionProps): React.ReactElement;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default Card;
|
|
24
|
+
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../src/ui/Card/Card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,cAAc,CAAC;AAItB;;;GAGG;AACH,QAAA,MAAM,IAAI;kDAKP,SAAS,GAAG,KAAK,CAAC,YAAY;;;;;;;;;;;;;CAShC,CAAC;AAMF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { ImageProps } from "./types.js";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
/**
|
|
5
|
+
* Image component for Card
|
|
6
|
+
* Full-width image with content bleed (no padding)
|
|
7
|
+
* @returns {React.ReactElement} - Rendered Image
|
|
8
|
+
*/
|
|
9
|
+
declare const Image: {
|
|
10
|
+
({ className, alt, ...props }: ImageProps): React.ReactElement;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
export default Image;
|
|
14
|
+
//# sourceMappingURL=Image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Image/Image.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,cAAc,CAAC;AAItB;;;;GAIG;AACH,QAAA,MAAM,KAAK;mCAIR,UAAU,GAAG,KAAK,CAAC,YAAY;;CAQjC,CAAC;AAIF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Image/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC9C,mBAAmB,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Image/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,MAAM,WAAW,UAAW,SAAQ,iBAAiB,CAAC,gBAAgB,CAAC;IAErE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { SectionProps } from "./types.js";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
/**
|
|
5
|
+
* Section component for Card
|
|
6
|
+
* @returns {React.ReactElement} - Rendered Section
|
|
7
|
+
*/
|
|
8
|
+
declare const Section: {
|
|
9
|
+
({ children, className, ...props }: SectionProps): React.ReactElement;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export default Section;
|
|
13
|
+
//# sourceMappingURL=Section.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Section/Section.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,cAAc,CAAC;AAItB;;;GAGG;AACH,QAAA,MAAM,OAAO;wCAIV,YAAY,GAAG,KAAK,CAAC,YAAY;;CASnC,CAAC;AAIF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Section/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,mBAAmB,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Section/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,WAAW,CAAC;IAE/D,QAAQ,EAAE,SAAS,CAAC;IAEpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { ThumbnailSectionProps } from "./types.js";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
/**
|
|
5
|
+
* ThumbnailSection component for Card thumbnails
|
|
6
|
+
* Extends Section behavior with thumbnail image
|
|
7
|
+
*/
|
|
8
|
+
declare const ThumbnailSection: {
|
|
9
|
+
({ className, imageProps, ...props }: ThumbnailSectionProps): React.ReactElement;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export default ThumbnailSection;
|
|
13
|
+
//# sourceMappingURL=ThumbnailSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThumbnailSection.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/ThumbnailSection/ThumbnailSection.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,cAAc,CAAC;AAItB;;;GAGG;AACH,QAAA,MAAM,gBAAgB;0CAInB,qBAAqB,GAAG,KAAK,CAAC,YAAY;;CAU5C,CAAC;AAIF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/ThumbnailSection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACpE,mBAAmB,YAAY,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ImgHTMLAttributes } from "react";
|
|
2
|
+
import type { SectionProps } from "../Section/index.js";
|
|
3
|
+
export interface ThumbnailSectionProps extends Omit<SectionProps, "children"> {
|
|
4
|
+
/** Additional class name(s) to apply to the component */
|
|
5
|
+
className?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Props for the thumbnail image element
|
|
8
|
+
* TODO this should always include `alt` for accessibility, and this is likely to be repeated across the DS - should this type + `alt` requirement be extracted to ds-types packages?
|
|
9
|
+
*/
|
|
10
|
+
imageProps: ImgHTMLAttributes<HTMLImageElement>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/ThumbnailSection/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC;IAC3E,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,UAAU,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;CACjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ui/Card/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/Card/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,mBAAmB,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ModifierFamily } from "@canonical/ds-types";
|
|
2
|
+
import type { HTMLAttributes } from "react";
|
|
3
|
+
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* TODO we need to verify with DS ontology group whether it is expected that a component consume ALL of a modifier family
|
|
6
|
+
* Card in vanilla does not currently support the "muted" or "accented" emphasis modifiers.
|
|
7
|
+
*/
|
|
8
|
+
emphasis?: ModifierFamily<"emphasis">;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ui/Card/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC/D;;;OAGG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;CACvC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { IconProps } from "./types.js";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
/**
|
|
5
|
+
* Icon component that renders SVG icons from @canonical/ds-assets
|
|
6
|
+
* @param iconName - Name of the icon to render
|
|
7
|
+
* @param rootPath - Root path to the icons (default: /icons)
|
|
8
|
+
* @returns {React.ReactElement} - Rendered Icon SVG
|
|
9
|
+
* @implements syntax:core:component:icon:1.0.0
|
|
10
|
+
*/
|
|
11
|
+
declare const Icon: ({ xmlns, viewBox, icon, className, rootPath, role, ...props }: IconProps) => ReactElement;
|
|
12
|
+
export default Icon;
|
|
13
|
+
//# sourceMappingURL=Icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../src/ui/Icon/Icon.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,cAAc,CAAC;AAItB;;;;;;GAMG;AACH,QAAA,MAAM,IAAI,GAAI,+DAQX,SAAS,KAAG,YAYd,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/Icon/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IconName } from "@canonical/ds-assets";
|
|
2
|
+
import type { SVGAttributes } from "react";
|
|
3
|
+
/**
|
|
4
|
+
We have used the `HTMLDivElement` as a default props base.
|
|
5
|
+
If your component is based on a different HTML element, please update it accordingly.
|
|
6
|
+
See https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API for a full list of HTML elements interfaces.
|
|
7
|
+
*/
|
|
8
|
+
export interface IconProps extends SVGAttributes<HTMLOrSVGElement> {
|
|
9
|
+
icon: IconName;
|
|
10
|
+
/** Root path to the icons (default: /icons). Must be exposed to the user. */
|
|
11
|
+
rootPath?: string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ui/Icon/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;;;EAIE;AACF,MAAM,WAAW,SAAU,SAAQ,aAAa,CAAC,gBAAgB,CAAC;IAEhE,IAAI,EAAE,QAAQ,CAAC;IACf,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ElementType, ReactElement } from "react";
|
|
2
|
+
import type { LinkProps } from "./types.js";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
/**
|
|
5
|
+
* Link component that can be rendered as different elements while maintaining consistent styling
|
|
6
|
+
* @implements syntax:core:component:link:1.0.0
|
|
7
|
+
*/
|
|
8
|
+
declare const Link: <TElement extends ElementType = "a">({ as, className, children, appearance, ...props }: LinkProps<TElement>) => ReactElement;
|
|
9
|
+
export default Link;
|
|
10
|
+
//# sourceMappingURL=Link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../../src/ui/Link/Link.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,cAAc,CAAC;AAItB;;;GAGG;AACH,QAAA,MAAM,IAAI,GAAI,QAAQ,SAAS,WAAW,GAAG,GAAG,EAAE,mDAM/C,SAAS,CAAC,QAAQ,CAAC,KAAG,YAaxB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/Link/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ElementType, ReactNode } from "react";
|
|
2
|
+
import type { PolymorphicComponentProps } from "../../lib/index.js";
|
|
3
|
+
interface LinkOwnProps {
|
|
4
|
+
/** Additional CSS classes */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Link contents */
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/** Link appearance modifier */
|
|
9
|
+
appearance?: "soft";
|
|
10
|
+
}
|
|
11
|
+
export type LinkProps<TElement extends ElementType = "a"> = PolymorphicComponentProps<LinkOwnProps, TElement>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ui/Link/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAEpE,UAAU,YAAY;IACpB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,+BAA+B;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,SAAS,CAAC,QAAQ,SAAS,WAAW,GAAG,GAAG,IACtD,yBAAyB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -6,7 +6,6 @@ import type { HTMLAttributes } from "react";
|
|
|
6
6
|
See https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API for a full list of HTML elements interfaces.
|
|
7
7
|
*/
|
|
8
8
|
export interface RuleProps extends HTMLAttributes<HTMLHRElement> {
|
|
9
|
-
className?: string;
|
|
10
9
|
emphasis?: ModifierFamily<"emphasis">;
|
|
11
10
|
}
|
|
12
11
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ui/Rule/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C;;;;EAIE;AACF,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ui/Rule/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C;;;;EAIE;AACF,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,aAAa,CAAC;IAC9D,QAAQ,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;CACvC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { SkipLinkProps } from "./types.js";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
/**
|
|
5
|
+
* The `SkipLink` component provides a way for users to quickly navigate to the main content of a page.
|
|
6
|
+
* It is typically used by keyboard and screen reader users to bypass repetitive navigation links
|
|
7
|
+
* and other elements that appear at the top of the page, pursuant to [WCAG 2.1 Success Criterion 2.4.1](https://www.w3.org/WAI/WCAG21/Understanding/bypass-blocks.html).
|
|
8
|
+
*
|
|
9
|
+
* `SkipLink` should be placed near the top of your document body, before the `<main>` element.
|
|
10
|
+
* The `<main>` element should have a `tabindex` of `-1` to prevent it from receiving focus from the keyboard without using the skip link.
|
|
11
|
+
*
|
|
12
|
+
* @implements syntax:core:component:skiplink:1.0.0
|
|
13
|
+
*/
|
|
14
|
+
declare const SkipLink: ({ className, children, mainId, ...props }: SkipLinkProps) => React.ReactElement;
|
|
15
|
+
export default SkipLink;
|
|
16
|
+
//# sourceMappingURL=SkipLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkipLink.d.ts","sourceRoot":"","sources":["../../../../src/ui/SkipLink/SkipLink.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,cAAc,CAAC;AAItB;;;;;;;;;GASG;AACH,QAAA,MAAM,QAAQ,GAAI,2CAKf,aAAa,KAAG,KAAK,CAAC,YAcxB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/SkipLink/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
We have used the `HTMLDivElement` as a default props base.
|
|
4
|
+
If your component is based on a different HTML element, please update it accordingly.
|
|
5
|
+
See https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API for a full list of HTML elements interfaces.
|
|
6
|
+
*/
|
|
7
|
+
export interface SkipLinkProps extends Omit<HTMLAttributes<HTMLAnchorElement>, "href" | "tabIndex"> {
|
|
8
|
+
/** The contents of the skip link itself */
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* ID of the main content element
|
|
12
|
+
* @default "main"
|
|
13
|
+
* */
|
|
14
|
+
mainId?: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ui/SkipLink/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD;;;;EAIE;AACF,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IACpE,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;SAGK;IACL,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/dist/types/ui/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export * from "./Badge/index.js";
|
|
2
2
|
export * from "./Button/index.js";
|
|
3
|
+
export * from "./Card/index.js";
|
|
3
4
|
export * from "./Chip/index.js";
|
|
5
|
+
export * from "./Icon/index.js";
|
|
6
|
+
export * from "./Link/index.js";
|
|
4
7
|
export * from "./Rule/index.js";
|
|
8
|
+
export * from "./SkipLink/index.js";
|
|
5
9
|
export * from "./Tooltip/index.js";
|
|
6
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonical/react-ds-core",
|
|
3
|
-
"version": "0.10.0-experimental.
|
|
3
|
+
"version": "0.10.0-experimental.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -38,17 +38,18 @@
|
|
|
38
38
|
"test:vitest:watch": "vitest"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@canonical/
|
|
42
|
-
"@canonical/
|
|
43
|
-
"@canonical/
|
|
41
|
+
"@canonical/ds-assets": "^0.10.0-experimental.5",
|
|
42
|
+
"@canonical/storybook-config": "^0.10.0-experimental.5",
|
|
43
|
+
"@canonical/styles": "^0.10.0-experimental.5",
|
|
44
|
+
"@canonical/utils": "^0.10.0-experimental.4",
|
|
44
45
|
"react": "^19.1.0",
|
|
45
46
|
"react-dom": "^19.1.0"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"@biomejs/biome": "2.2.
|
|
49
|
-
"@canonical/biome-config": "^0.10.0-experimental.
|
|
50
|
-
"@canonical/ds-types": "^0.10.0-experimental.
|
|
51
|
-
"@canonical/typescript-config-react": "^0.10.0-experimental.
|
|
49
|
+
"@biomejs/biome": "2.2.4",
|
|
50
|
+
"@canonical/biome-config": "^0.10.0-experimental.4",
|
|
51
|
+
"@canonical/ds-types": "^0.10.0-experimental.4",
|
|
52
|
+
"@canonical/typescript-config-react": "^0.10.0-experimental.4",
|
|
52
53
|
"@chromatic-com/storybook": "^4.0.0",
|
|
53
54
|
"@testing-library/jest-dom": "^6.6.3",
|
|
54
55
|
"@testing-library/react": "^16.3.0",
|
|
@@ -58,12 +59,12 @@
|
|
|
58
59
|
"@vitejs/plugin-react": "^5.0.0",
|
|
59
60
|
"copyfiles": "^2.4.1",
|
|
60
61
|
"globals": "^16.2.0",
|
|
61
|
-
"jsdom": "^
|
|
62
|
+
"jsdom": "^27.0.0",
|
|
62
63
|
"storybook": "^9.0.8",
|
|
63
64
|
"typescript": "^5.8.3",
|
|
64
65
|
"vite": "^7.0.0",
|
|
65
66
|
"vite-tsconfig-paths": "^5.1.4",
|
|
66
67
|
"vitest": "^3.2.3"
|
|
67
68
|
},
|
|
68
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "467161a7c642004bf423a62ca1e76e0e31f568c3"
|
|
69
70
|
}
|