@gtivr4/a1-design-system-react 0.10.0 → 0.12.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/package.json +1 -1
- package/src/components/definition-list/DefinitionList.jsx +7 -4
- package/src/components/definition-list/definition-list.css +4 -3
- package/src/components/sticky-actions/StickyActions.d.ts +14 -0
- package/src/components/sticky-actions/StickyActions.jsx +20 -0
- package/src/components/sticky-actions/sticky-actions.css +29 -0
- package/src/index.js +1 -0
- package/src/tokens.css +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Children, isValidElement, useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
import { Button } from "../button/Button.jsx";
|
|
2
3
|
import { Heading } from "../heading/Heading.jsx";
|
|
3
|
-
import { IconButton } from "../icon-button/IconButton.jsx";
|
|
4
4
|
import "./definition-list.css";
|
|
5
5
|
|
|
6
6
|
const directions = ["row", "column"];
|
|
@@ -86,13 +86,16 @@ function DefinitionCopyButton({ text, label = "Copy value", copiedLabel = "Copie
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
return (
|
|
89
|
-
<
|
|
89
|
+
<Button
|
|
90
90
|
className="a1-definition-list__copy"
|
|
91
91
|
icon={copied ? "check" : "content_copy"}
|
|
92
|
-
label={copied ? copiedLabel : label}
|
|
93
92
|
onClick={handleCopy}
|
|
93
|
+
size="sm"
|
|
94
|
+
type="button"
|
|
94
95
|
variant="tertiary"
|
|
95
|
-
|
|
96
|
+
>
|
|
97
|
+
{copied ? copiedLabel : label}
|
|
98
|
+
</Button>
|
|
96
99
|
);
|
|
97
100
|
}
|
|
98
101
|
|
|
@@ -52,7 +52,8 @@
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
.a1-definition-list__copy {
|
|
55
|
-
|
|
55
|
+
flex: 0 0 auto;
|
|
56
|
+
margin-block-start: calc((1lh - var(--component-button-small-height)) / 2);
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
.a1-definition-list--column {
|
|
@@ -99,10 +100,10 @@
|
|
|
99
100
|
}
|
|
100
101
|
|
|
101
102
|
.a1-definition-list__value-content {
|
|
102
|
-
flex:
|
|
103
|
+
flex: 0 1 auto;
|
|
103
104
|
}
|
|
104
105
|
|
|
105
|
-
@container (max-width:
|
|
106
|
+
@container (max-width: 240px) {
|
|
106
107
|
.a1-definition-list--row .a1-definition-list__item {
|
|
107
108
|
display: flex;
|
|
108
109
|
flex-direction: column;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode, HTMLAttributes } from "react";
|
|
2
|
+
|
|
3
|
+
export interface StickyActionsProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
4
|
+
/**
|
|
5
|
+
* Constrains the inner content to the same max-widths as Section's contentWidth prop.
|
|
6
|
+
* Match this to the contentWidth of the Section above so buttons align with page content.
|
|
7
|
+
* "xs" = 28.5rem · "sm" = 40rem · "md" = 50rem · "lg" = 60rem · "xl" = 70rem · "2xl" = 90rem
|
|
8
|
+
*/
|
|
9
|
+
contentWidth?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
10
|
+
className?: string;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export declare function StickyActions(props: StickyActionsProps): JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "./sticky-actions.css";
|
|
2
|
+
|
|
3
|
+
const VALID_CONTENT_WIDTHS = ["xs", "sm", "md", "lg", "xl", "2xl"];
|
|
4
|
+
|
|
5
|
+
export function StickyActions({ contentWidth, className = "", children, ...props }) {
|
|
6
|
+
const resolvedWidth = VALID_CONTENT_WIDTHS.includes(contentWidth) ? contentWidth : null;
|
|
7
|
+
|
|
8
|
+
const innerClass = [
|
|
9
|
+
"a1-sticky-actions__inner",
|
|
10
|
+
resolvedWidth && `a1-sticky-actions__inner--${resolvedWidth}`,
|
|
11
|
+
].filter(Boolean).join(" ");
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div className={["a1-sticky-actions", className].filter(Boolean).join(" ")} {...props}>
|
|
15
|
+
<div className={innerClass}>
|
|
16
|
+
{children}
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.a1-sticky-actions {
|
|
2
|
+
position: fixed;
|
|
3
|
+
inset-block-end: 0;
|
|
4
|
+
inset-inline: 0;
|
|
5
|
+
z-index: var(--component-sticky-actions-z-index);
|
|
6
|
+
background: var(--component-sticky-actions-background);
|
|
7
|
+
border-block-start: var(--component-sticky-actions-border-width) solid var(--semantic-color-border-subtle);
|
|
8
|
+
padding-block-start: var(--component-sticky-actions-padding-block);
|
|
9
|
+
padding-block-end: calc(var(--component-sticky-actions-padding-block) + env(safe-area-inset-bottom, 0px));
|
|
10
|
+
padding-inline: var(--component-sticky-actions-padding-inline);
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.a1-sticky-actions__inner {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: var(--component-sticky-actions-gap);
|
|
18
|
+
width: 100%;
|
|
19
|
+
margin-inline: auto;
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* Content width — mirrors Section's contentWidth values for visual alignment */
|
|
24
|
+
.a1-sticky-actions__inner--xs { max-width: 28.5rem; }
|
|
25
|
+
.a1-sticky-actions__inner--sm { max-width: 40rem; }
|
|
26
|
+
.a1-sticky-actions__inner--md { max-width: 50rem; }
|
|
27
|
+
.a1-sticky-actions__inner--lg { max-width: 60rem; }
|
|
28
|
+
.a1-sticky-actions__inner--xl { max-width: 70rem; }
|
|
29
|
+
.a1-sticky-actions__inner--2xl { max-width: 90rem; }
|
package/src/index.js
CHANGED
|
@@ -60,3 +60,4 @@ export { DataTable } from "./components/data-table/DataTable.jsx";
|
|
|
60
60
|
export { DataTableFilters } from "./components/data-table/DataTableFilters.jsx";
|
|
61
61
|
export { Figure } from "./components/figure/Figure.jsx";
|
|
62
62
|
export { Spacer } from "./components/spacer/Spacer.jsx";
|
|
63
|
+
export { StickyActions } from "./components/sticky-actions/StickyActions.jsx";
|
package/src/tokens.css
CHANGED
|
@@ -693,6 +693,12 @@
|
|
|
693
693
|
--component-step-tracker-active-width: 2rem;
|
|
694
694
|
--component-step-tracker-active-color: #060b14;
|
|
695
695
|
--component-step-tracker-gap: 0.375rem;
|
|
696
|
+
--component-sticky-actions-background: #ffffff;
|
|
697
|
+
--component-sticky-actions-border-width: 1px;
|
|
698
|
+
--component-sticky-actions-padding-block: 1rem;
|
|
699
|
+
--component-sticky-actions-padding-inline: 1rem;
|
|
700
|
+
--component-sticky-actions-gap: 0.75rem;
|
|
701
|
+
--component-sticky-actions-z-index: 150;
|
|
696
702
|
--component-switch-track-width: 2.5rem;
|
|
697
703
|
--component-switch-track-height: 1.375rem;
|
|
698
704
|
--component-switch-thumb-size: 1rem;
|