@aivenio/aquarium 1.24.0 → 1.25.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/dist/_variables.scss +1 -1
- package/dist/_variables_timescale.scss +1 -1
- package/dist/atoms.cjs +2 -3
- package/dist/atoms.mjs +2 -3
- package/dist/src/atoms/Alert/Alert.d.ts +2 -2
- package/dist/src/atoms/Banner/Banner.d.ts +6 -6
- package/dist/src/atoms/Card/Card.d.ts +6 -6
- package/dist/src/atoms/Card/Card.js +1 -1
- package/dist/src/atoms/Checkbox/Checkbox.d.ts +1 -1
- package/dist/src/atoms/DataList/DataList.js +2 -2
- package/dist/src/atoms/Dialog/Dialog.d.ts +1 -1
- package/dist/src/atoms/DropdownMenu/DropdownMenu.d.ts +5 -5
- package/dist/src/atoms/Modal/Modal.d.ts +3 -3
- package/dist/src/atoms/Navigation/Navigation.d.ts +1 -1
- package/dist/src/atoms/PageHeader/PageHeader.d.ts +4 -2
- package/dist/src/atoms/PageHeader/PageHeader.js +3 -3
- package/dist/src/atoms/ProgressBar/ProgressBar.d.ts +2 -2
- package/dist/src/atoms/ProgressBar/ProgressBar.js +2 -2
- package/dist/src/atoms/RadioButton/RadioButton.d.ts +1 -1
- package/dist/src/atoms/Section/Section.d.ts +1 -1
- package/dist/src/atoms/Select/Select.d.ts +23 -23
- package/dist/src/atoms/Select/Select.js +3 -3
- package/dist/src/atoms/Stepper/Stepper.d.ts +2 -2
- package/dist/src/atoms/Switch/Switch.d.ts +1 -1
- package/dist/src/atoms/Table/Table.d.ts +4 -4
- package/dist/src/atoms/Table/Table.js +2 -2
- package/dist/src/atoms/Toast/Toast.d.ts +1 -1
- package/dist/src/atoms/Typography/Typography.d.ts +1 -1
- package/dist/src/atoms/Typography/Typography.js +7 -5
- package/dist/src/charts/BarChart/BarChart.d.ts +2 -2
- package/dist/src/charts/lib/utils.d.ts +1 -1
- package/dist/src/js/resolveTheme.d.ts +4 -2
- package/dist/src/molecules/Alert/Alert.d.ts +2 -1
- package/dist/src/molecules/Alert/Alert.js +1 -1
- package/dist/src/molecules/Badge/Badge.d.ts +2 -2
- package/dist/src/molecules/Banner/Banner.d.ts +2 -1
- package/dist/src/molecules/Banner/Banner.js +1 -1
- package/dist/src/molecules/Box/Box.d.ts +17 -17
- package/dist/src/molecules/Breadcrumbs/Breadcrumbs.d.ts +3 -3
- package/dist/src/molecules/Breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/src/molecules/Button/Button.d.ts +8 -8
- package/dist/src/molecules/Button/Button.js +4 -4
- package/dist/src/molecules/Card/Card.d.ts +11 -10
- package/dist/src/molecules/Card/Card.js +5 -3
- package/dist/src/molecules/Card/Compact.d.ts +2 -2
- package/dist/src/molecules/Card/Compact.js +5 -3
- package/dist/src/molecules/Carousel/Carousel.js +20 -12
- package/dist/src/molecules/Chip/Chip.d.ts +3 -3
- package/dist/src/molecules/Combobox/Combobox.d.ts +4 -4
- package/dist/src/molecules/Combobox/Combobox.js +1 -1
- package/dist/src/molecules/ControlLabel/ControlLabel.d.ts +1 -1
- package/dist/src/molecules/DataList/DataList.d.ts +2 -2
- package/dist/src/molecules/DataTable/DataTable.d.ts +2 -2
- package/dist/src/molecules/Dialog/Dialog.js +8 -6
- package/dist/src/molecules/Dropdown/Dropdown.d.ts +1 -1
- package/dist/src/molecules/Dropdown/Dropdown.js +3 -3
- package/dist/src/molecules/DropdownMenu/DropdownMenu.d.ts +6 -6
- package/dist/src/molecules/Element/Element.d.ts +2 -2
- package/dist/src/molecules/EmptyState/EmptyState.d.ts +1 -1
- package/dist/src/molecules/Flexbox/Flexbox.d.ts +7 -7
- package/dist/src/molecules/Flexbox/FlexboxItem.d.ts +7 -7
- package/dist/src/molecules/Grid/Grid.d.ts +7 -7
- package/dist/src/molecules/Grid/GridItem.d.ts +7 -7
- package/dist/src/molecules/Input/Input.js +7 -5
- package/dist/src/molecules/LineClamp/LineClamp.d.ts +15 -15
- package/dist/src/molecules/ListItem/ListItem.js +4 -4
- package/dist/src/molecules/Modal/Modal.js +8 -6
- package/dist/src/molecules/MultiInput/InputChip.d.ts +2 -2
- package/dist/src/molecules/MultiInput/InputChip.js +2 -2
- package/dist/src/molecules/MultiInput/MultiInput.d.ts +5 -5
- package/dist/src/molecules/MultiInput/MultiInput.js +9 -5
- package/dist/src/molecules/MultiSelect/MultiSelect.d.ts +4 -4
- package/dist/src/molecules/MultiSelect/MultiSelect.js +6 -4
- package/dist/src/molecules/NativeSelect/NativeSelect.js +12 -8
- package/dist/src/molecules/Navigation/Navigation.d.ts +2 -2
- package/dist/src/molecules/PageHeader/PageHeader.d.ts +44 -8
- package/dist/src/molecules/PageHeader/PageHeader.js +18 -6
- package/dist/src/molecules/Pagination/usePagination.d.ts +1 -1
- package/dist/src/molecules/Pagination/usePagination.js +1 -1
- package/dist/src/molecules/Popover/Popover.d.ts +2 -2
- package/dist/src/molecules/Popover/Popover.js +1 -1
- package/dist/src/molecules/PopoverDialog/PopoverDialog.d.ts +1 -1
- package/dist/src/molecules/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/src/molecules/RadioButtonGroup/RadioButtonGroup.d.ts +4 -3
- package/dist/src/molecules/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/dist/src/molecules/Section/Section.d.ts +1 -1
- package/dist/src/molecules/SegmentedControl/SegmentedControl.d.ts +3 -3
- package/dist/src/molecules/SegmentedControl/SegmentedControl.js +2 -2
- package/dist/src/molecules/Select/Select.d.ts +2 -2
- package/dist/src/molecules/Select/Select.js +5 -3
- package/dist/src/molecules/Stepper/Stepper.d.ts +1 -1
- package/dist/src/molecules/Switch/Switch.d.ts +1 -1
- package/dist/src/molecules/Tabs/Tabs.d.ts +13 -9
- package/dist/src/molecules/Tabs/Tabs.js +26 -17
- package/dist/src/molecules/TagLabel/TagLabel.d.ts +1 -1
- package/dist/src/molecules/Tailwindify/Tailwindify.d.ts +5 -5
- package/dist/src/molecules/Tailwindify/Tailwindify.js +7 -4
- package/dist/src/molecules/Template/Template.d.ts +1 -1
- package/dist/src/molecules/Textarea/Textarea.d.ts +3 -3
- package/dist/src/molecules/Timeline/Timeline.d.ts +3 -3
- package/dist/src/molecules/Toast/Toast.spec.js +2 -2
- package/dist/src/molecules/Toast/types.d.ts +5 -5
- package/dist/src/molecules/Toast/types.js +1 -1
- package/dist/src/molecules/Tooltip/Tooltip.d.ts +1 -1
- package/dist/src/molecules/Tooltip/Tooltip.js +5 -3
- package/dist/src/molecules/Tooltip/useTooltipTriggerState.js +9 -5
- package/dist/src/molecules/Typography/Typography.d.ts +4 -4
- package/dist/src/molecules/Typography/Typography.js +9 -9
- package/dist/src/molecules/index.d.ts +2 -2
- package/dist/src/system.js +9 -5
- package/dist/src/utils/form/FormControl/FormControl.js +2 -2
- package/dist/src/utils/form/HelperText/HelperText.js +4 -4
- package/dist/src/utils/form/InputAdornment/InputAdornment.js +6 -6
- package/dist/src/utils/form/Label/Label.d.ts +3 -3
- package/dist/src/utils/form/Label/Label.js +12 -10
- package/dist/src/utils/object.d.ts +1 -1
- package/dist/src/utils/positioner.d.ts +1 -1
- package/dist/src/utils/table/types.d.ts +9 -9
- package/dist/src/utils/table/useTableSort.d.ts +1 -1
- package/dist/src/utils/table/utils.d.ts +1 -1
- package/dist/src/utils/tailwind.js +6 -4
- package/dist/src/utils/themeVariableSamples.d.ts +2 -0
- package/dist/src/utils/themeVariableSamples.js +146 -0
- package/dist/src/utils/useStyle.d.ts +3 -3
- package/dist/src/utils/useStyle.js +30 -22
- package/dist/system.cjs +47 -14
- package/dist/system.mjs +47 -14
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/DimensionProps.d.ts +1 -1
- package/dist/types/designTokens.d.ts +2 -2
- package/dist/types/designTokens.js +6 -4
- package/dist/types/tailwind.d.ts +1 -1
- package/dist/types/utils.d.ts +5 -5
- package/package.json +11 -13
@@ -0,0 +1,2 @@
|
|
1
|
+
export declare const sampleCustomVariables = "\n:root {\n --aquarium-colors-primary-100: #5a40e2;\n --aquarium-colors-primary-90: #6447fb;\n --aquarium-colors-primary-80: #7459fb;\n --aquarium-colors-primary-70: #836cfc;\n --aquarium-colors-primary-60: #937efc;\n --aquarium-colors-primary-50: #a291fd;\n --aquarium-colors-primary-40: #b2a3fd;\n --aquarium-colors-primary-30: #c1b5fd;\n --aquarium-colors-primary-20: #d1c8fe;\n --aquarium-colors-primary-10: #e0dafe;\n --aquarium-colors-primary-5: #f0edff;\n .Aquarium-Button {\n --aquarium-border-radius-sm: 1.5rem;\n --aquarium-colors-primary-80: #000000;\n }\n}\n";
|
2
|
+
export declare const timescaleDBCustomVariables = "\n:root {\n --aquarium-colors-primary-100: #6447fb;\n --aquarium-colors-primary-90: #6447fb;\n --aquarium-colors-primary-80: #6447fb;\n --aquarium-colors-primary-70: #b0c0fb;\n --aquarium-colors-primary-60: #c8d3fd;\n --aquarium-colors-primary-50: #d0d9fd;\n --aquarium-colors-primary-40: #d7dffc;\n --aquarium-colors-primary-30: #dfe6fd;\n --aquarium-colors-primary-20: #e8edfe;\n --aquarium-colors-primary-10: #eff2fe;\n --aquarium-colors-primary-5: #f8f9ff;\n --aquarium-colors-primary-0: #f8f9ff;\n --aquarium-colors-grey-100: #000;\n --aquarium-colors-grey-90: #000;\n --aquarium-colors-grey-80: #444;\n --aquarium-colors-grey-70: #444;\n --aquarium-colors-grey-60: #6a6a6a;\n --aquarium-colors-grey-50: #7e7e7e;\n --aquarium-colors-grey-40: #939393;\n --aquarium-colors-grey-30: #a5a5a5;\n --aquarium-colors-grey-20: #bdbdbd;\n --aquarium-colors-grey-10: #ebebeb;\n --aquarium-colors-grey-5: #ebebeb;\n --aquarium-colors-grey-0: #f8f8f8;\n}\n\n.Aquarium-Button {\n font-weight: 600;\n border-radius: 24px;\n}\n\n.Aquarium-Button.Primary {\n color: var(--aquarium-colors-white);\n background-color: var(--aquarium-colors-grey-100);\n\n &:hover {\n background-color: var(--aquarium-colors-grey-80);\n }\n\n &:active {\n background-color: var(--aquarium-colors-grey-70);\n }\n\n &:disabled {\n color: var(--aquarium-colors-grey-20);\n background-color: var(--aquarium-colors-grey-5);\n }\n}\n\n.Aquarium-Button.Secondary {\n color: var(--aquarium-colors-grey-100);\n background-color: var(--aquarium-colors-white);\n border: 1.5px solid var(--aquarium-colors-grey-100);\n box-shadow: none;\n\n &:hover {\n color: var(--aquarium-colors-grey-100);\n background-color: var(--aquarium-colors-primary-10);\n }\n\n &:active {\n color: var(--aquarium-colors-grey-100);\n background-color: var(--aquarium-colors-primary-20);\n }\n\n &:focus-visible {\n color: var(--aquarium-colors-grey-100);\n box-shadow: none;\n }\n\n &:disabled {\n color: var(--aquarium-colors-grey-20);\n background-color: var(--aquarium-colors-white);\n border-color: var(--aquarium-colors-grey-20);\n\n &:hover {\n background-color: var(--aquarium-colors-white);\n }\n }\n}\n\n.Aquarium-Button.Ghost {\n padding: var(--aquarium-spacing-2) var(--aquarium-spacing-3);\n\n &.Aquarium-Dense {\n padding: var(--aquarium-spacing-2) var(--aquarium-spacing-2);\n }\n\n &:hover {\n color: var(--aquarium-colors-primary-90);\n background-color: var(--aquarium-colors-primary-10);\n }\n\n &:active {\n background-color: var(--aquarium-colors-primary-20);\n }\n\n &:disabled {\n color: var(--aquarium-colors-grey-20);\n\n &:hover {\n background-color: var(--aquarium-colors-transparent);\n }\n }\n}\n\n.Aquarium-Modal > [aria-modal*='true'],\n.Aquarium-Dialog > [aria-modal*='true'],\n.Aquarium-EmptyState {\n border-radius: 16px;\n}\n\n.Aquarium-Modal > [aria-modal*='true'] {\n overflow: hidden;\n}\n";
|
@@ -0,0 +1,146 @@
|
|
1
|
+
export const sampleCustomVariables = `
|
2
|
+
:root {
|
3
|
+
--aquarium-colors-primary-100: #5a40e2;
|
4
|
+
--aquarium-colors-primary-90: #6447fb;
|
5
|
+
--aquarium-colors-primary-80: #7459fb;
|
6
|
+
--aquarium-colors-primary-70: #836cfc;
|
7
|
+
--aquarium-colors-primary-60: #937efc;
|
8
|
+
--aquarium-colors-primary-50: #a291fd;
|
9
|
+
--aquarium-colors-primary-40: #b2a3fd;
|
10
|
+
--aquarium-colors-primary-30: #c1b5fd;
|
11
|
+
--aquarium-colors-primary-20: #d1c8fe;
|
12
|
+
--aquarium-colors-primary-10: #e0dafe;
|
13
|
+
--aquarium-colors-primary-5: #f0edff;
|
14
|
+
.Aquarium-Button {
|
15
|
+
--aquarium-border-radius-sm: 1.5rem;
|
16
|
+
--aquarium-colors-primary-80: #000000;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
`;
|
20
|
+
/*
|
21
|
+
* Since we can't comment in the constant value below, it causes css not being applied properly.
|
22
|
+
* So adding the comment about the image modal here.
|
23
|
+
*
|
24
|
+
* We need to set overflow: hidden so corner rounding works as it should
|
25
|
+
* when a header image is used with modals.
|
26
|
+
* .Aquarium-Modal > [aria-modal*='true'] { overflow: hidden; }
|
27
|
+
*/
|
28
|
+
export const timescaleDBCustomVariables = `
|
29
|
+
:root {
|
30
|
+
--aquarium-colors-primary-100: #6447fb;
|
31
|
+
--aquarium-colors-primary-90: #6447fb;
|
32
|
+
--aquarium-colors-primary-80: #6447fb;
|
33
|
+
--aquarium-colors-primary-70: #b0c0fb;
|
34
|
+
--aquarium-colors-primary-60: #c8d3fd;
|
35
|
+
--aquarium-colors-primary-50: #d0d9fd;
|
36
|
+
--aquarium-colors-primary-40: #d7dffc;
|
37
|
+
--aquarium-colors-primary-30: #dfe6fd;
|
38
|
+
--aquarium-colors-primary-20: #e8edfe;
|
39
|
+
--aquarium-colors-primary-10: #eff2fe;
|
40
|
+
--aquarium-colors-primary-5: #f8f9ff;
|
41
|
+
--aquarium-colors-primary-0: #f8f9ff;
|
42
|
+
--aquarium-colors-grey-100: #000;
|
43
|
+
--aquarium-colors-grey-90: #000;
|
44
|
+
--aquarium-colors-grey-80: #444;
|
45
|
+
--aquarium-colors-grey-70: #444;
|
46
|
+
--aquarium-colors-grey-60: #6a6a6a;
|
47
|
+
--aquarium-colors-grey-50: #7e7e7e;
|
48
|
+
--aquarium-colors-grey-40: #939393;
|
49
|
+
--aquarium-colors-grey-30: #a5a5a5;
|
50
|
+
--aquarium-colors-grey-20: #bdbdbd;
|
51
|
+
--aquarium-colors-grey-10: #ebebeb;
|
52
|
+
--aquarium-colors-grey-5: #ebebeb;
|
53
|
+
--aquarium-colors-grey-0: #f8f8f8;
|
54
|
+
}
|
55
|
+
|
56
|
+
.Aquarium-Button {
|
57
|
+
font-weight: 600;
|
58
|
+
border-radius: 24px;
|
59
|
+
}
|
60
|
+
|
61
|
+
.Aquarium-Button.Primary {
|
62
|
+
color: var(--aquarium-colors-white);
|
63
|
+
background-color: var(--aquarium-colors-grey-100);
|
64
|
+
|
65
|
+
&:hover {
|
66
|
+
background-color: var(--aquarium-colors-grey-80);
|
67
|
+
}
|
68
|
+
|
69
|
+
&:active {
|
70
|
+
background-color: var(--aquarium-colors-grey-70);
|
71
|
+
}
|
72
|
+
|
73
|
+
&:disabled {
|
74
|
+
color: var(--aquarium-colors-grey-20);
|
75
|
+
background-color: var(--aquarium-colors-grey-5);
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
.Aquarium-Button.Secondary {
|
80
|
+
color: var(--aquarium-colors-grey-100);
|
81
|
+
background-color: var(--aquarium-colors-white);
|
82
|
+
border: 1.5px solid var(--aquarium-colors-grey-100);
|
83
|
+
box-shadow: none;
|
84
|
+
|
85
|
+
&:hover {
|
86
|
+
color: var(--aquarium-colors-grey-100);
|
87
|
+
background-color: var(--aquarium-colors-primary-10);
|
88
|
+
}
|
89
|
+
|
90
|
+
&:active {
|
91
|
+
color: var(--aquarium-colors-grey-100);
|
92
|
+
background-color: var(--aquarium-colors-primary-20);
|
93
|
+
}
|
94
|
+
|
95
|
+
&:focus-visible {
|
96
|
+
color: var(--aquarium-colors-grey-100);
|
97
|
+
box-shadow: none;
|
98
|
+
}
|
99
|
+
|
100
|
+
&:disabled {
|
101
|
+
color: var(--aquarium-colors-grey-20);
|
102
|
+
background-color: var(--aquarium-colors-white);
|
103
|
+
border-color: var(--aquarium-colors-grey-20);
|
104
|
+
|
105
|
+
&:hover {
|
106
|
+
background-color: var(--aquarium-colors-white);
|
107
|
+
}
|
108
|
+
}
|
109
|
+
}
|
110
|
+
|
111
|
+
.Aquarium-Button.Ghost {
|
112
|
+
padding: var(--aquarium-spacing-2) var(--aquarium-spacing-3);
|
113
|
+
|
114
|
+
&.Aquarium-Dense {
|
115
|
+
padding: var(--aquarium-spacing-2) var(--aquarium-spacing-2);
|
116
|
+
}
|
117
|
+
|
118
|
+
&:hover {
|
119
|
+
color: var(--aquarium-colors-primary-90);
|
120
|
+
background-color: var(--aquarium-colors-primary-10);
|
121
|
+
}
|
122
|
+
|
123
|
+
&:active {
|
124
|
+
background-color: var(--aquarium-colors-primary-20);
|
125
|
+
}
|
126
|
+
|
127
|
+
&:disabled {
|
128
|
+
color: var(--aquarium-colors-grey-20);
|
129
|
+
|
130
|
+
&:hover {
|
131
|
+
background-color: var(--aquarium-colors-transparent);
|
132
|
+
}
|
133
|
+
}
|
134
|
+
}
|
135
|
+
|
136
|
+
.Aquarium-Modal > [aria-modal*='true'],
|
137
|
+
.Aquarium-Dialog > [aria-modal*='true'],
|
138
|
+
.Aquarium-EmptyState {
|
139
|
+
border-radius: 16px;
|
140
|
+
}
|
141
|
+
|
142
|
+
.Aquarium-Modal > [aria-modal*='true'] {
|
143
|
+
overflow: hidden;
|
144
|
+
}
|
145
|
+
`;
|
146
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGhlbWVWYXJpYWJsZVNhbXBsZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdXRpbHMvdGhlbWVWYXJpYWJsZVNhbXBsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFDLE1BQU0scUJBQXFCLEdBQUc7Ozs7Ozs7Ozs7Ozs7Ozs7OztDQWtCcEMsQ0FBQztBQUVGOzs7Ozs7O0dBT0c7QUFDSCxNQUFNLENBQUMsTUFBTSwwQkFBMEIsR0FBRzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0NBcUh6QyxDQUFDIn0=
|
@@ -1,10 +1,10 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { type Breakpointable } from '../../types/tailwind';
|
3
3
|
declare type StylesObject = {
|
4
|
-
[key in keyof React.CSSProperties]: {
|
4
|
+
[key in keyof React.CSSProperties]: Breakpointable<any> | {
|
5
5
|
value: Breakpointable<any>;
|
6
|
-
transformer?: (val: any) =>
|
7
|
-
}
|
6
|
+
transformer?: (val: any) => number | string;
|
7
|
+
};
|
8
8
|
};
|
9
9
|
export declare function resolveTailwindThemeValue(key: string, val: any): any;
|
10
10
|
export declare function useStyle(styles: StylesObject): React.CSSProperties;
|
@@ -17,25 +17,29 @@ const THEME_MAPPING = {
|
|
17
17
|
rowGap: 'gap',
|
18
18
|
columnGap: 'gap',
|
19
19
|
};
|
20
|
-
|
21
|
-
|
20
|
+
/*
|
21
|
+
* Disabled because any felt better as a whole. The function usage becomes
|
22
|
+
* more complicated with a type parameter
|
23
|
+
*/
|
22
24
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
23
25
|
export function resolveTailwindThemeValue(key, val) {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
26
|
+
/*
|
27
|
+
* If tailwind theme has the mapping for value, use it to get value.
|
28
|
+
* For example the theme has:
|
29
|
+
*
|
30
|
+
* "gridRow": {
|
31
|
+
* "auto": "auto",
|
32
|
+
* "span-1": "span 1 / span 1",
|
33
|
+
* "span-2": "span 2 / span 2",
|
34
|
+
* "span-3": "span 3 / span 3",
|
35
|
+
* "span-4": "span 4 / span 4",
|
36
|
+
* "span-5": "span 5 / span 5",
|
37
|
+
* "span-6": "span 6 / span 6",
|
38
|
+
* "span-full": "1 / -1"
|
39
|
+
* },
|
40
|
+
*
|
41
|
+
* key would be "gridRow", and val could be e.g. "span-5"
|
42
|
+
*/
|
39
43
|
const resolvedKey = key in THEME_MAPPING ? THEME_MAPPING[key] : key;
|
40
44
|
const found = get(partialTheme, [resolvedKey, val], undefined);
|
41
45
|
if (!isUndefined(found)) {
|
@@ -46,8 +50,10 @@ export function resolveTailwindThemeValue(key, val) {
|
|
46
50
|
export function useStyle(styles) {
|
47
51
|
const context = useContext(DesignSystemContext);
|
48
52
|
return Object.keys(styles).reduce((acc, key) => {
|
49
|
-
|
50
|
-
|
53
|
+
/*
|
54
|
+
* This was the only way I got tsc happy. We are iterating the object keys,
|
55
|
+
* so we know the property must exist.
|
56
|
+
*/
|
51
57
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
52
58
|
const property = styles[key];
|
53
59
|
const isStylesObject = isPlainObject(property) && 'value' in property;
|
@@ -60,11 +66,13 @@ export function useStyle(styles) {
|
|
60
66
|
(val) => resolveTailwindThemeValue(key, property.transformer(val));
|
61
67
|
const cssPropertyValue = transformer(resolvedValue);
|
62
68
|
if (isUndefined(cssPropertyValue)) {
|
63
|
-
|
64
|
-
|
69
|
+
/*
|
70
|
+
* If style value is undefined, we omit the key from the object
|
71
|
+
* this should reduce unwanted {key: "undefined"} noise
|
72
|
+
*/
|
65
73
|
return acc;
|
66
74
|
}
|
67
75
|
return Object.assign(Object.assign({}, acc), { [key]: cssPropertyValue });
|
68
76
|
}, {});
|
69
77
|
}
|
70
|
-
//# sourceMappingURL=data:application/json;base64,
|
78
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlU3R5bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdXRpbHMvdXNlU3R5bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLE9BQU8sQ0FBQztBQUNuQyxPQUFPLEdBQUcsTUFBTSxZQUFZLENBQUM7QUFDN0IsT0FBTyxhQUFhLE1BQU0sc0JBQXNCLENBQUM7QUFDakQsT0FBTyxXQUFXLE1BQU0sb0JBQW9CLENBQUM7QUFDN0MsT0FBTyxZQUFZLE1BQU0scUJBQXFCLENBQUM7QUFFL0MsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFFcEUsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFZOUQsTUFBTSxhQUFhLEdBQTJCO0lBQzVDLFVBQVUsRUFBRSxTQUFTO0lBQ3JCLGFBQWEsRUFBRSxTQUFTO0lBQ3hCLFdBQVcsRUFBRSxTQUFTO0lBQ3RCLFlBQVksRUFBRSxTQUFTO0lBQ3ZCLFNBQVMsRUFBRSxRQUFRO0lBQ25CLFlBQVksRUFBRSxRQUFRO0lBQ3RCLFVBQVUsRUFBRSxRQUFRO0lBQ3BCLFdBQVcsRUFBRSxRQUFRO0lBQ3JCLE1BQU0sRUFBRSxLQUFLO0lBQ2IsU0FBUyxFQUFFLEtBQUs7Q0FDakIsQ0FBQztBQUVGOzs7R0FHRztBQUNILDZFQUE2RTtBQUM3RSxNQUFNLFVBQVUseUJBQXlCLENBQUMsR0FBVyxFQUFFLEdBQVE7SUFDN0Q7Ozs7Ozs7Ozs7Ozs7Ozs7T0FnQkc7SUFDSCxNQUFNLFdBQVcsR0FBRyxHQUFHLElBQUksYUFBYSxDQUFDLENBQUMsQ0FBQyxhQUFhLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLEdBQUcsQ0FBQztJQUNwRSxNQUFNLEtBQUssR0FBRyxHQUFHLENBQUMsWUFBWSxFQUFFLENBQUMsV0FBVyxFQUFFLEdBQUcsQ0FBQyxFQUFFLFNBQVMsQ0FBQyxDQUFDO0lBQy9ELElBQUksQ0FBQyxXQUFXLENBQUMsS0FBSyxDQUFDLEVBQUU7UUFDdkIsT0FBTyxLQUFLLENBQUM7S0FDZDtJQUVELE9BQU8sR0FBRyxDQUFDO0FBQ2IsQ0FBQztBQUVELE1BQU0sVUFBVSxRQUFRLENBQUMsTUFBb0I7SUFDM0MsTUFBTSxPQUFPLEdBQUcsVUFBVSxDQUFDLG1CQUFtQixDQUFDLENBQUM7SUFFaEQsT0FBTyxNQUFNLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsRUFBRTtRQUM3Qzs7O1dBR0c7UUFDSCxvRUFBb0U7UUFDcEUsTUFBTSxRQUFRLEdBQUcsTUFBTSxDQUFDLEdBQXlCLENBQUUsQ0FBQztRQUVwRCxNQUFNLGNBQWMsR0FBRyxhQUFhLENBQUMsUUFBUSxDQUFDLElBQUksT0FBTyxJQUFJLFFBQVEsQ0FBQztRQUN0RSxNQUFNLEtBQUssR0FBRyxjQUFjLENBQUMsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLFFBQVEsQ0FBQztRQUN6RCxNQUFNLGFBQWEsR0FBRyxxQkFBcUIsQ0FBQyxLQUFLLEVBQUUsT0FBTyxDQUFDLGlCQUFpQixDQUFDLENBQUM7UUFFOUUsTUFBTSxXQUFXLEdBQUcsV0FBVyxDQUFDLFFBQVEsYUFBUixRQUFRLHVCQUFSLFFBQVEsQ0FBRSxXQUFXLENBQUM7WUFDcEQsQ0FBQyxDQUFDLENBQUMsR0FBUSxFQUFFLEVBQUUsQ0FBQyx5QkFBeUIsQ0FBQyxHQUFHLEVBQUUsR0FBRyxDQUFDO1lBQ25ELENBQUMsQ0FBQyx5RUFBeUU7Z0JBQ3pFLDREQUE0RDtnQkFDNUQsQ0FBQyxHQUFRLEVBQUUsRUFBRSxDQUFDLHlCQUF5QixDQUFDLEdBQUcsRUFBRSxRQUFRLENBQUMsV0FBVyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUM7UUFFNUUsTUFBTSxnQkFBZ0IsR0FBRyxXQUFXLENBQUMsYUFBYSxDQUFDLENBQUM7UUFDcEQsSUFBSSxXQUFXLENBQUMsZ0JBQWdCLENBQUMsRUFBRTtZQUNqQzs7O2VBR0c7WUFDSCxPQUFPLEdBQUcsQ0FBQztTQUNaO1FBRUQsdUNBQ0ssR0FBRyxLQUNOLENBQUMsR0FBRyxDQUFDLEVBQUUsZ0JBQWdCLElBQ3ZCO0lBQ0osQ0FBQyxFQUFFLEVBQXlCLENBQUMsQ0FBQztBQUNoQyxDQUFDIn0=
|
package/dist/system.cjs
CHANGED
@@ -6836,9 +6836,8 @@ function Tailwindify(Component) {
|
|
6836
6836
|
return import_react15.default.cloneElement(child, newProps);
|
6837
6837
|
});
|
6838
6838
|
return /* @__PURE__ */ import_react15.default.createElement(Component, __spreadValues({
|
6839
|
-
className
|
6840
|
-
|
6841
|
-
}, componentProps));
|
6839
|
+
className
|
6840
|
+
}, componentProps), childrenWithProps);
|
6842
6841
|
};
|
6843
6842
|
}
|
6844
6843
|
|
@@ -11041,6 +11040,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
11041
11040
|
index,
|
11042
11041
|
selected,
|
11043
11042
|
onSelected,
|
11043
|
+
showNotification = false,
|
11044
11044
|
className
|
11045
11045
|
} = _b, rest = __objRest(_b, [
|
11046
11046
|
"id",
|
@@ -11053,6 +11053,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
11053
11053
|
"index",
|
11054
11054
|
"selected",
|
11055
11055
|
"onSelected",
|
11056
|
+
"showNotification",
|
11056
11057
|
"className"
|
11057
11058
|
]);
|
11058
11059
|
const _id = id != null ? id : (0, import_kebabCase.default)(title);
|
@@ -11090,8 +11091,13 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
11090
11091
|
variant: "small",
|
11091
11092
|
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
11092
11093
|
className: tw("inline-flex items-center gap-3")
|
11094
|
+
}, showNotification ? /* @__PURE__ */ import_react82.default.createElement(Badge.Notification, {
|
11095
|
+
right: "-4px",
|
11096
|
+
top: "3px"
|
11093
11097
|
}, /* @__PURE__ */ import_react82.default.createElement("span", {
|
11094
11098
|
className: tw("whitespace-nowrap")
|
11099
|
+
}, title)) : /* @__PURE__ */ import_react82.default.createElement("span", {
|
11100
|
+
className: tw("whitespace-nowrap")
|
11095
11101
|
}, title), (0, import_isNumber5.default)(badge) && /* @__PURE__ */ import_react82.default.createElement(Typography2, {
|
11096
11102
|
htmlTag: "span",
|
11097
11103
|
variant: "small",
|
@@ -11399,7 +11405,7 @@ var InputChip = import_react84.default.forwardRef(
|
|
11399
11405
|
"hover:bg-grey-10 focus:bg-grey-20": !invalid && !disabled
|
11400
11406
|
}),
|
11401
11407
|
role: "button",
|
11402
|
-
"aria-label": `Remove ${children}`
|
11408
|
+
"aria-label": `Remove ${String(children)}`
|
11403
11409
|
}), /* @__PURE__ */ import_react84.default.createElement(Icon, {
|
11404
11410
|
icon: import_smallCross2.default,
|
11405
11411
|
className: tw({
|
@@ -11555,7 +11561,7 @@ var MultiInputBase = (_a) => {
|
|
11555
11561
|
return /* @__PURE__ */ import_react85.default.createElement("div", {
|
11556
11562
|
className: "Aquarium-MultiInputBase"
|
11557
11563
|
}, /* @__PURE__ */ import_react85.default.createElement(Select.InputContainer, {
|
11558
|
-
variant: disabled ? "disabled" : valid
|
11564
|
+
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
11559
11565
|
}, /* @__PURE__ */ import_react85.default.createElement("div", {
|
11560
11566
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
11561
11567
|
}, inline && renderChips(), /* @__PURE__ */ import_react85.default.createElement(Select.Input, __spreadProps(__spreadValues({
|
@@ -12100,9 +12106,11 @@ PageHeader.TitleContainer = (_a) => {
|
|
12100
12106
|
}, rest), children);
|
12101
12107
|
};
|
12102
12108
|
PageHeader.Title = (_a) => {
|
12103
|
-
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12104
|
-
return /* @__PURE__ */ import_react90.default.createElement(Typography2
|
12105
|
-
color: "grey-100"
|
12109
|
+
var _b = _a, { isSubHeader = false, children } = _b, rest = __objRest(_b, ["isSubHeader", "children"]);
|
12110
|
+
return /* @__PURE__ */ import_react90.default.createElement(Typography2, __spreadProps(__spreadValues({}, rest), {
|
12111
|
+
color: "grey-100",
|
12112
|
+
variant: isSubHeader ? "subheading" : "heading",
|
12113
|
+
htmlTag: isSubHeader ? "h2" : "h1"
|
12106
12114
|
}), children);
|
12107
12115
|
};
|
12108
12116
|
PageHeader.Subtitle = (_a) => {
|
@@ -12125,31 +12133,49 @@ PageHeader.Actions = (_a) => {
|
|
12125
12133
|
};
|
12126
12134
|
|
12127
12135
|
// src/molecules/PageHeader/PageHeader.tsx
|
12128
|
-
var
|
12136
|
+
var import_more4 = __toESM(require_more());
|
12137
|
+
var CommonPageHeader = ({
|
12129
12138
|
title,
|
12130
12139
|
subtitle,
|
12131
12140
|
image,
|
12132
12141
|
imageAlt,
|
12133
12142
|
primaryAction,
|
12134
|
-
|
12143
|
+
secondaryAction,
|
12144
|
+
secondaryActions = secondaryAction ? [secondaryAction] : void 0,
|
12135
12145
|
chips = [],
|
12136
|
-
breadcrumbs
|
12146
|
+
breadcrumbs,
|
12147
|
+
menu,
|
12148
|
+
menuLabel = "Context menu",
|
12149
|
+
onAction,
|
12150
|
+
onMenuOpenChange,
|
12151
|
+
isSubHeader = false
|
12137
12152
|
}) => {
|
12138
12153
|
return /* @__PURE__ */ import_react91.default.createElement(PageHeader, {
|
12139
12154
|
className: "Aquarium-PageHeader"
|
12140
12155
|
}, /* @__PURE__ */ import_react91.default.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ import_react91.default.createElement(Box, {
|
12141
12156
|
marginBottom: image ? "3" : void 0
|
12142
|
-
}, /* @__PURE__ */ import_react91.default.createElement(Breadcrumbs, null, breadcrumbs)), /* @__PURE__ */ import_react91.default.createElement(
|
12157
|
+
}, /* @__PURE__ */ import_react91.default.createElement(Breadcrumbs, null, breadcrumbs)), /* @__PURE__ */ import_react91.default.createElement(Spacing, {
|
12158
|
+
row: true,
|
12143
12159
|
gap: "5"
|
12144
12160
|
}, image && /* @__PURE__ */ import_react91.default.createElement("img", {
|
12145
12161
|
src: image,
|
12146
12162
|
alt: imageAlt,
|
12147
12163
|
className: tw("w-[56px] h-[56px]")
|
12148
|
-
}), /* @__PURE__ */ import_react91.default.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ import_react91.default.createElement(PageHeader.Title,
|
12164
|
+
}), /* @__PURE__ */ import_react91.default.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ import_react91.default.createElement(PageHeader.Title, {
|
12165
|
+
isSubHeader
|
12166
|
+
}, title), chips.length > 0 && /* @__PURE__ */ import_react91.default.createElement(PageHeader.Chips, null, chips.map((chip) => /* @__PURE__ */ import_react91.default.createElement(Chip2, {
|
12149
12167
|
key: chip,
|
12150
12168
|
dense: true,
|
12151
12169
|
text: chip
|
12152
|
-
}))), subtitle && /* @__PURE__ */ import_react91.default.createElement(PageHeader.Subtitle, null, subtitle)))), (secondaryActions || primaryAction) && /* @__PURE__ */ import_react91.default.createElement(PageHeader.Actions, null,
|
12170
|
+
}))), subtitle && /* @__PURE__ */ import_react91.default.createElement(PageHeader.Subtitle, null, subtitle)))), (secondaryActions || primaryAction || secondaryAction || menu) && /* @__PURE__ */ import_react91.default.createElement(PageHeader.Actions, null, menu && /* @__PURE__ */ import_react91.default.createElement(Box.Flex, {
|
12171
|
+
alignItems: "center"
|
12172
|
+
}, /* @__PURE__ */ import_react91.default.createElement(DropdownMenu2, {
|
12173
|
+
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
12174
|
+
onOpenChange: onMenuOpenChange
|
12175
|
+
}, /* @__PURE__ */ import_react91.default.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ import_react91.default.createElement(Button.Icon, {
|
12176
|
+
"aria-label": menuLabel,
|
12177
|
+
icon: import_more4.default
|
12178
|
+
})), menu)), secondaryActions && (0, import_castArray3.default)(secondaryActions).filter(Boolean).map(
|
12153
12179
|
(action) => !isLink(action) ? /* @__PURE__ */ import_react91.default.createElement(Button.Secondary, __spreadValues({
|
12154
12180
|
key: action.text
|
12155
12181
|
}, (0, import_omit13.default)(action, "text")), action.text) : /* @__PURE__ */ import_react91.default.createElement(Button.ExternalLink, __spreadValues({
|
@@ -12163,6 +12189,13 @@ var PageHeader2 = ({
|
|
12163
12189
|
kind: "primary"
|
12164
12190
|
}, (0, import_omit13.default)(primaryAction, "text")), primaryAction.text))));
|
12165
12191
|
};
|
12192
|
+
var PageHeader2 = (props) => /* @__PURE__ */ import_react91.default.createElement(CommonPageHeader, __spreadValues({}, props));
|
12193
|
+
PageHeader2.displayName = "PageHeader";
|
12194
|
+
var SubHeader = (props) => /* @__PURE__ */ import_react91.default.createElement(CommonPageHeader, __spreadProps(__spreadValues({}, props), {
|
12195
|
+
isSubHeader: true
|
12196
|
+
}));
|
12197
|
+
PageHeader2.SubHeader = SubHeader;
|
12198
|
+
PageHeader2.SubHeader.displayName = "PageHeader.SubHeader";
|
12166
12199
|
|
12167
12200
|
// src/molecules/Pagination/Pagination.tsx
|
12168
12201
|
var import_react93 = __toESM(require("react"));
|
package/dist/system.mjs
CHANGED
@@ -6693,9 +6693,8 @@ function Tailwindify(Component) {
|
|
6693
6693
|
return React12.cloneElement(child, newProps);
|
6694
6694
|
});
|
6695
6695
|
return /* @__PURE__ */ React12.createElement(Component, __spreadValues({
|
6696
|
-
className
|
6697
|
-
|
6698
|
-
}, componentProps));
|
6696
|
+
className
|
6697
|
+
}, componentProps), childrenWithProps);
|
6699
6698
|
};
|
6700
6699
|
}
|
6701
6700
|
|
@@ -10898,6 +10897,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
10898
10897
|
index,
|
10899
10898
|
selected,
|
10900
10899
|
onSelected,
|
10900
|
+
showNotification = false,
|
10901
10901
|
className
|
10902
10902
|
} = _b, rest = __objRest(_b, [
|
10903
10903
|
"id",
|
@@ -10910,6 +10910,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
10910
10910
|
"index",
|
10911
10911
|
"selected",
|
10912
10912
|
"onSelected",
|
10913
|
+
"showNotification",
|
10913
10914
|
"className"
|
10914
10915
|
]);
|
10915
10916
|
const _id = id != null ? id : kebabCase(title);
|
@@ -10947,8 +10948,13 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
10947
10948
|
variant: "small",
|
10948
10949
|
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
10949
10950
|
className: tw("inline-flex items-center gap-3")
|
10951
|
+
}, showNotification ? /* @__PURE__ */ React76.createElement(Badge.Notification, {
|
10952
|
+
right: "-4px",
|
10953
|
+
top: "3px"
|
10950
10954
|
}, /* @__PURE__ */ React76.createElement("span", {
|
10951
10955
|
className: tw("whitespace-nowrap")
|
10956
|
+
}, title)) : /* @__PURE__ */ React76.createElement("span", {
|
10957
|
+
className: tw("whitespace-nowrap")
|
10952
10958
|
}, title), isNumber5(badge) && /* @__PURE__ */ React76.createElement(Typography2, {
|
10953
10959
|
htmlTag: "span",
|
10954
10960
|
variant: "small",
|
@@ -11256,7 +11262,7 @@ var InputChip = React78.forwardRef(
|
|
11256
11262
|
"hover:bg-grey-10 focus:bg-grey-20": !invalid && !disabled
|
11257
11263
|
}),
|
11258
11264
|
role: "button",
|
11259
|
-
"aria-label": `Remove ${children}`
|
11265
|
+
"aria-label": `Remove ${String(children)}`
|
11260
11266
|
}), /* @__PURE__ */ React78.createElement(Icon, {
|
11261
11267
|
icon: import_smallCross2.default,
|
11262
11268
|
className: tw({
|
@@ -11412,7 +11418,7 @@ var MultiInputBase = (_a) => {
|
|
11412
11418
|
return /* @__PURE__ */ React79.createElement("div", {
|
11413
11419
|
className: "Aquarium-MultiInputBase"
|
11414
11420
|
}, /* @__PURE__ */ React79.createElement(Select.InputContainer, {
|
11415
|
-
variant: disabled ? "disabled" : valid
|
11421
|
+
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
11416
11422
|
}, /* @__PURE__ */ React79.createElement("div", {
|
11417
11423
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
11418
11424
|
}, inline && renderChips(), /* @__PURE__ */ React79.createElement(Select.Input, __spreadProps(__spreadValues({
|
@@ -11957,9 +11963,11 @@ PageHeader.TitleContainer = (_a) => {
|
|
11957
11963
|
}, rest), children);
|
11958
11964
|
};
|
11959
11965
|
PageHeader.Title = (_a) => {
|
11960
|
-
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
11961
|
-
return /* @__PURE__ */ React84.createElement(Typography2
|
11962
|
-
color: "grey-100"
|
11966
|
+
var _b = _a, { isSubHeader = false, children } = _b, rest = __objRest(_b, ["isSubHeader", "children"]);
|
11967
|
+
return /* @__PURE__ */ React84.createElement(Typography2, __spreadProps(__spreadValues({}, rest), {
|
11968
|
+
color: "grey-100",
|
11969
|
+
variant: isSubHeader ? "subheading" : "heading",
|
11970
|
+
htmlTag: isSubHeader ? "h2" : "h1"
|
11963
11971
|
}), children);
|
11964
11972
|
};
|
11965
11973
|
PageHeader.Subtitle = (_a) => {
|
@@ -11982,31 +11990,49 @@ PageHeader.Actions = (_a) => {
|
|
11982
11990
|
};
|
11983
11991
|
|
11984
11992
|
// src/molecules/PageHeader/PageHeader.tsx
|
11985
|
-
var
|
11993
|
+
var import_more4 = __toESM(require_more());
|
11994
|
+
var CommonPageHeader = ({
|
11986
11995
|
title,
|
11987
11996
|
subtitle,
|
11988
11997
|
image,
|
11989
11998
|
imageAlt,
|
11990
11999
|
primaryAction,
|
11991
|
-
|
12000
|
+
secondaryAction,
|
12001
|
+
secondaryActions = secondaryAction ? [secondaryAction] : void 0,
|
11992
12002
|
chips = [],
|
11993
|
-
breadcrumbs
|
12003
|
+
breadcrumbs,
|
12004
|
+
menu,
|
12005
|
+
menuLabel = "Context menu",
|
12006
|
+
onAction,
|
12007
|
+
onMenuOpenChange,
|
12008
|
+
isSubHeader = false
|
11994
12009
|
}) => {
|
11995
12010
|
return /* @__PURE__ */ React85.createElement(PageHeader, {
|
11996
12011
|
className: "Aquarium-PageHeader"
|
11997
12012
|
}, /* @__PURE__ */ React85.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ React85.createElement(Box, {
|
11998
12013
|
marginBottom: image ? "3" : void 0
|
11999
|
-
}, /* @__PURE__ */ React85.createElement(Breadcrumbs, null, breadcrumbs)), /* @__PURE__ */ React85.createElement(
|
12014
|
+
}, /* @__PURE__ */ React85.createElement(Breadcrumbs, null, breadcrumbs)), /* @__PURE__ */ React85.createElement(Spacing, {
|
12015
|
+
row: true,
|
12000
12016
|
gap: "5"
|
12001
12017
|
}, image && /* @__PURE__ */ React85.createElement("img", {
|
12002
12018
|
src: image,
|
12003
12019
|
alt: imageAlt,
|
12004
12020
|
className: tw("w-[56px] h-[56px]")
|
12005
|
-
}), /* @__PURE__ */ React85.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ React85.createElement(PageHeader.Title,
|
12021
|
+
}), /* @__PURE__ */ React85.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ React85.createElement(PageHeader.Title, {
|
12022
|
+
isSubHeader
|
12023
|
+
}, title), chips.length > 0 && /* @__PURE__ */ React85.createElement(PageHeader.Chips, null, chips.map((chip) => /* @__PURE__ */ React85.createElement(Chip2, {
|
12006
12024
|
key: chip,
|
12007
12025
|
dense: true,
|
12008
12026
|
text: chip
|
12009
|
-
}))), subtitle && /* @__PURE__ */ React85.createElement(PageHeader.Subtitle, null, subtitle)))), (secondaryActions || primaryAction) && /* @__PURE__ */ React85.createElement(PageHeader.Actions, null,
|
12027
|
+
}))), subtitle && /* @__PURE__ */ React85.createElement(PageHeader.Subtitle, null, subtitle)))), (secondaryActions || primaryAction || secondaryAction || menu) && /* @__PURE__ */ React85.createElement(PageHeader.Actions, null, menu && /* @__PURE__ */ React85.createElement(Box.Flex, {
|
12028
|
+
alignItems: "center"
|
12029
|
+
}, /* @__PURE__ */ React85.createElement(DropdownMenu2, {
|
12030
|
+
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
12031
|
+
onOpenChange: onMenuOpenChange
|
12032
|
+
}, /* @__PURE__ */ React85.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React85.createElement(Button.Icon, {
|
12033
|
+
"aria-label": menuLabel,
|
12034
|
+
icon: import_more4.default
|
12035
|
+
})), menu)), secondaryActions && castArray3(secondaryActions).filter(Boolean).map(
|
12010
12036
|
(action) => !isLink(action) ? /* @__PURE__ */ React85.createElement(Button.Secondary, __spreadValues({
|
12011
12037
|
key: action.text
|
12012
12038
|
}, omit14(action, "text")), action.text) : /* @__PURE__ */ React85.createElement(Button.ExternalLink, __spreadValues({
|
@@ -12020,6 +12046,13 @@ var PageHeader2 = ({
|
|
12020
12046
|
kind: "primary"
|
12021
12047
|
}, omit14(primaryAction, "text")), primaryAction.text))));
|
12022
12048
|
};
|
12049
|
+
var PageHeader2 = (props) => /* @__PURE__ */ React85.createElement(CommonPageHeader, __spreadValues({}, props));
|
12050
|
+
PageHeader2.displayName = "PageHeader";
|
12051
|
+
var SubHeader = (props) => /* @__PURE__ */ React85.createElement(CommonPageHeader, __spreadProps(__spreadValues({}, props), {
|
12052
|
+
isSubHeader: true
|
12053
|
+
}));
|
12054
|
+
PageHeader2.SubHeader = SubHeader;
|
12055
|
+
PageHeader2.SubHeader.displayName = "PageHeader.SubHeader";
|
12023
12056
|
|
12024
12057
|
// src/molecules/Pagination/Pagination.tsx
|
12025
12058
|
import React87 from "react";
|