@gtivr4/a1-design-system-react 0.11.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
CHANGED
|
@@ -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;
|