@canonical/react-ds-global 0.37.0 → 0.38.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 +72 -0
- package/dist/esm/lib/_work_in_progress/Announcement/styles.css +51 -47
- package/dist/esm/lib/_work_in_progress/CategoriesSection/common/Category/styles.css +21 -17
- package/dist/esm/lib/_work_in_progress/CategoriesSection/styles.css +16 -12
- package/dist/esm/lib/_work_in_progress/ChatSection/styles.css +22 -18
- package/dist/esm/lib/_work_in_progress/DescriptionSection/styles.css +14 -10
- package/dist/esm/lib/_work_in_progress/IconSection/styles.css +18 -14
- package/dist/esm/lib/_work_in_progress/Label/styles.css +36 -32
- package/dist/esm/lib/_work_in_progress/Link/styles.css +32 -28
- package/dist/esm/lib/_work_in_progress/Rule/styles.css +21 -14
- package/dist/esm/lib/_work_in_progress/Section/styles.css +66 -62
- package/dist/esm/lib/_work_in_progress/SkipLink/styles.css +35 -32
- package/dist/esm/lib/_work_in_progress/TSection/styles.css +26 -22
- package/dist/esm/lib/_work_in_progress/grid/ApplicationLayout/ApplicationLayout.js +4 -1
- package/dist/esm/lib/_work_in_progress/grid/ApplicationLayout/ApplicationLayout.js.map +1 -1
- package/dist/esm/lib/_work_in_progress/grid/ApplicationLayout/styles.css +21 -17
- package/dist/esm/lib/_work_in_progress/grid/GridCard/GridCard.js +4 -1
- package/dist/esm/lib/_work_in_progress/grid/GridCard/GridCard.js.map +1 -1
- package/dist/esm/lib/_work_in_progress/grid/GridCard/styles.css +8 -4
- package/dist/esm/lib/_work_in_progress/grid/InnerGridDemo/styles.css +38 -33
- package/dist/esm/lib/_work_in_progress/grid/SettingsView/SettingsView.js +4 -1
- package/dist/esm/lib/_work_in_progress/grid/SettingsView/SettingsView.js.map +1 -1
- package/dist/esm/lib/_work_in_progress/grid/SettingsView/styles.css +23 -19
- package/dist/esm/lib/component/Accordion/common/Item/styles.css +305 -299
- package/dist/esm/lib/component/Accordion/styles.css +35 -31
- package/dist/esm/lib/component/Badge/hooks/useBadge.js +1 -1
- package/dist/esm/lib/component/Badge/hooks/useBadge.js.map +1 -1
- package/dist/esm/lib/component/Badge/styles.css +45 -41
- package/dist/esm/lib/component/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/esm/lib/component/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/esm/lib/component/Breadcrumbs/common/Item/styles.css +69 -65
- package/dist/esm/lib/component/Breadcrumbs/styles.css +30 -26
- package/dist/esm/lib/component/Button/styles.css +293 -260
- package/dist/esm/lib/component/Card/common/Content/styles.css +27 -23
- package/dist/esm/lib/component/Card/common/Footer/styles.css +30 -26
- package/dist/esm/lib/component/Card/common/Header/styles.css +25 -21
- package/dist/esm/lib/component/Card/common/Image/styles.css +8 -4
- package/dist/esm/lib/component/Card/styles.css +77 -73
- package/dist/esm/lib/component/Chip/Chip.js.map +1 -1
- package/dist/esm/lib/component/Chip/styles.css +105 -101
- package/dist/esm/lib/component/ContextualMenu/ContextualMenu.js +29 -20
- package/dist/esm/lib/component/ContextualMenu/ContextualMenu.js.map +1 -1
- package/dist/esm/lib/component/ContextualMenu/common/Item/Item.js +25 -2
- package/dist/esm/lib/component/ContextualMenu/common/Item/Item.js.map +1 -1
- package/dist/esm/lib/component/ContextualMenu/common/Item/styles.css +116 -106
- package/dist/esm/lib/component/ContextualMenu/common/SubMenu/SubMenu.js +29 -9
- package/dist/esm/lib/component/ContextualMenu/common/SubMenu/SubMenu.js.map +1 -1
- package/dist/esm/lib/component/ContextualMenu/styles.css +74 -72
- package/dist/esm/lib/component/Icon/styles.css +24 -20
- package/dist/esm/lib/component/InlineCode/styles.css +19 -15
- package/dist/esm/lib/component/KeyboardKey/styles.css +44 -40
- package/dist/esm/lib/component/Popover/Popover.js.map +1 -1
- package/dist/esm/lib/component/Popover/styles.css +59 -52
- package/dist/esm/lib/component/Tabs/common/Item/styles.css +80 -76
- package/dist/esm/lib/component/Tabs/styles.css +36 -32
- package/dist/esm/lib/component/Tile/common/Content/styles.css +28 -24
- package/dist/esm/lib/component/Tile/common/Header/styles.css +28 -24
- package/dist/esm/lib/component/Tile/styles.css +31 -27
- package/dist/esm/lib/component/Tooltip/styles.css +213 -208
- package/dist/esm/lib/group/Cards/styles.css +26 -22
- package/dist/esm/lib/group/KeyboardKeys/styles.css +14 -10
- package/dist/esm/lib/hooks/useContextualMenu/index.js +1 -0
- package/dist/esm/lib/hooks/useContextualMenu/index.js.map +1 -1
- package/dist/esm/lib/hooks/useContextualMenu/isMenuSeparator.js +11 -0
- package/dist/esm/lib/hooks/useContextualMenu/isMenuSeparator.js.map +1 -0
- package/dist/esm/lib/hooks/useContextualMenu/useContextualMenu.js +54 -34
- package/dist/esm/lib/hooks/useContextualMenu/useContextualMenu.js.map +1 -1
- package/dist/esm/lib/hooks/useDisclosure/useDisclosure.js.map +1 -1
- package/dist/esm/lib/hooks/useWindowDimensions/useWindowDimensions.js +1 -1
- package/dist/esm/lib/hooks/useWindowDimensions/useWindowDimensions.js.map +1 -1
- package/dist/esm/lib/hooks/useWindowFitment/useWindowFitment.js +3 -0
- package/dist/esm/lib/hooks/useWindowFitment/useWindowFitment.js.map +1 -1
- package/dist/esm/lib/index.css +79 -0
- package/dist/esm/lib/pattern/Modal/Context.js +10 -0
- package/dist/esm/lib/pattern/Modal/Context.js.map +1 -0
- package/dist/esm/lib/pattern/Modal/Provider.js +103 -0
- package/dist/esm/lib/pattern/Modal/Provider.js.map +1 -0
- package/dist/esm/lib/pattern/Modal/common/Content/Content.js +15 -0
- package/dist/esm/lib/pattern/Modal/common/Content/Content.js.map +1 -0
- package/dist/esm/lib/pattern/Modal/common/Content/index.js +3 -0
- package/dist/esm/lib/pattern/Modal/common/Content/index.js.map +1 -0
- package/dist/esm/lib/pattern/Modal/common/Content/styles.css +37 -0
- package/dist/esm/lib/pattern/Modal/common/Content/types.js +2 -0
- package/dist/esm/lib/pattern/Modal/common/Content/types.js.map +1 -0
- package/dist/esm/lib/pattern/Modal/common/Footer/Footer.js +16 -0
- package/dist/esm/lib/pattern/Modal/common/Footer/Footer.js.map +1 -0
- package/dist/esm/lib/pattern/Modal/common/Footer/index.js +3 -0
- package/dist/esm/lib/pattern/Modal/common/Footer/index.js.map +1 -0
- package/dist/esm/lib/pattern/Modal/common/Footer/styles.css +57 -0
- package/dist/esm/lib/pattern/Modal/common/Footer/types.js +2 -0
- package/dist/esm/lib/pattern/Modal/common/Footer/types.js.map +1 -0
- package/dist/esm/lib/pattern/Modal/common/Header/Header.js +27 -0
- package/dist/esm/lib/pattern/Modal/common/Header/Header.js.map +1 -0
- package/dist/esm/lib/pattern/Modal/common/Header/index.js +3 -0
- package/dist/esm/lib/pattern/Modal/common/Header/index.js.map +1 -0
- package/dist/esm/lib/pattern/Modal/common/Header/styles.css +79 -0
- package/dist/esm/lib/pattern/Modal/common/Header/types.js +2 -0
- package/dist/esm/lib/pattern/Modal/common/Header/types.js.map +1 -0
- package/dist/esm/lib/pattern/Modal/common/index.js +5 -0
- package/dist/esm/lib/pattern/Modal/common/index.js.map +1 -0
- package/dist/esm/lib/pattern/Modal/hooks/useModalContext.js +11 -0
- package/dist/esm/lib/pattern/Modal/hooks/useModalContext.js.map +1 -0
- package/dist/esm/lib/pattern/Modal/hooks/useModalState.js +15 -0
- package/dist/esm/lib/pattern/Modal/hooks/useModalState.js.map +1 -0
- package/dist/esm/lib/pattern/Modal/index.js +4 -0
- package/dist/esm/lib/pattern/Modal/index.js.map +1 -0
- package/dist/esm/lib/pattern/Modal/styles.css +119 -0
- package/dist/esm/lib/pattern/Modal/types.js +2 -0
- package/dist/esm/lib/pattern/Modal/types.js.map +1 -0
- package/dist/esm/lib/pattern/Modal/withModal.js +102 -0
- package/dist/esm/lib/pattern/Modal/withModal.js.map +1 -0
- package/dist/esm/lib/pattern/Timeline/common/Content/styles.css +16 -12
- package/dist/esm/lib/pattern/Timeline/common/Event/styles.css +116 -112
- package/dist/esm/lib/pattern/Timeline/styles.css +16 -12
- package/dist/esm/lib/pattern/index.js +1 -0
- package/dist/esm/lib/pattern/index.js.map +1 -1
- package/dist/esm/lib/subcomponent/Spinner/styles.css +38 -34
- package/dist/types/lib/_work_in_progress/grid/ApplicationLayout/ApplicationLayout.d.ts.map +1 -1
- package/dist/types/lib/_work_in_progress/grid/GridCard/GridCard.d.ts.map +1 -1
- package/dist/types/lib/_work_in_progress/grid/SettingsView/SettingsView.d.ts.map +1 -1
- package/dist/types/lib/component/Badge/types.d.ts +1 -1
- package/dist/types/lib/component/Badge/types.d.ts.map +1 -1
- package/dist/types/lib/component/Breadcrumbs/types.d.ts +2 -2
- package/dist/types/lib/component/Breadcrumbs/types.d.ts.map +1 -1
- package/dist/types/lib/component/Chip/Chip.d.ts +2 -2
- package/dist/types/lib/component/Chip/Chip.d.ts.map +1 -1
- package/dist/types/lib/component/Chip/types.d.ts +10 -8
- package/dist/types/lib/component/Chip/types.d.ts.map +1 -1
- package/dist/types/lib/component/ContextualMenu/ContextualMenu.d.ts +4 -4
- package/dist/types/lib/component/ContextualMenu/ContextualMenu.d.ts.map +1 -1
- package/dist/types/lib/component/ContextualMenu/common/Item/Item.d.ts.map +1 -1
- package/dist/types/lib/component/ContextualMenu/common/MenuContext.d.ts +1 -1
- package/dist/types/lib/component/ContextualMenu/common/MenuContext.d.ts.map +1 -1
- package/dist/types/lib/component/ContextualMenu/common/SubMenu/SubMenu.d.ts +9 -7
- package/dist/types/lib/component/ContextualMenu/common/SubMenu/SubMenu.d.ts.map +1 -1
- package/dist/types/lib/component/ContextualMenu/types.d.ts +14 -6
- package/dist/types/lib/component/ContextualMenu/types.d.ts.map +1 -1
- package/dist/types/lib/component/Tabs/types.d.ts +2 -2
- package/dist/types/lib/component/Tabs/types.d.ts.map +1 -1
- package/dist/types/lib/hooks/useContextualMenu/index.d.ts +1 -0
- package/dist/types/lib/hooks/useContextualMenu/index.d.ts.map +1 -1
- package/dist/types/lib/hooks/useContextualMenu/isMenuSeparator.d.ts +13 -0
- package/dist/types/lib/hooks/useContextualMenu/isMenuSeparator.d.ts.map +1 -0
- package/dist/types/lib/hooks/useContextualMenu/types.d.ts +45 -15
- package/dist/types/lib/hooks/useContextualMenu/types.d.ts.map +1 -1
- package/dist/types/lib/hooks/useContextualMenu/useContextualMenu.d.ts +5 -6
- package/dist/types/lib/hooks/useContextualMenu/useContextualMenu.d.ts.map +1 -1
- package/dist/types/lib/hooks/useDisclosure/types.d.ts +7 -2
- package/dist/types/lib/hooks/useDisclosure/types.d.ts.map +1 -1
- package/dist/types/lib/hooks/useDisclosure/useDisclosure.d.ts +1 -1
- package/dist/types/lib/hooks/useDisclosure/useDisclosure.d.ts.map +1 -1
- package/dist/types/lib/hooks/useWindowFitment/types.d.ts +12 -3
- package/dist/types/lib/hooks/useWindowFitment/types.d.ts.map +1 -1
- package/dist/types/lib/hooks/useWindowFitment/useWindowFitment.d.ts +1 -1
- package/dist/types/lib/hooks/useWindowFitment/useWindowFitment.d.ts.map +1 -1
- package/dist/types/lib/pattern/Modal/Context.d.ts +10 -0
- package/dist/types/lib/pattern/Modal/Context.d.ts.map +1 -0
- package/dist/types/lib/pattern/Modal/Provider.d.ts +63 -0
- package/dist/types/lib/pattern/Modal/Provider.d.ts.map +1 -0
- package/dist/types/lib/pattern/Modal/common/Content/Content.d.ts +17 -0
- package/dist/types/lib/pattern/Modal/common/Content/Content.d.ts.map +1 -0
- package/dist/types/lib/pattern/Modal/common/Content/index.d.ts +3 -0
- package/dist/types/lib/pattern/Modal/common/Content/index.d.ts.map +1 -0
- package/dist/types/lib/pattern/Modal/common/Content/types.d.ts +15 -0
- package/dist/types/lib/pattern/Modal/common/Content/types.d.ts.map +1 -0
- package/dist/types/lib/pattern/Modal/common/Footer/Footer.d.ts +18 -0
- package/dist/types/lib/pattern/Modal/common/Footer/Footer.d.ts.map +1 -0
- package/dist/types/lib/pattern/Modal/common/Footer/index.d.ts +3 -0
- package/dist/types/lib/pattern/Modal/common/Footer/index.d.ts.map +1 -0
- package/dist/types/lib/pattern/Modal/common/Footer/types.d.ts +16 -0
- package/dist/types/lib/pattern/Modal/common/Footer/types.d.ts.map +1 -0
- package/dist/types/lib/pattern/Modal/common/Header/Header.d.ts +24 -0
- package/dist/types/lib/pattern/Modal/common/Header/Header.d.ts.map +1 -0
- package/dist/types/lib/pattern/Modal/common/Header/index.d.ts +3 -0
- package/dist/types/lib/pattern/Modal/common/Header/index.d.ts.map +1 -0
- package/dist/types/lib/pattern/Modal/common/Header/types.d.ts +36 -0
- package/dist/types/lib/pattern/Modal/common/Header/types.d.ts.map +1 -0
- package/dist/types/lib/pattern/Modal/common/index.d.ts +4 -0
- package/dist/types/lib/pattern/Modal/common/index.d.ts.map +1 -0
- package/dist/types/lib/pattern/Modal/hooks/useModalContext.d.ts +4 -0
- package/dist/types/lib/pattern/Modal/hooks/useModalContext.d.ts.map +1 -0
- package/dist/types/lib/pattern/Modal/hooks/useModalState.d.ts +10 -0
- package/dist/types/lib/pattern/Modal/hooks/useModalState.d.ts.map +1 -0
- package/dist/types/lib/pattern/Modal/index.d.ts +4 -0
- package/dist/types/lib/pattern/Modal/index.d.ts.map +1 -0
- package/dist/types/lib/pattern/Modal/types.d.ts +122 -0
- package/dist/types/lib/pattern/Modal/types.d.ts.map +1 -0
- package/dist/types/lib/pattern/Modal/withModal.d.ts +74 -0
- package/dist/types/lib/pattern/Modal/withModal.d.ts.map +1 -0
- package/dist/types/lib/pattern/index.d.ts +1 -0
- package/dist/types/lib/pattern/index.d.ts.map +1 -1
- package/package.json +28 -18
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
|
|
2
|
+
|
|
3
|
+
@layer ds.components.global {
|
|
4
|
+
/**
|
|
5
|
+
* Modal.Footer styles
|
|
6
|
+
* @implements ds:global.subcomponent.modal-footer
|
|
7
|
+
*
|
|
8
|
+
* DSL anatomy mapping:
|
|
9
|
+
* - layout.type: flow, layout.direction: horizontal -> display: flex; flex-direction: row
|
|
10
|
+
* - layout.justify: end -> justify-content: flex-end
|
|
11
|
+
* - spacing.gap: spacing/small -> gap: var(--modal-footer-gap)
|
|
12
|
+
* - spacing.internal: spacing/medium -> padding-block / padding-inline
|
|
13
|
+
* - appearance.border.top: border/style/divider -> an inset ::before rule, not a
|
|
14
|
+
* border (a border would span the full dialog width; the design insets the
|
|
15
|
+
* rule to the inline padding)
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/* Component tokens — sourced from @canonical/design-tokens */
|
|
19
|
+
:root {
|
|
20
|
+
/* The rules are quiet boundaries, not structural edges: `muted` is the
|
|
21
|
+
palest border token (gray-100 vs gray-520 for `--color-border`). */
|
|
22
|
+
--modal-footer-color-border: var(--color-border-muted);
|
|
23
|
+
--modal-footer-border-width: var(--dimension-stroke-thickness-medium);
|
|
24
|
+
--modal-footer-padding-block: var(--dimension-200);
|
|
25
|
+
--modal-footer-padding-inline: var(--modal-padding-inline);
|
|
26
|
+
--modal-footer-gap: var(--dimension-100);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.ds.modal-footer {
|
|
30
|
+
/* layout.type: flow, direction horizontal, justify end */
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: row;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: flex-end;
|
|
35
|
+
gap: var(--modal-footer-gap);
|
|
36
|
+
padding-block: var(--modal-footer-padding-block);
|
|
37
|
+
padding-inline: var(--modal-footer-padding-inline);
|
|
38
|
+
/* Never shrink: only the content pane gives way. */
|
|
39
|
+
flex: 0 0 auto;
|
|
40
|
+
/* Positions the inset rule below. */
|
|
41
|
+
position: relative;
|
|
42
|
+
|
|
43
|
+
/*
|
|
44
|
+
The second of the two horizontal rules bounding the content — inset to the
|
|
45
|
+
inline padding so it aligns with the actions and the content. See
|
|
46
|
+
Modal.Header for why this is a pseudo-element and not a border.
|
|
47
|
+
*/
|
|
48
|
+
&::before {
|
|
49
|
+
content: "";
|
|
50
|
+
position: absolute;
|
|
51
|
+
inset-block-start: 0;
|
|
52
|
+
inset-inline: var(--modal-footer-padding-inline);
|
|
53
|
+
block-size: var(--modal-footer-border-width);
|
|
54
|
+
background-color: var(--modal-footer-color-border);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/lib/pattern/Modal/common/Footer/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "../../../../component/Button/index.js";
|
|
3
|
+
import { useModalContext } from "../../hooks/useModalContext.js";
|
|
4
|
+
import "./styles.css";
|
|
5
|
+
const componentCssClassName = "ds modal-header";
|
|
6
|
+
/**
|
|
7
|
+
* Modal.Header subcomponent
|
|
8
|
+
*
|
|
9
|
+
* Carries the modal title and the optional dismiss control. The title describes
|
|
10
|
+
* what the modal is for, giving the user context on what triggered it. Both the
|
|
11
|
+
* title id (which names the dialog) and the dismiss wiring come from the Modal
|
|
12
|
+
* context, so a composed header needs no props of its own.
|
|
13
|
+
*
|
|
14
|
+
* The title is not a heading element: headings structure the page's document
|
|
15
|
+
* outline, and a modal opens from anywhere in it, so no heading level would be
|
|
16
|
+
* right everywhere. The title names the dialog through `aria-labelledby`
|
|
17
|
+
* instead, which is what a screen reader announces when the modal opens.
|
|
18
|
+
*
|
|
19
|
+
* @implements ds:global.subcomponent.modal-header
|
|
20
|
+
*/
|
|
21
|
+
const Header = ({ children, titleId, undismissible = false, dismissLabel = "Close", onDismiss, className, ...props }) => {
|
|
22
|
+
const modal = useModalContext();
|
|
23
|
+
return (_jsxs("header", { className: [componentCssClassName, className].filter(Boolean).join(" "), ...props, children: [_jsx("span", { className: "title", id: titleId ?? modal.titleId, children: children }), !undismissible && (_jsx(Button, { className: "close", importance: "tertiary", icon: "close", "aria-label": dismissLabel, onClick: onDismiss ?? modal.onDismiss }))] }));
|
|
24
|
+
};
|
|
25
|
+
Header.displayName = "Modal.Header";
|
|
26
|
+
export default Header;
|
|
27
|
+
//# sourceMappingURL=Header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../../../../../src/lib/pattern/Modal/common/Header/Header.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,GAAG,CAAC,EACd,QAAQ,EACR,OAAO,EACP,aAAa,GAAG,KAAK,EACrB,YAAY,GAAG,OAAO,EACtB,SAAS,EACT,SAAS,EACT,GAAG,KAAK,EACI,EAAsB,EAAE;IACpC,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAEhC,OAAO,CACL,kBACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACnE,KAAK,aAET,eAAM,SAAS,EAAC,OAAO,EAAC,EAAE,EAAE,OAAO,IAAI,KAAK,CAAC,OAAO,YACjD,QAAQ,GACJ,EACN,CAAC,aAAa,IAAI,CACjB,KAAC,MAAM,IACL,SAAS,EAAC,OAAO,EACjB,UAAU,EAAC,UAAU,EACrB,IAAI,EAAC,OAAO,gBACA,YAAY,EACxB,OAAO,EAAE,SAAS,IAAI,KAAK,CAAC,SAAS,GACrC,CACH,IACM,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,WAAW,GAAG,cAAc,CAAC;AAEpC,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/lib/pattern/Modal/common/Header/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
|
|
2
|
+
|
|
3
|
+
@layer ds.components.global {
|
|
4
|
+
/**
|
|
5
|
+
* Modal.Header styles
|
|
6
|
+
* @implements ds:global.subcomponent.modal-header
|
|
7
|
+
*
|
|
8
|
+
* DSL anatomy mapping:
|
|
9
|
+
* - layout.type: flow, layout.direction: horizontal -> display: flex; flex-direction: row
|
|
10
|
+
* - layout.align: center -> align-items: center
|
|
11
|
+
* - layout.justify: space-between -> justify-content: space-between
|
|
12
|
+
* - spacing.internal: spacing/medium -> padding-block / padding-inline
|
|
13
|
+
* - appearance.border.bottom: border/style/divider -> an inset ::after rule,
|
|
14
|
+
* not a border (a border would span the full dialog width; the design insets
|
|
15
|
+
* the rule to the inline padding)
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/* Component tokens — sourced from @canonical/design-tokens */
|
|
19
|
+
:root {
|
|
20
|
+
/* The rules are quiet boundaries, not structural edges: `muted` is the
|
|
21
|
+
palest border token (gray-100 vs gray-520 for `--color-border`). */
|
|
22
|
+
--modal-header-color-border: var(--color-border-muted);
|
|
23
|
+
--modal-header-border-width: var(--dimension-stroke-thickness-medium);
|
|
24
|
+
--modal-header-padding-block: var(--dimension-200);
|
|
25
|
+
--modal-header-padding-inline: var(--modal-padding-inline);
|
|
26
|
+
--modal-header-gap: var(--dimension-200);
|
|
27
|
+
--modal-header-font-size: var(--typography-text-primary-font-size);
|
|
28
|
+
--modal-header-font-weight: var(--typography-weight-semiBold);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ds.modal-header {
|
|
32
|
+
/* layout.type: flow, direction horizontal, align center, justify space-between */
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: row;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: space-between;
|
|
37
|
+
gap: var(--modal-header-gap);
|
|
38
|
+
|
|
39
|
+
padding-block: var(--modal-header-padding-block);
|
|
40
|
+
padding-inline: var(--modal-header-padding-inline);
|
|
41
|
+
/* Never shrink: only the content pane gives way. */
|
|
42
|
+
flex: 0 0 auto;
|
|
43
|
+
/* Positions the inset rule below. */
|
|
44
|
+
position: relative;
|
|
45
|
+
|
|
46
|
+
/*
|
|
47
|
+
The first of the two horizontal rules bounding the content. Drawn as a
|
|
48
|
+
pseudo-element rather than a border so it can be inset to the inline padding
|
|
49
|
+
and align with the title, the content and the actions. A pseudo-element
|
|
50
|
+
belongs to this element for hit-testing, so a click on it targets the header
|
|
51
|
+
and never registers as a backdrop click on the dialog.
|
|
52
|
+
*/
|
|
53
|
+
&::after {
|
|
54
|
+
content: "";
|
|
55
|
+
position: absolute;
|
|
56
|
+
inset-block-end: 0;
|
|
57
|
+
inset-inline: var(--modal-header-padding-inline);
|
|
58
|
+
block-size: var(--modal-header-border-width);
|
|
59
|
+
background-color: var(--modal-header-color-border);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
> .title {
|
|
63
|
+
flex: 1;
|
|
64
|
+
font-size: var(--modal-header-font-size);
|
|
65
|
+
font-weight: var(--modal-header-font-weight);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
> .close {
|
|
69
|
+
flex: 0 0 auto;
|
|
70
|
+
/*
|
|
71
|
+
Button tightens padding-inline-start when it has an icon, which suits an
|
|
72
|
+
icon+label button but leaves an icon-only one lopsided (8px vs 16px).
|
|
73
|
+
Equalise both sides through Button's own custom-property API.
|
|
74
|
+
*/
|
|
75
|
+
--button-padding-inline-start: var(--dimension-100);
|
|
76
|
+
--button-padding-inline-end: var(--dimension-100);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/lib/pattern/Modal/common/Header/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/lib/pattern/Modal/common/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import Context from "../Context.js";
|
|
3
|
+
/** Reads the shared modal API. Throws if used outside a Modal. */
|
|
4
|
+
export const useModalContext = () => {
|
|
5
|
+
const value = useContext(Context);
|
|
6
|
+
if (!value) {
|
|
7
|
+
throw new Error("useModalContext must be used within a Modal.");
|
|
8
|
+
}
|
|
9
|
+
return value;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=useModalContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useModalContext.js","sourceRoot":"","sources":["../../../../../../src/lib/pattern/Modal/hooks/useModalContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,OAAO,MAAM,eAAe,CAAC;AAGpC,kEAAkE;AAClE,MAAM,CAAC,MAAM,eAAe,GAAG,GAAsB,EAAE;IACrD,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useCallback, useId } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The provider state threaded to the composed subcomponents: the id that names
|
|
4
|
+
* the dialog, and the dismissal that closes it. Centralising it here keeps the
|
|
5
|
+
* provider free of state logic.
|
|
6
|
+
*/
|
|
7
|
+
const useModalState = (dialogRef) => {
|
|
8
|
+
const titleId = useId();
|
|
9
|
+
const onDismiss = useCallback(() => {
|
|
10
|
+
dialogRef.current?.close();
|
|
11
|
+
}, [dialogRef]);
|
|
12
|
+
return { titleId, onDismiss };
|
|
13
|
+
};
|
|
14
|
+
export default useModalState;
|
|
15
|
+
//# sourceMappingURL=useModalState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useModalState.js","sourceRoot":"","sources":["../../../../../../src/lib/pattern/Modal/hooks/useModalState.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAG3C;;;;GAIG;AACH,MAAM,aAAa,GAAG,CACpB,SAA8C,EAC3B,EAAE;IACrB,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;QACjC,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IAC7B,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAChB,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AAChC,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/pattern/Modal/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
|
|
2
|
+
|
|
3
|
+
@layer ds.components.global {
|
|
4
|
+
/**
|
|
5
|
+
* Modal styles
|
|
6
|
+
* @implements ds:global.pattern.modal
|
|
7
|
+
*
|
|
8
|
+
* DSL anatomy mapping:
|
|
9
|
+
* - edges[0] backdrop -> ::backdrop (painted by the native top layer, no DOM node)
|
|
10
|
+
* - edges[1] dialog container -> the <dialog> element itself
|
|
11
|
+
* - layout.type: stack, direction vertical -> display: flex; flex-direction: column
|
|
12
|
+
* - layout.overflow: hidden -> overflow: hidden
|
|
13
|
+
* - appearance.background: color/surface/overlay -> --surface-color-background,
|
|
14
|
+
* supplied by the `.modal` surface class in @canonical/design-tokens'
|
|
15
|
+
* modifiers.surfaces.css. That class is matched by this component's own
|
|
16
|
+
* `ds modal` className, so renaming the component class would silently drop
|
|
17
|
+
* the surface reset and the modal would inherit the page's layer depth.
|
|
18
|
+
*
|
|
19
|
+
* - appearance.radius: radius/modal -> --modal-border-radius
|
|
20
|
+
* - appearance.shadow: shadow/overlay -> no shadow token exists at
|
|
21
|
+
* design-tokens 0.8.1, and the design shows no outline on the panel, so the
|
|
22
|
+
* overlay alone separates the modal from the page
|
|
23
|
+
* - size.max.width / size.max.height -> --modal-max-inline-size / --modal-max-block-size
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/* Component tokens — sourced from @canonical/design-tokens */
|
|
27
|
+
:root {
|
|
28
|
+
/*
|
|
29
|
+
The panel's own colours are not component tokens: they come from the surface
|
|
30
|
+
channels read on the element itself (see `.ds.modal` below). The backdrop is,
|
|
31
|
+
because `::backdrop` has no surface channel to read.
|
|
32
|
+
*/
|
|
33
|
+
--modal-color-backdrop: var(--color-backdrop);
|
|
34
|
+
--modal-backdrop-blur: 0;
|
|
35
|
+
--modal-border-radius: var(--dimension-radius-medium);
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
One inline padding shared by the header, content and footer, so the title,
|
|
39
|
+
the horizontal rules, the content and the actions all align on the same two
|
|
40
|
+
edges — as in the design. The parts read it directly: the sections are only
|
|
41
|
+
ever composed inside this modal, which is where the token is defined.
|
|
42
|
+
*/
|
|
43
|
+
--modal-padding-inline: var(--dimension-300);
|
|
44
|
+
|
|
45
|
+
/*
|
|
46
|
+
design-tokens 0.8.1 ships no `size/modal/*` token, so these two are literals
|
|
47
|
+
rather than token references. They are the documented override point:
|
|
48
|
+
`<Modal style={{ "--modal-max-inline-size": "30rem" }} />`.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
--modal-min-inline-size: 50ch;
|
|
52
|
+
--modal-max-inline-size: 130ch;
|
|
53
|
+
|
|
54
|
+
--modal-inline-size: clamp(
|
|
55
|
+
var(--modal-min-inline-size),
|
|
56
|
+
30vw,
|
|
57
|
+
var(--modal-max-inline-size)
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
--modal-max-block-size: 80vh;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ds.modal {
|
|
64
|
+
/*
|
|
65
|
+
Padding stays on the header/content/footer, never here, so that a click
|
|
66
|
+
landing on the dialog box itself can only be a backdrop click.
|
|
67
|
+
*/
|
|
68
|
+
padding: 0;
|
|
69
|
+
/* layout.overflow: hidden — the content pane is the only scroller */
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
|
|
72
|
+
inline-size: var(--modal-inline-size);
|
|
73
|
+
|
|
74
|
+
max-block-size: var(--modal-max-block-size);
|
|
75
|
+
|
|
76
|
+
/*
|
|
77
|
+
Read the surface channels on the element itself. The token layer defines a
|
|
78
|
+
`.modal` surface (identical to top-level `.surface`), matched by this
|
|
79
|
+
component's own `ds modal` className, so the dialog paints at base surface
|
|
80
|
+
depth even when opened from a nested `.surface` — which is the DSL's
|
|
81
|
+
`color/surface/overlay`.
|
|
82
|
+
|
|
83
|
+
The background channel is always emitted on the `.modal` surface, so it is
|
|
84
|
+
read bare. The text channel is different: the surface family emits
|
|
85
|
+
`--surface-color-text` only on polarity-inverting (contrasted) surfaces —
|
|
86
|
+
a same-polarity surface like `.modal` deliberately emits none, and the
|
|
87
|
+
documented consumption is `var(--surface-color-text, var(--color-text))`,
|
|
88
|
+
which falls through to the ambient page text.
|
|
89
|
+
*/
|
|
90
|
+
color: var(--surface-color-text, var(--color-text));
|
|
91
|
+
background-color: var(--surface-color-background);
|
|
92
|
+
|
|
93
|
+
/*
|
|
94
|
+
The user-agent stylesheet gives <dialog> `border: solid` (medium width, ~3px)
|
|
95
|
+
and `padding: 1em`, so both must be reset explicitly rather than merely left
|
|
96
|
+
undeclared. The design shows no outline on the panel — the overlay separates
|
|
97
|
+
it from the page.
|
|
98
|
+
*/
|
|
99
|
+
border: none;
|
|
100
|
+
border-radius: var(--modal-border-radius);
|
|
101
|
+
|
|
102
|
+
/*
|
|
103
|
+
A closed <dialog> is `display: none` by user-agent rule. Declaring display
|
|
104
|
+
unconditionally here would beat that and leave the modal permanently
|
|
105
|
+
visible, so the stack layout is scoped to the open state.
|
|
106
|
+
*/
|
|
107
|
+
&[open] {
|
|
108
|
+
/* layout.type: stack, layout.direction: vertical */
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-direction: column;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* edges[0]: backdrop — mutes the page while the modal is active */
|
|
114
|
+
&::backdrop {
|
|
115
|
+
background-color: var(--modal-color-backdrop);
|
|
116
|
+
backdrop-filter: blur(var(--modal-backdrop-blur));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/lib/pattern/Modal/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Wraps a trigger with a modal. Click the trigger → the modal opens.
|
|
5
|
+
*
|
|
6
|
+
* **The wrapped component must accept `onClick`** and forward it to the
|
|
7
|
+
* clickable element at its root — the HOC composes its open handler onto the
|
|
8
|
+
* trigger itself, with no wrapper element in between. An `onClick` the
|
|
9
|
+
* consumer passes keeps working: it runs first, then the modal opens.
|
|
10
|
+
*
|
|
11
|
+
* The second argument is a function: the HOC calls it with a props object
|
|
12
|
+
* carrying `close` and `ref`, and it returns a complete `<Modal>` element —
|
|
13
|
+
* sections, props and all:
|
|
14
|
+
*
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const OpenButton = withModal(
|
|
17
|
+
* Button,
|
|
18
|
+
* ({ ref }) => (
|
|
19
|
+
* <Modal ref={ref}>
|
|
20
|
+
* <Modal.Content>Hello</Modal.Content>
|
|
21
|
+
* </Modal>
|
|
22
|
+
* ),
|
|
23
|
+
* );
|
|
24
|
+
* <OpenButton>Open</OpenButton>;
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* Everything `Modal` accepts lives on the element the function returns —
|
|
28
|
+
* `closeOnBackdropClick`, `aria-label`, `className` — so the consumer sees the
|
|
29
|
+
* real modal, not an options bag. **One duty comes with that freedom: the
|
|
30
|
+
* factory must attach the `ref` it receives to the `<Modal>`** (`<Modal
|
|
31
|
+
* ref={ref}>`). The trigger opens the dialog through that ref — and `Modal`
|
|
32
|
+
* requires its `ref`, so a factory that forgets it fails to compile.
|
|
33
|
+
*
|
|
34
|
+
* **How it closes:** the header's X button and Escape always work. Add
|
|
35
|
+
* `closeOnBackdropClick` to the modal element and a backdrop click works too.
|
|
36
|
+
*
|
|
37
|
+
* **Footer buttons can only close the modal.** That is the one and only
|
|
38
|
+
* action this HOC provides — wire one to the `close` the function receives:
|
|
39
|
+
*
|
|
40
|
+
* ```tsx
|
|
41
|
+
* const confirmationModal: WithModalRender = ({ close, ref }) => (
|
|
42
|
+
* <Modal ref={ref}>
|
|
43
|
+
* <Modal.Footer>
|
|
44
|
+
* <Button onClick={close}>Got it</Button>
|
|
45
|
+
* </Modal.Footer>
|
|
46
|
+
* </Modal>
|
|
47
|
+
* );
|
|
48
|
+
*
|
|
49
|
+
* const OpenButton = withModal(Button, confirmationModal);
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* If an action needs to do more than close — save data, open another modal,
|
|
53
|
+
* close conditionally — don't use this HOC: compose `Modal` directly and drive
|
|
54
|
+
* it through its `ref`.
|
|
55
|
+
*
|
|
56
|
+
* `withModal` is meant for static content and belongs at module scope, called
|
|
57
|
+
* once. The function it is handed is invoked on every render of the trigger,
|
|
58
|
+
* but at module scope it can only see module-level values, so what it returns
|
|
59
|
+
* is the same on every render. If the modal must show data from the parent —
|
|
60
|
+
* for example a different `userId` depending on which user is selected —
|
|
61
|
+
* don't call this HOC inside the component; compose `Modal` directly and
|
|
62
|
+
* drive it through its `ref`.
|
|
63
|
+
*
|
|
64
|
+
* A pure composition wrapper: it renders the wrapped component and the modal
|
|
65
|
+
* as siblings, so it carries no root element of its own.
|
|
66
|
+
*
|
|
67
|
+
* `import { withModal } from "@canonical/react-ds-global";`
|
|
68
|
+
*
|
|
69
|
+
* @param Component The trigger component to wrap (e.g. `Button`). It must accept `onClick` and forward it to its root element; clicking it opens the modal.
|
|
70
|
+
* @param modal A {@link WithModalRender} function: it receives `{ close, ref }`, must attach `ref` to the `<Modal>` it returns, and the trigger opens it.
|
|
71
|
+
*/
|
|
72
|
+
const withModal = (Component, modal) => {
|
|
73
|
+
const WrappedComponent = (props) => {
|
|
74
|
+
// The modal owns its open state, so the HOC only needs a handle on the
|
|
75
|
+
// dialog to open it from the trigger and to hand `close` to the content.
|
|
76
|
+
const dialogRef = useRef(null);
|
|
77
|
+
// showModal() throws on an already-open dialog. The open modal makes the
|
|
78
|
+
// page inert, so a second trigger click should be impossible — but the
|
|
79
|
+
// guard costs nothing and a thrown error would cost the whole render.
|
|
80
|
+
const open = () => {
|
|
81
|
+
const dialog = dialogRef.current;
|
|
82
|
+
if (dialog && !dialog.open)
|
|
83
|
+
dialog.showModal();
|
|
84
|
+
};
|
|
85
|
+
const close = () => dialogRef.current?.close();
|
|
86
|
+
// The contract: the HOC hands the factory its own ref, and the factory
|
|
87
|
+
// sets it on the `<Modal>` it returns. `Modal` requires its `ref`, so a
|
|
88
|
+
// factory that forgets `ref={ref}` fails to compile.
|
|
89
|
+
const modalElement = modal({ close, ref: dialogRef });
|
|
90
|
+
return (_jsxs(_Fragment, { children: [_jsx(Component, { ...props, onClick: (event) => {
|
|
91
|
+
// The consumer's handler runs first, then the modal opens; a
|
|
92
|
+
// preventDefault or stopPropagation there does not gate the open.
|
|
93
|
+
props.onClick?.(event);
|
|
94
|
+
open();
|
|
95
|
+
} }), modalElement] }));
|
|
96
|
+
};
|
|
97
|
+
// Set the displayName for easier debugging
|
|
98
|
+
WrappedComponent.displayName = `withModal(${Component.displayName || Component.name || "AnonymousComponent"})`;
|
|
99
|
+
return WrappedComponent;
|
|
100
|
+
};
|
|
101
|
+
export default withModal;
|
|
102
|
+
//# sourceMappingURL=withModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withModal.js","sourceRoot":"","sources":["../../../../../src/lib/pattern/Modal/withModal.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,MAAM,SAAS,GAAG,CAChB,SAAgC,EAChC,KAAsB,EACC,EAAE;IACzB,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAgB,EAAE;QACvD,uEAAuE;QACvE,yEAAyE;QACzE,MAAM,SAAS,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;QAClD,yEAAyE;QACzE,uEAAuE;QACvE,sEAAsE;QACtE,MAAM,IAAI,GAAG,GAAS,EAAE;YACtB,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC;YACjC,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI;gBAAE,MAAM,CAAC,SAAS,EAAE,CAAC;QACjD,CAAC,CAAC;QACF,MAAM,KAAK,GAAG,GAAS,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;QAErD,uEAAuE;QACvE,wEAAwE;QACxE,qDAAqD;QACrD,MAAM,YAAY,GAAG,KAAK,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;QAEtD,OAAO,CACL,8BACE,KAAC,SAAS,OACJ,KAAK,EACT,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;wBACjB,6DAA6D;wBAC7D,kEAAkE;wBAClE,KAAK,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;wBACvB,IAAI,EAAE,CAAC;oBACT,CAAC,GACD,EACD,YAAY,IACZ,CACJ,CAAC;IACJ,CAAC,CAAC;IAEF,2CAA2C;IAC3C,gBAAgB,CAAC,WAAW,GAAG,aAC7B,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,oBAC7C,GAAG,CAAC;IAEJ,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
/* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
|
|
2
|
+
|
|
3
|
+
@layer ds.components.global {
|
|
4
|
+
/**
|
|
5
|
+
* Timeline.Content styles
|
|
6
|
+
* @implements ds:global.subcomponent.timeline-content
|
|
7
|
+
*
|
|
8
|
+
* DSL anatomy mapping:
|
|
9
|
+
* - layout.type: stack -> display: flex; flex-direction: column
|
|
10
|
+
* - layout.direction: vertical -> flex-direction: column
|
|
11
|
+
*/
|
|
12
|
+
.ds.timeline-content {
|
|
13
|
+
/* layout.type: stack, layout.direction: vertical */
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
}
|
|
13
17
|
}
|