@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
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/types/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polymorphic.js","sourceRoot":"","sources":["../../../../src/lib/types/polymorphic.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const rtl = () => (Story) => (_jsx("div", { dir: "rtl", children: _jsx(Story, {}) }));
|
|
3
|
+
export const grid = () => (Story) => (_jsx("div", { style: {
|
|
4
|
+
display: "grid",
|
|
5
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(300px, 1fr))",
|
|
6
|
+
gap: "1em",
|
|
7
|
+
}, children: _jsx(Story, {}) }));
|
|
8
|
+
/**
|
|
9
|
+
* 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).
|
|
10
|
+
* @param id - The id of the main element
|
|
11
|
+
* @param children - Content to be rendered inside the main element
|
|
12
|
+
* @TODO this is the first decorator that seems like it may deserve a complex props object, and thus a separate Type.
|
|
13
|
+
* Should the type be declared separately? Should this be a separate file? Should the decorator be simplified somehow?
|
|
14
|
+
*/
|
|
15
|
+
export const beforeMain = ({ id = "main", children }) => (Story) => (_jsxs(_Fragment, { children: [_jsx(Story, {}), _jsx("main", { id: id, tabIndex: -1, children: children })] }));
|
|
16
|
+
//# sourceMappingURL=decorators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../src/storybook/decorators.tsx"],"names":[],"mappings":";AAEA,MAAM,CAAC,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC,KAAkB,EAAE,EAAE,CAAC,CAC/C,cAAK,GAAG,EAAC,KAAK,YACZ,KAAC,KAAK,KAAG,GACL,CACP,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,CAAC,KAAkB,EAAE,EAAE,CAAC,CAChD,cACE,KAAK,EAAE;QACL,OAAO,EAAE,MAAM;QACf,mBAAmB,EAAE,sCAAsC;QAC3D,GAAG,EAAE,KAAK;KACX,YAED,KAAC,KAAK,KAAG,GACL,CACP,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GACrB,CAAC,EAAE,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAyC,EAAE,EAAE,CACrE,CAAC,KAAkB,EAAE,EAAE,CAAC,CACtB,8BACE,KAAC,KAAK,KAAG,EACT,eAAM,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,YACvB,QAAQ,GACJ,IACN,CACJ,CAAC"}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
--badge-chip-margin-tweak: 0.15rem;
|
|
5
5
|
|
|
6
6
|
/* Base badge styles using tokens */
|
|
7
|
-
background-color: var(--
|
|
7
|
+
background-color: var(--modifier-color, var(--badge-color-background));
|
|
8
8
|
border-radius: var(--badge-border-radius);
|
|
9
9
|
box-sizing: content-box;
|
|
10
|
-
color: var(--
|
|
10
|
+
color: var(--modifier-color-text, var(--badge-color-text));
|
|
11
11
|
display: inline-block;
|
|
12
12
|
font-size: var(--badge-font-size);
|
|
13
13
|
font-weight: var(--badge-font-weight);
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
display: inline-block;
|
|
23
23
|
cursor: pointer;
|
|
24
24
|
|
|
25
|
-
color: var(--
|
|
26
|
-
background-color: var(--
|
|
27
|
-
border-color: var(--
|
|
25
|
+
color: var(--modifier-color-text, var(--button-color-text));
|
|
26
|
+
background-color: var(--modifier-color, var(--button-color-background));
|
|
27
|
+
border-color: var(--modifier-color-border, var(--button-color-border));
|
|
28
28
|
border-style: solid;
|
|
29
29
|
border-width: var(--button-border-width);
|
|
30
30
|
font-size: var(--button-font-size);
|
|
@@ -41,22 +41,22 @@
|
|
|
41
41
|
/* component states */
|
|
42
42
|
&:hover {
|
|
43
43
|
background-color: var(
|
|
44
|
-
--
|
|
44
|
+
--modifier-color-hover,
|
|
45
45
|
var(--button-color-background-hover)
|
|
46
46
|
);
|
|
47
47
|
border-color: var(
|
|
48
|
-
--
|
|
48
|
+
--modifier-color-border-hover,
|
|
49
49
|
var(--button-color-border-hover)
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
&:active {
|
|
54
54
|
background-color: var(
|
|
55
|
-
--
|
|
55
|
+
--modifier-color-active,
|
|
56
56
|
var(--button-color-background-active)
|
|
57
57
|
);
|
|
58
58
|
border-color: var(
|
|
59
|
-
--
|
|
59
|
+
--modifier-color-border-active,
|
|
60
60
|
var(--button-color-border-active)
|
|
61
61
|
);
|
|
62
62
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Image, Section, ThumbnailSection } from "./common/index.js";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
const componentCssClassName = "ds card";
|
|
5
|
+
/**
|
|
6
|
+
* Card component
|
|
7
|
+
* @implements syntax:core:component:card:1.0.0
|
|
8
|
+
*/
|
|
9
|
+
const Card = ({ className, children, emphasis = "neutral", ...props }) => (_jsx("div", { className: [componentCssClassName, emphasis, className]
|
|
10
|
+
.filter(Boolean)
|
|
11
|
+
.join(" "), ...props, children: children }));
|
|
12
|
+
Card.ThumbnailSection = ThumbnailSection;
|
|
13
|
+
Card.Image = Image;
|
|
14
|
+
Card.Section = Section;
|
|
15
|
+
export default Card;
|
|
16
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../../src/ui/Card/Card.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErE,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAExC;;;GAGG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,SAAS,EACT,QAAQ,EACR,QAAQ,GAAG,SAAS,EACpB,GAAG,KAAK,EACE,EAAsB,EAAE,CAAC,CACnC,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,QAAQ,EAAE,SAAS,CAAC;SACpD,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,KACR,KAAK,YAER,QAAQ,GACL,CACP,CAAC;AAEF,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACzC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AAEvB,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
const componentCssClassName = "ds card-image";
|
|
4
|
+
/**
|
|
5
|
+
* Image component for Card
|
|
6
|
+
* Full-width image with content bleed (no padding)
|
|
7
|
+
* @returns {React.ReactElement} - Rendered Image
|
|
8
|
+
*/
|
|
9
|
+
const Image = ({ className, alt, ...props }) => {
|
|
10
|
+
return (_jsx("img", { className: [componentCssClassName, className].filter(Boolean).join(" "), alt: alt, ...props }));
|
|
11
|
+
};
|
|
12
|
+
Image.displayName = "Card.Image";
|
|
13
|
+
export default Image;
|
|
14
|
+
//# sourceMappingURL=Image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Image/Image.tsx"],"names":[],"mappings":";AAIA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,KAAK,GAAG,CAAC,EACb,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACG,EAAsB,EAAE;IACnC,OAAO,CACL,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACvE,GAAG,EAAE,GAAG,KACJ,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,KAAK,CAAC,WAAW,GAAG,YAAY,CAAC;AAEjC,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Image/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Image/types.ts"],"names":[],"mappings":"AAAA,mDAAmD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
const componentCssClassName = "ds card-section";
|
|
4
|
+
/**
|
|
5
|
+
* Section component for Card
|
|
6
|
+
* @returns {React.ReactElement} - Rendered Section
|
|
7
|
+
*/
|
|
8
|
+
const Section = ({ children, className, ...props }) => {
|
|
9
|
+
return (_jsx("section", { className: [componentCssClassName, className].filter(Boolean).join(" "), ...props, children: children }));
|
|
10
|
+
};
|
|
11
|
+
Section.displayName = "Card.Section";
|
|
12
|
+
export default Section;
|
|
13
|
+
//# sourceMappingURL=Section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Section.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Section/Section.tsx"],"names":[],"mappings":";AAIA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD;;;GAGG;AACH,MAAM,OAAO,GAAG,CAAC,EACf,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACK,EAAsB,EAAE;IACrC,OAAO,CACL,kBACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACnE,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,CAAC,WAAW,GAAG,cAAc,CAAC;AAErC,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Section/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/Section/types.ts"],"names":[],"mappings":"AAAA,mDAAmD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Section from "../Section/Section.js";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
const componentCssClassName = "ds card-thumbnail-section";
|
|
5
|
+
/**
|
|
6
|
+
* ThumbnailSection component for Card thumbnails
|
|
7
|
+
* Extends Section behavior with thumbnail image
|
|
8
|
+
*/
|
|
9
|
+
const ThumbnailSection = ({ className, imageProps, ...props }) => {
|
|
10
|
+
return (_jsx(Section, { className: [componentCssClassName, className].filter(Boolean).join(" "), ...props, children: _jsx("img", { alt: imageProps.alt, ...imageProps }) }));
|
|
11
|
+
};
|
|
12
|
+
ThumbnailSection.displayName = "Card.ThumbnailSection";
|
|
13
|
+
export default ThumbnailSection;
|
|
14
|
+
//# sourceMappingURL=ThumbnailSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThumbnailSection.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/ThumbnailSection/ThumbnailSection.tsx"],"names":[],"mappings":";AAGA,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAE5C,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAE1D;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CAAC,EACxB,SAAS,EACT,UAAU,EACV,GAAG,KAAK,EACc,EAAsB,EAAE;IAC9C,OAAO,CACL,KAAC,OAAO,IACN,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACnE,KAAK,YAGT,cAAK,GAAG,EAAE,UAAU,CAAC,GAAG,KAAM,UAAU,GAAI,GACpC,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,gBAAgB,CAAC,WAAW,GAAG,uBAAuB,CAAC;AAEvD,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/ThumbnailSection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* @canonical/generator-ds 0.10.0-experimental.2 */
|
|
2
|
+
|
|
3
|
+
.ds.card-thumbnail-section {
|
|
4
|
+
& > img {
|
|
5
|
+
max-height: var(--card-thumbnail-max-height);
|
|
6
|
+
|
|
7
|
+
/* TODO in Vanilla these are globally applied to all imgs, maybe we want to do that here as well */
|
|
8
|
+
max-width: 100%;
|
|
9
|
+
height: auto;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/ui/Card/common/ThumbnailSection/types.ts"],"names":[],"mappings":"AAAA,mDAAmD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","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.js","sourceRoot":"","sources":["../../../../src/ui/Card/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* @canonical/generator-ds 0.10.0-experimental.2 */
|
|
2
|
+
|
|
3
|
+
.ds.card {
|
|
4
|
+
/* prevent overflow of child margins */
|
|
5
|
+
overflow: auto;
|
|
6
|
+
|
|
7
|
+
box-shadow: var(--modifier-box-shadow, var(--card-box-shadow));
|
|
8
|
+
color: var(--modifier-color-text, var(--card-color-text));
|
|
9
|
+
background-color: var(--modifier-color, var(--card-color-background));
|
|
10
|
+
border-width: var(--card-border-width);
|
|
11
|
+
border-style: var(--card-border-style);
|
|
12
|
+
border-color: var(--card-section-separator-color);
|
|
13
|
+
|
|
14
|
+
& .card-section,
|
|
15
|
+
& .card-image {
|
|
16
|
+
/* Last section doesn't need a border (the Card itself has a border) */
|
|
17
|
+
&:not(:last-child) {
|
|
18
|
+
border-bottom: var(--card-section-separator-border-width)
|
|
19
|
+
var(--card-section-separator-border-style)
|
|
20
|
+
var(--card-section-separator-color);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ui/Card/types.ts"],"names":[],"mappings":"AAAA,mDAAmD"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* @canonical/generator-canonical-ds 0.4.0-experimental.0 */
|
|
2
2
|
|
|
3
3
|
.ds.chip {
|
|
4
|
-
border-color: var(--
|
|
4
|
+
border-color: var(--modifier-color-border, var(--chip-color-border));
|
|
5
5
|
border-style: solid;
|
|
6
6
|
border-radius: var(--chip-border-radius);
|
|
7
7
|
border-width: var(--chip-border-width);
|
|
8
8
|
|
|
9
|
-
color: var(--
|
|
10
|
-
background-color: var(--
|
|
9
|
+
color: var(--modifier-color-text-tinted, var(--chip-color-text));
|
|
10
|
+
background-color: var(--modifier-color-tinted, var(--chip-color-background));
|
|
11
11
|
|
|
12
12
|
display: inline-flex;
|
|
13
13
|
align-items: baseline;
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
&:hover:not(:has(.dismiss)),
|
|
65
65
|
& > .dismiss:hover {
|
|
66
66
|
background-color: var(
|
|
67
|
-
--
|
|
67
|
+
--modifier-color-tinted-hover,
|
|
68
68
|
var(--chip-color-background-hover)
|
|
69
69
|
);
|
|
70
70
|
}
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
&:active:not(:has(.dismiss)),
|
|
73
73
|
& > .dismiss:active {
|
|
74
74
|
background-color: var(
|
|
75
|
-
--
|
|
75
|
+
--modifier-color-tinted-active,
|
|
76
76
|
var(--chip-color-background-active)
|
|
77
77
|
);
|
|
78
78
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
const componentCssClassName = "ds icon";
|
|
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
|
+
const Icon = ({ xmlns = "http://www.w3.org/2000/svg", viewBox = "0 0 16 16", icon, className, rootPath = "/icons", role = "img", ...props }) => {
|
|
12
|
+
return (_jsx("svg", { xmlns: xmlns, viewBox: viewBox, className: [componentCssClassName, className].filter(Boolean).join(" "), role: role, ...props, children: _jsx("use", { href: `${rootPath}/${icon}.svg#${icon}` }) }));
|
|
13
|
+
};
|
|
14
|
+
export default Icon;
|
|
15
|
+
//# sourceMappingURL=Icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../../src/ui/Icon/Icon.tsx"],"names":[],"mappings":";AAKA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,KAAK,GAAG,4BAA4B,EACpC,OAAO,GAAG,WAAW,EACrB,IAAI,EACJ,SAAS,EACT,QAAQ,GAAG,QAAQ,EACnB,IAAI,GAAG,KAAK,EACZ,GAAG,KAAK,EACE,EAAgB,EAAE;IAC5B,OAAO,CACL,cACE,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACvE,IAAI,EAAE,IAAI,KACN,KAAK,YAET,cAAK,IAAI,EAAE,GAAG,QAAQ,IAAI,IAAI,QAAQ,IAAI,EAAE,GAAI,GAC5C,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/Icon/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ui/Icon/types.ts"],"names":[],"mappings":"AAAA,mDAAmD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
const componentCssClassName = "ds link";
|
|
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
|
+
const Link = ({ as, className, children, appearance, ...props }) => {
|
|
9
|
+
const Component = as || "a";
|
|
10
|
+
return (_jsx(Component, { className: [componentCssClassName, className, appearance]
|
|
11
|
+
.filter(Boolean)
|
|
12
|
+
.join(" "), ...props, children: children }));
|
|
13
|
+
};
|
|
14
|
+
export default Link;
|
|
15
|
+
//# sourceMappingURL=Link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../../../../src/ui/Link/Link.tsx"],"names":[],"mappings":";AAIA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAExC;;;GAGG;AACH,MAAM,IAAI,GAAG,CAAqC,EAChD,EAAE,EACF,SAAS,EACT,QAAQ,EACR,UAAU,EACV,GAAG,KAAK,EACY,EAAgB,EAAE;IACtC,MAAM,SAAS,GAAG,EAAE,IAAI,GAAG,CAAC;IAE5B,OAAO,CACL,KAAC,SAAS,IACR,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,EAAE,UAAU,CAAC;aACtD,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,KACR,KAAK,YAER,QAAQ,GACC,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/Link/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* @canonical/generator-ds 0.10.0-experimental.2 */
|
|
2
|
+
|
|
3
|
+
.ds.link {
|
|
4
|
+
&.soft {
|
|
5
|
+
/*
|
|
6
|
+
Soft links are explicitly meant to use normal text color
|
|
7
|
+
TODO because <a> tag have their color set in the styles package, we need to set a specific color here.
|
|
8
|
+
Otherwise, we could use `currentColor` or only apply link color to non-soft links, which would allow the link to inherit color from parent.
|
|
9
|
+
We should confirm this approach is what we want.
|
|
10
|
+
*/
|
|
11
|
+
color: var(--tmp-color-text-default);
|
|
12
|
+
|
|
13
|
+
&:hover {
|
|
14
|
+
color: var(--tmp-color-text-link-default);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&:visited {
|
|
18
|
+
color: var(--tmp-color-text-default);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&[aria-current="page"] {
|
|
22
|
+
font-weight: var(--link-soft-selected-font-weight);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ui/Link/types.ts"],"names":[],"mappings":"AAAA,mDAAmD"}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
.ds.rule {
|
|
4
4
|
background-color: var(
|
|
5
|
-
--
|
|
5
|
+
--modifier-separator-bar-color,
|
|
6
6
|
var(--rule-color-background)
|
|
7
7
|
);
|
|
8
8
|
border-width: var(--rule-border-width);
|
|
9
|
-
height: var(--
|
|
9
|
+
height: var(--modifier-separator-bar-height, var(--rule-height));
|
|
10
10
|
margin-block-start: var(--rule-margin-top);
|
|
11
11
|
/* global modifiers can change the height of the rule. Subtract the actual height of the rule from the target height to keep baseline alignment */
|
|
12
12
|
margin-block-end: calc(
|
|
13
13
|
var(--rule-height-with-margin) -
|
|
14
|
-
var(--
|
|
14
|
+
var(--modifier-separator-bar-height, var(--rule-height))
|
|
15
15
|
);
|
|
16
16
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
const componentCssClassName = "ds skip-link";
|
|
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
|
+
const SkipLink = ({ className, children, mainId = "main", ...props }) => {
|
|
15
|
+
const href = `#${mainId}`;
|
|
16
|
+
const skipLinkContents = children || "Skip to main content";
|
|
17
|
+
return (_jsx("a", { className: [componentCssClassName, className].filter(Boolean).join(" "), href: href, tabIndex: 0, ...props, children: skipLinkContents }));
|
|
18
|
+
};
|
|
19
|
+
export default SkipLink;
|
|
20
|
+
//# sourceMappingURL=SkipLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkipLink.js","sourceRoot":"","sources":["../../../../src/ui/SkipLink/SkipLink.tsx"],"names":[],"mappings":";AAIA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAE7C;;;;;;;;;GASG;AACH,MAAM,QAAQ,GAAG,CAAC,EAChB,SAAS,EACT,QAAQ,EACR,MAAM,GAAG,MAAM,EACf,GAAG,KAAK,EACM,EAAsB,EAAE;IACtC,MAAM,IAAI,GAAG,IAAI,MAAM,EAAE,CAAC;IAC1B,MAAM,gBAAgB,GAAG,QAAQ,IAAI,sBAAsB,CAAC;IAE5D,OAAO,CACL,YACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACvE,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,CAAC,KACP,KAAK,YAER,gBAAgB,GACf,CACL,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/SkipLink/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* @canonical/generator-ds 0.10.0-experimental.4 */
|
|
2
|
+
|
|
3
|
+
.ds.skip-link {
|
|
4
|
+
background: var(--skip-link-background);
|
|
5
|
+
color: var(--skip-link-color);
|
|
6
|
+
display: block;
|
|
7
|
+
inset-inline-start: var(--skip-link-inset-inline-start);
|
|
8
|
+
position: absolute;
|
|
9
|
+
top: var(--skip-link-top);
|
|
10
|
+
|
|
11
|
+
&:focus,
|
|
12
|
+
&:focus-visible {
|
|
13
|
+
inset-inline-start: var(--skip-link-focus-inset-inline-start);
|
|
14
|
+
outline-offset: var(--skip-link-outline-offset);
|
|
15
|
+
padding-block: var(--skip-link-focus-padding-block);
|
|
16
|
+
padding-inline: var(--skip-link-focus-padding-inline);
|
|
17
|
+
position: fixed;
|
|
18
|
+
top: var(--skip-link-focus-top);
|
|
19
|
+
z-index: var(--skip-link-focus-z-index);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ui/SkipLink/types.ts"],"names":[],"mappings":"AAAA,mDAAmD"}
|
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
transparent;
|
|
33
33
|
|
|
34
34
|
color: var(
|
|
35
|
-
--
|
|
35
|
+
--modifier-color-text,
|
|
36
36
|
var(--tooltip-color-text, var(--color-text-default))
|
|
37
37
|
);
|
|
38
38
|
background-color: var(
|
|
39
|
-
--
|
|
39
|
+
--modifier-color,
|
|
40
40
|
var(--tooltip-color-background, var(--color-background-default))
|
|
41
41
|
);
|
|
42
42
|
border-color: var(
|
|
43
|
-
--
|
|
43
|
+
--modifier-color-border,
|
|
44
44
|
var(--tooltip-color-border, transparent)
|
|
45
45
|
);
|
|
46
46
|
border-style: solid;
|
package/dist/esm/ui/index.js
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.js.map
|
package/dist/esm/ui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","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.js","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/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
|