@carto/ps-react-ui 6.3.0 → 6.5.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/actions-D_PVFZaM.js +1272 -0
- package/dist/actions-D_PVFZaM.js.map +1 -0
- package/dist/{category-DULnoxvk.js → category-UIGvFN3D.js} +263 -246
- package/dist/category-UIGvFN3D.js.map +1 -0
- package/dist/chat.js +472 -470
- package/dist/chat.js.map +1 -1
- package/dist/{components-CTUpdQuj.js → components-DDJU4m0t.js} +8 -8
- package/dist/components-DDJU4m0t.js.map +1 -0
- package/dist/components.js +2 -2
- package/dist/{download-B4sykOFm.js → download-DIj1Iz0t.js} +2 -2
- package/dist/{download-B4sykOFm.js.map → download-DIj1Iz0t.js.map} +1 -1
- package/dist/{formula-DJS-JLpk.js → formula-CSHhAoyW.js} +4 -4
- package/dist/{formula-DJS-JLpk.js.map → formula-CSHhAoyW.js.map} +1 -1
- package/dist/{item-color-B7xkIpDZ.js → item-color-7o7pFBR2.js} +26 -18
- package/dist/item-color-7o7pFBR2.js.map +1 -0
- package/dist/markdown-B8lLR-NY.js +106 -0
- package/dist/markdown-B8lLR-NY.js.map +1 -0
- package/dist/scale-Bhx8HKEB.js +29 -0
- package/dist/scale-Bhx8HKEB.js.map +1 -0
- package/dist/{spread-CQwFIwuz.js → spread-BRfPPIep.js} +3 -3
- package/dist/{spread-CQwFIwuz.js.map → spread-BRfPPIep.js.map} +1 -1
- package/dist/style-DTLuIo84.js +87 -0
- package/dist/style-DTLuIo84.js.map +1 -0
- package/dist/{styles-BCEBm7xh.js → styles-yKcpfyNV.js} +5 -5
- package/dist/styles-yKcpfyNV.js.map +1 -0
- package/dist/{table-DEdW_fDj.js → table-Col_FRvb.js} +2 -2
- package/dist/{table-DEdW_fDj.js.map → table-Col_FRvb.js.map} +1 -1
- package/dist/theme/tailwind.css +373 -0
- package/dist/theme.js +123 -0
- package/dist/theme.js.map +1 -0
- package/dist/types/components/lasso-tool/styles.d.ts +4 -4
- package/dist/types/theme/create-carto-theme.d.ts +7 -0
- package/dist/types/theme/deep-merge.d.ts +6 -0
- package/dist/types/theme/generate-tailwind-css.d.ts +8 -0
- package/dist/types/theme/index.d.ts +2 -0
- package/dist/types/widgets/actions/index.d.ts +1 -1
- package/dist/types/widgets/actions/relative-data/index.d.ts +1 -0
- package/dist/types/widgets/actions/relative-data/labels.d.ts +3 -0
- package/dist/types/widgets/actions/relative-data/relative-data.d.ts +16 -2
- package/dist/types/widgets/actions/relative-data/scale.d.ts +26 -0
- package/dist/types/widgets/actions/relative-data/style.d.ts +12 -0
- package/dist/types/widgets/category/category.d.ts +2 -1
- package/dist/types/widgets/index.d.ts +1 -1
- package/dist/types/widgets/markdown/style.d.ts +74 -0
- package/dist/types/widgets/utils/spacing-px.d.ts +13 -0
- package/dist/{utils-C-eWwOhE.js → utils-Dw4y8tiq.js} +2 -2
- package/dist/{utils-C-eWwOhE.js.map → utils-Dw4y8tiq.js.map} +1 -1
- package/dist/widgets/actions.js +3 -3
- package/dist/widgets/bar.js +85 -84
- package/dist/widgets/bar.js.map +1 -1
- package/dist/widgets/category.js +1 -1
- package/dist/widgets/formula.js +1 -1
- package/dist/widgets/histogram.js +109 -108
- package/dist/widgets/histogram.js.map +1 -1
- package/dist/widgets/markdown.js +1 -1
- package/dist/widgets/pie.js +78 -78
- package/dist/widgets/pie.js.map +1 -1
- package/dist/widgets/scatterplot.js +121 -120
- package/dist/widgets/scatterplot.js.map +1 -1
- package/dist/widgets/spread.js +1 -1
- package/dist/widgets/table.js +1 -1
- package/dist/widgets/timeseries.js +91 -90
- package/dist/widgets/timeseries.js.map +1 -1
- package/dist/widgets/utils.js +1 -1
- package/dist/widgets.js +283 -279
- package/dist/widgets.js.map +1 -1
- package/dist/{zoom-toggle-MmLjMTEw.js → zoom-toggle-DqrV_0Ji.js} +2 -2
- package/dist/{zoom-toggle-MmLjMTEw.js.map → zoom-toggle-DqrV_0Ji.js.map} +1 -1
- package/package.json +8 -1
- package/src/chat/bubbles/styles.ts +2 -0
- package/src/components/lasso-tool/lasso-tool-inline.test.tsx +4 -4
- package/src/components/lasso-tool/lasso-tool-inline.tsx +6 -6
- package/src/components/lasso-tool/styles.ts +4 -4
- package/src/theme/create-carto-theme.test.ts +53 -0
- package/src/theme/create-carto-theme.ts +21 -0
- package/src/theme/deep-merge.test.ts +25 -0
- package/src/theme/deep-merge.ts +22 -0
- package/src/theme/generate-tailwind-css.test.ts +87 -0
- package/src/theme/generate-tailwind-css.ts +178 -0
- package/src/theme/index.ts +2 -0
- package/src/theme/tailwind-compile.test.ts +71 -0
- package/src/theme/tailwind.css +373 -0
- package/src/widgets/actions/index.ts +1 -0
- package/src/widgets/actions/relative-data/index.ts +1 -0
- package/src/widgets/actions/relative-data/labels.ts +6 -0
- package/src/widgets/actions/relative-data/relative-data.test.tsx +78 -1
- package/src/widgets/actions/relative-data/relative-data.tsx +137 -20
- package/src/widgets/actions/relative-data/scale.ts +48 -0
- package/src/widgets/actions/relative-data/style.ts +10 -0
- package/src/widgets/bar/options.test.ts +16 -0
- package/src/widgets/bar/options.ts +13 -8
- package/src/widgets/category/category.relative-data.test.tsx +51 -63
- package/src/widgets/category/category.tsx +25 -11
- package/src/widgets/histogram/options.ts +13 -8
- package/src/widgets/index.ts +1 -0
- package/src/widgets/markdown/style.ts +40 -0
- package/src/widgets/note/widget-note.tsx +4 -1
- package/src/widgets/pie/options.ts +5 -4
- package/src/widgets/scatterplot/options.test.ts +12 -0
- package/src/widgets/scatterplot/options.ts +25 -10
- package/src/widgets/timeseries/options.ts +13 -8
- package/src/widgets/utils/css-variables-theme.test.ts +32 -0
- package/src/widgets/utils/option-builders.ts +4 -6
- package/src/widgets/utils/spacing-px.test.ts +42 -0
- package/src/widgets/utils/spacing-px.ts +24 -0
- package/dist/actions-CkxKe8-J.js +0 -1160
- package/dist/actions-CkxKe8-J.js.map +0 -1
- package/dist/category-DULnoxvk.js.map +0 -1
- package/dist/components-CTUpdQuj.js.map +0 -1
- package/dist/item-color-B7xkIpDZ.js.map +0 -1
- package/dist/markdown-DmvLi3vx.js +0 -159
- package/dist/markdown-DmvLi3vx.js.map +0 -1
- package/dist/styles-BCEBm7xh.js.map +0 -1
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Generated by generateTailwindCss() from @carto/ps-react-ui/theme.
|
|
3
|
+
* Do not edit by hand: regenerate it whenever the theme changes.
|
|
4
|
+
*
|
|
5
|
+
* Import after `tailwindcss`. Declare the cascade layer order yourself first:
|
|
6
|
+
* theme, base, mui, components, utilities (in that order).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
@theme inline {
|
|
10
|
+
--color-primary: var(--mui-palette-primary-main);
|
|
11
|
+
--color-primary-light: var(--mui-palette-primary-light);
|
|
12
|
+
--color-primary-dark: var(--mui-palette-primary-dark);
|
|
13
|
+
--color-primary-contrast: var(--mui-palette-primary-contrastText);
|
|
14
|
+
--color-primary-related-light: var(--mui-palette-primary-relatedLight);
|
|
15
|
+
--color-primary-related-dark: var(--mui-palette-primary-relatedDark);
|
|
16
|
+
--color-primary-background: var(--mui-palette-primary-background);
|
|
17
|
+
--color-secondary: var(--mui-palette-secondary-main);
|
|
18
|
+
--color-secondary-light: var(--mui-palette-secondary-light);
|
|
19
|
+
--color-secondary-dark: var(--mui-palette-secondary-dark);
|
|
20
|
+
--color-secondary-contrast: var(--mui-palette-secondary-contrastText);
|
|
21
|
+
--color-secondary-related-light: var(--mui-palette-secondary-relatedLight);
|
|
22
|
+
--color-secondary-related-dark: var(--mui-palette-secondary-relatedDark);
|
|
23
|
+
--color-secondary-background: var(--mui-palette-secondary-background);
|
|
24
|
+
--color-tertiary: var(--mui-palette-tertiary-main);
|
|
25
|
+
--color-tertiary-light: var(--mui-palette-tertiary-light);
|
|
26
|
+
--color-tertiary-dark: var(--mui-palette-tertiary-dark);
|
|
27
|
+
--color-tertiary-contrast: var(--mui-palette-tertiary-contrastText);
|
|
28
|
+
--color-tertiary-related-light: var(--mui-palette-tertiary-relatedLight);
|
|
29
|
+
--color-tertiary-related-dark: var(--mui-palette-tertiary-relatedDark);
|
|
30
|
+
--color-tertiary-background: var(--mui-palette-tertiary-background);
|
|
31
|
+
--color-error: var(--mui-palette-error-main);
|
|
32
|
+
--color-error-light: var(--mui-palette-error-light);
|
|
33
|
+
--color-error-dark: var(--mui-palette-error-dark);
|
|
34
|
+
--color-error-contrast: var(--mui-palette-error-contrastText);
|
|
35
|
+
--color-error-related-light: var(--mui-palette-error-relatedLight);
|
|
36
|
+
--color-error-related-dark: var(--mui-palette-error-relatedDark);
|
|
37
|
+
--color-error-background: var(--mui-palette-error-background);
|
|
38
|
+
--color-warning: var(--mui-palette-warning-main);
|
|
39
|
+
--color-warning-light: var(--mui-palette-warning-light);
|
|
40
|
+
--color-warning-dark: var(--mui-palette-warning-dark);
|
|
41
|
+
--color-warning-contrast: var(--mui-palette-warning-contrastText);
|
|
42
|
+
--color-warning-related-light: var(--mui-palette-warning-relatedLight);
|
|
43
|
+
--color-warning-related-dark: var(--mui-palette-warning-relatedDark);
|
|
44
|
+
--color-warning-background: var(--mui-palette-warning-background);
|
|
45
|
+
--color-info: var(--mui-palette-info-main);
|
|
46
|
+
--color-info-light: var(--mui-palette-info-light);
|
|
47
|
+
--color-info-dark: var(--mui-palette-info-dark);
|
|
48
|
+
--color-info-contrast: var(--mui-palette-info-contrastText);
|
|
49
|
+
--color-info-related-light: var(--mui-palette-info-relatedLight);
|
|
50
|
+
--color-info-related-dark: var(--mui-palette-info-relatedDark);
|
|
51
|
+
--color-info-background: var(--mui-palette-info-background);
|
|
52
|
+
--color-success: var(--mui-palette-success-main);
|
|
53
|
+
--color-success-light: var(--mui-palette-success-light);
|
|
54
|
+
--color-success-dark: var(--mui-palette-success-dark);
|
|
55
|
+
--color-success-contrast: var(--mui-palette-success-contrastText);
|
|
56
|
+
--color-success-related-light: var(--mui-palette-success-relatedLight);
|
|
57
|
+
--color-success-related-dark: var(--mui-palette-success-relatedDark);
|
|
58
|
+
--color-success-background: var(--mui-palette-success-background);
|
|
59
|
+
--color-neutral: var(--mui-palette-neutral-main);
|
|
60
|
+
--color-neutral-light: var(--mui-palette-neutral-light);
|
|
61
|
+
--color-neutral-dark: var(--mui-palette-neutral-dark);
|
|
62
|
+
--color-neutral-contrast: var(--mui-palette-neutral-contrastText);
|
|
63
|
+
--color-neutral-related-light: var(--mui-palette-neutral-relatedLight);
|
|
64
|
+
--color-neutral-related-dark: var(--mui-palette-neutral-relatedDark);
|
|
65
|
+
--color-neutral-background: var(--mui-palette-neutral-background);
|
|
66
|
+
--color-default: var(--mui-palette-default-main);
|
|
67
|
+
--color-default-light: var(--mui-palette-default-light);
|
|
68
|
+
--color-default-dark: var(--mui-palette-default-dark);
|
|
69
|
+
--color-default-contrast: var(--mui-palette-default-contrastText);
|
|
70
|
+
--color-default-related-light: var(--mui-palette-default-relatedLight);
|
|
71
|
+
--color-default-related-dark: var(--mui-palette-default-relatedDark);
|
|
72
|
+
--color-default-background: var(--mui-palette-default-background);
|
|
73
|
+
--color-text-primary: var(--mui-palette-text-primary);
|
|
74
|
+
--color-text-secondary: var(--mui-palette-text-secondary);
|
|
75
|
+
--color-text-disabled: var(--mui-palette-text-disabled);
|
|
76
|
+
--color-background: var(--mui-palette-background-default);
|
|
77
|
+
--color-paper: var(--mui-palette-background-paper);
|
|
78
|
+
--color-divider: var(--mui-palette-divider);
|
|
79
|
+
--color-action-active: var(--mui-palette-action-active);
|
|
80
|
+
--color-action-hover: var(--mui-palette-action-hover);
|
|
81
|
+
--color-action-disabled-background: var(--mui-palette-action-disabledBackground);
|
|
82
|
+
--color-action-disabled: var(--mui-palette-action-disabled);
|
|
83
|
+
--color-action-selected: var(--mui-palette-action-selected);
|
|
84
|
+
--color-action-focus: var(--mui-palette-action-focus);
|
|
85
|
+
--color-common-white: var(--mui-palette-common-white);
|
|
86
|
+
--color-common-black: var(--mui-palette-common-black);
|
|
87
|
+
--color-grey-50: var(--mui-palette-grey-50);
|
|
88
|
+
--color-grey-100: var(--mui-palette-grey-100);
|
|
89
|
+
--color-grey-200: var(--mui-palette-grey-200);
|
|
90
|
+
--color-grey-300: var(--mui-palette-grey-300);
|
|
91
|
+
--color-grey-400: var(--mui-palette-grey-400);
|
|
92
|
+
--color-grey-500: var(--mui-palette-grey-500);
|
|
93
|
+
--color-grey-600: var(--mui-palette-grey-600);
|
|
94
|
+
--color-grey-700: var(--mui-palette-grey-700);
|
|
95
|
+
--color-grey-800: var(--mui-palette-grey-800);
|
|
96
|
+
--color-grey-900: var(--mui-palette-grey-900);
|
|
97
|
+
--color-grey-A100: var(--mui-palette-grey-A100);
|
|
98
|
+
--color-grey-A200: var(--mui-palette-grey-A200);
|
|
99
|
+
--color-grey-A400: var(--mui-palette-grey-A400);
|
|
100
|
+
--color-grey-A700: var(--mui-palette-grey-A700);
|
|
101
|
+
--color-brand-navy-blue: var(--mui-palette-brand-navyBlue);
|
|
102
|
+
--color-brand-location-red: var(--mui-palette-brand-locationRed);
|
|
103
|
+
--color-brand-prediction-blue: var(--mui-palette-brand-predictionBlue);
|
|
104
|
+
--color-brand-soft-blue: var(--mui-palette-brand-softBlue);
|
|
105
|
+
--color-brand-app-bar-main: var(--mui-palette-brand-appBarMain);
|
|
106
|
+
--color-brand-app-bar-contrast-text: var(--mui-palette-brand-appBarContrastText);
|
|
107
|
+
--color-white-4: var(--mui-palette-white-4);
|
|
108
|
+
--color-white-8: var(--mui-palette-white-8);
|
|
109
|
+
--color-white-12: var(--mui-palette-white-12);
|
|
110
|
+
--color-white-25: var(--mui-palette-white-25);
|
|
111
|
+
--color-white-40: var(--mui-palette-white-40);
|
|
112
|
+
--color-white-60: var(--mui-palette-white-60);
|
|
113
|
+
--color-white-90: var(--mui-palette-white-90);
|
|
114
|
+
--color-black-4: var(--mui-palette-black-4);
|
|
115
|
+
--color-black-8: var(--mui-palette-black-8);
|
|
116
|
+
--color-black-12: var(--mui-palette-black-12);
|
|
117
|
+
--color-black-25: var(--mui-palette-black-25);
|
|
118
|
+
--color-black-40: var(--mui-palette-black-40);
|
|
119
|
+
--color-black-60: var(--mui-palette-black-60);
|
|
120
|
+
--color-black-90: var(--mui-palette-black-90);
|
|
121
|
+
--color-qualitative-0: var(--mui-palette-qualitative-bold-0);
|
|
122
|
+
--color-qualitative-1: var(--mui-palette-qualitative-bold-1);
|
|
123
|
+
--color-qualitative-2: var(--mui-palette-qualitative-bold-2);
|
|
124
|
+
--color-qualitative-3: var(--mui-palette-qualitative-bold-3);
|
|
125
|
+
--color-qualitative-4: var(--mui-palette-qualitative-bold-4);
|
|
126
|
+
--color-qualitative-5: var(--mui-palette-qualitative-bold-5);
|
|
127
|
+
--color-qualitative-6: var(--mui-palette-qualitative-bold-6);
|
|
128
|
+
--color-qualitative-7: var(--mui-palette-qualitative-bold-7);
|
|
129
|
+
--color-qualitative-8: var(--mui-palette-qualitative-bold-8);
|
|
130
|
+
--color-qualitative-9: var(--mui-palette-qualitative-bold-9);
|
|
131
|
+
--color-qualitative-10: var(--mui-palette-qualitative-bold-10);
|
|
132
|
+
--color-qualitative-11: var(--mui-palette-qualitative-bold-11);
|
|
133
|
+
--shadow-1: var(--mui-shadows-1);
|
|
134
|
+
--shadow-2: var(--mui-shadows-2);
|
|
135
|
+
--shadow-3: var(--mui-shadows-3);
|
|
136
|
+
--shadow-4: var(--mui-shadows-4);
|
|
137
|
+
--shadow-5: var(--mui-shadows-5);
|
|
138
|
+
--shadow-6: var(--mui-shadows-6);
|
|
139
|
+
--shadow-7: var(--mui-shadows-7);
|
|
140
|
+
--shadow-8: var(--mui-shadows-8);
|
|
141
|
+
--shadow-9: var(--mui-shadows-9);
|
|
142
|
+
--shadow-10: var(--mui-shadows-10);
|
|
143
|
+
--shadow-11: var(--mui-shadows-11);
|
|
144
|
+
--shadow-12: var(--mui-shadows-12);
|
|
145
|
+
--shadow-13: var(--mui-shadows-13);
|
|
146
|
+
--shadow-14: var(--mui-shadows-14);
|
|
147
|
+
--shadow-15: var(--mui-shadows-15);
|
|
148
|
+
--shadow-16: var(--mui-shadows-16);
|
|
149
|
+
--shadow-17: var(--mui-shadows-17);
|
|
150
|
+
--shadow-18: var(--mui-shadows-18);
|
|
151
|
+
--shadow-19: var(--mui-shadows-19);
|
|
152
|
+
--shadow-20: var(--mui-shadows-20);
|
|
153
|
+
--shadow-21: var(--mui-shadows-21);
|
|
154
|
+
--shadow-22: var(--mui-shadows-22);
|
|
155
|
+
--shadow-23: var(--mui-shadows-23);
|
|
156
|
+
--shadow-24: var(--mui-shadows-24);
|
|
157
|
+
--radius-theme: var(--mui-shape-borderRadius);
|
|
158
|
+
--radius-theme-half: calc(var(--mui-shape-borderRadius) * 0.5);
|
|
159
|
+
--radius-theme-2: calc(var(--mui-shape-borderRadius) * 2);
|
|
160
|
+
--radius-theme-3: calc(var(--mui-shape-borderRadius) * 3);
|
|
161
|
+
--radius-theme-4: calc(var(--mui-shape-borderRadius) * 4);
|
|
162
|
+
--breakpoint-xs: 320px;
|
|
163
|
+
--breakpoint-sm: 600px;
|
|
164
|
+
--breakpoint-md: 960px;
|
|
165
|
+
--breakpoint-lg: 1280px;
|
|
166
|
+
--breakpoint-xl: 1600px;
|
|
167
|
+
--breakpoint-2xl: initial;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@theme {
|
|
171
|
+
--spacing: calc(var(--mui-spacing) / 2);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@utility typography-h1 {
|
|
175
|
+
font-family: Inter, sans-serif;
|
|
176
|
+
font-weight: 600;
|
|
177
|
+
font-size: 3.5rem;
|
|
178
|
+
line-height: 1.167;
|
|
179
|
+
letter-spacing: -1.5px;
|
|
180
|
+
@media (min-width:600px) {
|
|
181
|
+
font-size: 4.7129rem;
|
|
182
|
+
}
|
|
183
|
+
@media (min-width:960px) {
|
|
184
|
+
font-size: 5.3556rem;
|
|
185
|
+
}
|
|
186
|
+
@media (min-width:1280px) {
|
|
187
|
+
font-size: 6rem;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
@utility typography-h2 {
|
|
192
|
+
font-family: Inter, sans-serif;
|
|
193
|
+
font-weight: 600;
|
|
194
|
+
font-size: 2.375rem;
|
|
195
|
+
line-height: 1.2;
|
|
196
|
+
letter-spacing: -0.5px;
|
|
197
|
+
@media (min-width:600px) {
|
|
198
|
+
font-size: 2.9167rem;
|
|
199
|
+
}
|
|
200
|
+
@media (min-width:960px) {
|
|
201
|
+
font-size: 3.3333rem;
|
|
202
|
+
}
|
|
203
|
+
@media (min-width:1280px) {
|
|
204
|
+
font-size: 3.75rem;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@utility typography-h3 {
|
|
209
|
+
font-family: Inter, sans-serif;
|
|
210
|
+
font-weight: 600;
|
|
211
|
+
font-size: 2rem;
|
|
212
|
+
line-height: 1.167;
|
|
213
|
+
letter-spacing: 0;
|
|
214
|
+
@media (min-width:600px) {
|
|
215
|
+
font-size: 2.5707rem;
|
|
216
|
+
}
|
|
217
|
+
@media (min-width:960px) {
|
|
218
|
+
font-size: 2.7849rem;
|
|
219
|
+
}
|
|
220
|
+
@media (min-width:1280px) {
|
|
221
|
+
font-size: 3rem;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
@utility typography-h4 {
|
|
226
|
+
font-family: Inter, sans-serif;
|
|
227
|
+
font-weight: 600;
|
|
228
|
+
font-size: 1.5rem;
|
|
229
|
+
line-height: 1.25;
|
|
230
|
+
letter-spacing: 0;
|
|
231
|
+
@media (min-width:600px) {
|
|
232
|
+
font-size: 1.8rem;
|
|
233
|
+
}
|
|
234
|
+
@media (min-width:960px) {
|
|
235
|
+
font-size: 1.8rem;
|
|
236
|
+
}
|
|
237
|
+
@media (min-width:1280px) {
|
|
238
|
+
font-size: 2rem;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
@utility typography-h5 {
|
|
243
|
+
font-family: Inter, sans-serif;
|
|
244
|
+
font-weight: 600;
|
|
245
|
+
font-size: 1.25rem;
|
|
246
|
+
line-height: 1.167;
|
|
247
|
+
letter-spacing: 0;
|
|
248
|
+
@media (min-width:600px) {
|
|
249
|
+
font-size: 1.2853rem;
|
|
250
|
+
}
|
|
251
|
+
@media (min-width:960px) {
|
|
252
|
+
font-size: 1.4996rem;
|
|
253
|
+
}
|
|
254
|
+
@media (min-width:1280px) {
|
|
255
|
+
font-size: 1.5rem;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
@utility typography-h6 {
|
|
260
|
+
font-family: Inter, sans-serif;
|
|
261
|
+
font-weight: 500;
|
|
262
|
+
font-size: 1.0625rem;
|
|
263
|
+
line-height: 1.333;
|
|
264
|
+
letter-spacing: 0;
|
|
265
|
+
@media (min-width:600px) {
|
|
266
|
+
font-size: 1.1253rem;
|
|
267
|
+
}
|
|
268
|
+
@media (min-width:960px) {
|
|
269
|
+
font-size: 1.1253rem;
|
|
270
|
+
}
|
|
271
|
+
@media (min-width:1280px) {
|
|
272
|
+
font-size: 1.125rem;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
@utility typography-subtitle1 {
|
|
277
|
+
font-family: Inter, sans-serif;
|
|
278
|
+
font-weight: 500;
|
|
279
|
+
font-size: 1rem;
|
|
280
|
+
line-height: 1.5;
|
|
281
|
+
letter-spacing: 0;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
@utility typography-subtitle2 {
|
|
285
|
+
font-family: Inter, sans-serif;
|
|
286
|
+
font-weight: 600;
|
|
287
|
+
font-size: 0.8125rem;
|
|
288
|
+
line-height: 1.538;
|
|
289
|
+
letter-spacing: 0;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
@utility typography-body1 {
|
|
293
|
+
font-family: Inter, sans-serif;
|
|
294
|
+
font-weight: 400;
|
|
295
|
+
font-size: 1rem;
|
|
296
|
+
line-height: 1.5;
|
|
297
|
+
letter-spacing: 0;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
@utility typography-body2 {
|
|
301
|
+
font-family: Inter, sans-serif;
|
|
302
|
+
font-weight: 400;
|
|
303
|
+
font-size: 0.8125rem;
|
|
304
|
+
line-height: 1.538;
|
|
305
|
+
letter-spacing: 0;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
@utility typography-button {
|
|
309
|
+
font-family: Inter, sans-serif;
|
|
310
|
+
font-weight: 500;
|
|
311
|
+
font-size: 0.8125rem;
|
|
312
|
+
line-height: 1.538;
|
|
313
|
+
letter-spacing: 0;
|
|
314
|
+
text-transform: inherit;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
@utility typography-caption {
|
|
318
|
+
font-family: Inter, sans-serif;
|
|
319
|
+
font-weight: 400;
|
|
320
|
+
font-size: 0.6875rem;
|
|
321
|
+
line-height: 1.454;
|
|
322
|
+
letter-spacing: 0;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
@utility typography-overline {
|
|
326
|
+
font-family: Inter, sans-serif;
|
|
327
|
+
font-weight: 500;
|
|
328
|
+
font-size: 0.625rem;
|
|
329
|
+
line-height: 1.2;
|
|
330
|
+
letter-spacing: 1.2px;
|
|
331
|
+
text-transform: uppercase;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
@utility typography-caption-medium {
|
|
335
|
+
font-family: Inter, sans-serif;
|
|
336
|
+
font-weight: 500;
|
|
337
|
+
font-size: 0.6875rem;
|
|
338
|
+
line-height: 1.454;
|
|
339
|
+
letter-spacing: 0;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
@utility typography-overline-delicate {
|
|
343
|
+
font-family: Inter, sans-serif;
|
|
344
|
+
font-weight: 400;
|
|
345
|
+
font-size: 0.625rem;
|
|
346
|
+
line-height: 1.2;
|
|
347
|
+
letter-spacing: 1.2px;
|
|
348
|
+
text-transform: uppercase;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
@utility typography-code1 {
|
|
352
|
+
font-family: "Overpass Mono", monospace;
|
|
353
|
+
font-weight: 400;
|
|
354
|
+
font-size: 1rem;
|
|
355
|
+
line-height: 1.5;
|
|
356
|
+
letter-spacing: 0;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
@utility typography-code2 {
|
|
360
|
+
font-family: "Overpass Mono", monospace;
|
|
361
|
+
font-weight: 400;
|
|
362
|
+
font-size: 0.875rem;
|
|
363
|
+
line-height: 1.428;
|
|
364
|
+
letter-spacing: 0;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
@utility typography-code3 {
|
|
368
|
+
font-family: "Overpass Mono", monospace;
|
|
369
|
+
font-weight: 400;
|
|
370
|
+
font-size: 0.75rem;
|
|
371
|
+
line-height: 1.333;
|
|
372
|
+
letter-spacing: 0;
|
|
373
|
+
}
|
package/dist/theme.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { createTheme as e, responsiveFontSizes as t } from "@mui/material";
|
|
2
|
+
import { cartoThemeOptions as n } from "@carto/meridian-ds/theme";
|
|
3
|
+
//#region src/theme/deep-merge.ts
|
|
4
|
+
function r(e) {
|
|
5
|
+
if (typeof e != "object" || !e) return !1;
|
|
6
|
+
let t = Object.getPrototypeOf(e);
|
|
7
|
+
return t === Object.prototype || t === null;
|
|
8
|
+
}
|
|
9
|
+
function i(e, t) {
|
|
10
|
+
if (!r(e) || !r(t)) return t === void 0 ? e : t;
|
|
11
|
+
let n = { ...e };
|
|
12
|
+
for (let [r, a] of Object.entries(t)) a !== void 0 && (n[r] = i(e[r], a));
|
|
13
|
+
return n;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/theme/create-carto-theme.ts
|
|
17
|
+
function a(r) {
|
|
18
|
+
let a = i({
|
|
19
|
+
...n,
|
|
20
|
+
cssVariables: !0
|
|
21
|
+
}, r);
|
|
22
|
+
return t(e(a));
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/theme/generate-tailwind-css.ts
|
|
26
|
+
var o = [
|
|
27
|
+
"primary",
|
|
28
|
+
"secondary",
|
|
29
|
+
"tertiary",
|
|
30
|
+
"error",
|
|
31
|
+
"warning",
|
|
32
|
+
"info",
|
|
33
|
+
"success",
|
|
34
|
+
"neutral",
|
|
35
|
+
"default"
|
|
36
|
+
], s = {
|
|
37
|
+
main: "",
|
|
38
|
+
light: "-light",
|
|
39
|
+
dark: "-dark",
|
|
40
|
+
contrastText: "-contrast",
|
|
41
|
+
relatedLight: "-related-light",
|
|
42
|
+
relatedDark: "-related-dark",
|
|
43
|
+
background: "-background"
|
|
44
|
+
}, c = "/*\n * Generated by generateTailwindCss() from @carto/ps-react-ui/theme.\n * Do not edit by hand: regenerate it whenever the theme changes.\n *\n * Import after `tailwindcss`. Declare the cascade layer order yourself first:\n * theme, base, mui, components, utilities (in that order).\n */";
|
|
45
|
+
function l(e) {
|
|
46
|
+
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
47
|
+
}
|
|
48
|
+
function u(e) {
|
|
49
|
+
return !e || typeof e != "object" ? [] : Object.keys(e).filter((t) => typeof e[t] == "string");
|
|
50
|
+
}
|
|
51
|
+
function d(e) {
|
|
52
|
+
let t = e.palette, n = (e) => `var(--mui-palette-${e})`, r = [];
|
|
53
|
+
for (let e of o) {
|
|
54
|
+
let i = t[e];
|
|
55
|
+
for (let [t, a] of Object.entries(s)) typeof i?.[t] == "string" && r.push(`--color-${e}${a}: ${n(`${e}-${t}`)};`);
|
|
56
|
+
}
|
|
57
|
+
for (let e of [
|
|
58
|
+
"primary",
|
|
59
|
+
"secondary",
|
|
60
|
+
"disabled"
|
|
61
|
+
]) typeof t.text?.[e] == "string" && r.push(`--color-text-${e}: ${n(`text-${e}`)};`);
|
|
62
|
+
r.push(`--color-background: ${n("background-default")};`), r.push(`--color-paper: ${n("background-paper")};`), r.push(`--color-divider: ${n("divider")};`);
|
|
63
|
+
for (let e of u(t.action).filter((e) => !e.endsWith("Channel"))) r.push(`--color-action-${l(e)}: ${n(`action-${e}`)};`);
|
|
64
|
+
for (let e of ["white", "black"]) r.push(`--color-common-${e}: ${n(`common-${e}`)};`);
|
|
65
|
+
for (let e of u(t.grey)) r.push(`--color-grey-${e}: ${n(`grey-${e}`)};`);
|
|
66
|
+
for (let e of u(t.brand)) r.push(`--color-brand-${l(e)}: ${n(`brand-${e}`)};`);
|
|
67
|
+
for (let e of ["white", "black"]) for (let i of u(t[e])) r.push(`--color-${e}-${i}: ${n(`${e}-${i}`)};`);
|
|
68
|
+
let i = t.qualitative?.bold;
|
|
69
|
+
for (let e of u(i)) r.push(`--color-qualitative-${e}: ${n(`qualitative-bold-${e}`)};`);
|
|
70
|
+
return r;
|
|
71
|
+
}
|
|
72
|
+
var f = [
|
|
73
|
+
["half", .5],
|
|
74
|
+
["2", 2],
|
|
75
|
+
["3", 3],
|
|
76
|
+
["4", 4]
|
|
77
|
+
];
|
|
78
|
+
function p(e) {
|
|
79
|
+
return `@theme inline {\n${[
|
|
80
|
+
...d(e),
|
|
81
|
+
...e.shadows.map((e, t) => `--shadow-${t}: var(--mui-shadows-${t});`).slice(1),
|
|
82
|
+
"--radius-theme: var(--mui-shape-borderRadius);",
|
|
83
|
+
...f.map(([e, t]) => `--radius-theme-${e}: calc(var(--mui-shape-borderRadius) * ${t});`),
|
|
84
|
+
...Object.entries(e.breakpoints.values).map(([e, t]) => `--breakpoint-${e}: ${t}px;`),
|
|
85
|
+
"--breakpoint-2xl: initial;"
|
|
86
|
+
].map((e) => ` ${e}`).join("\n")}\n}`;
|
|
87
|
+
}
|
|
88
|
+
var m = "@theme {\n --spacing: calc(var(--mui-spacing) / 2);\n}";
|
|
89
|
+
function h(e, t) {
|
|
90
|
+
return typeof t == "number" && (e === "font-size" || e === "letter-spacing") ? t === 0 ? "0" : `${t}px` : String(t);
|
|
91
|
+
}
|
|
92
|
+
var g = [
|
|
93
|
+
["fontFamily", "font-family"],
|
|
94
|
+
["fontWeight", "font-weight"],
|
|
95
|
+
["fontSize", "font-size"],
|
|
96
|
+
["lineHeight", "line-height"],
|
|
97
|
+
["letterSpacing", "letter-spacing"],
|
|
98
|
+
["textTransform", "text-transform"]
|
|
99
|
+
];
|
|
100
|
+
function _(e) {
|
|
101
|
+
let t = e.typography;
|
|
102
|
+
return Object.entries(t).filter(([e, t]) => e !== "inherit" && !!t && typeof t == "object" && "fontSize" in t).map(([e, t]) => {
|
|
103
|
+
let n = t, r = g.filter(([e]) => n[e] !== void 0).map(([e, t]) => ` ${t}: ${h(t, n[e])};`);
|
|
104
|
+
for (let [e, t] of Object.entries(n)) {
|
|
105
|
+
if (!e.startsWith("@media") || !t || typeof t != "object") continue;
|
|
106
|
+
let n = t.fontSize;
|
|
107
|
+
n !== void 0 && r.push(` ${e} {\n font-size: ${h("font-size", n)};\n }`);
|
|
108
|
+
}
|
|
109
|
+
return `@utility typography-${l(e)} {\n${r.join("\n")}\n}`;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function v(e) {
|
|
113
|
+
return [
|
|
114
|
+
c,
|
|
115
|
+
p(e),
|
|
116
|
+
m,
|
|
117
|
+
..._(e)
|
|
118
|
+
].join("\n\n") + "\n";
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
export { a as createCartoTheme, v as generateTailwindCss };
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","names":["isPlainObject","value","proto","deepMerge","base","override","out","key","createCartoTheme","options","cartoThemeOptions","overrides","responsiveFontSizes","createTheme","PALETTE_COLORS","COLOR_KEYS","HEADER","kebab","stringKeys","obj","k","colorLines","palette","theme","v","path","lines","name","color","suffix","shade","bold","RADIUS_MULTIPLES","themeBlock","n","px","l","SPACING_BLOCK","cssValue","prop","TYPOGRAPHY_PROPS","typographyUtilities","typography","style","s","body","query","rule","size","generateTailwindCss"],"sources":["../src/theme/deep-merge.ts","../src/theme/create-carto-theme.ts","../src/theme/generate-tailwind-css.ts"],"sourcesContent":["function isPlainObject(value: unknown): value is Record<string, unknown> {\n if (value === null || typeof value !== 'object') return false\n const proto = Object.getPrototypeOf(value) as unknown\n return proto === Object.prototype || proto === null\n}\n\n/**\n * Deep-merges `override` into a copy of `base`. Plain objects merge key by\n * key; arrays, functions and other values replace. `undefined` in the\n * override keeps the base value. Inputs are not mutated.\n */\nexport function deepMerge<T>(base: T, override: unknown): T {\n if (!isPlainObject(base) || !isPlainObject(override)) {\n return (override === undefined ? base : override) as T\n }\n const out: Record<string, unknown> = { ...base }\n for (const [key, value] of Object.entries(override)) {\n if (value === undefined) continue\n out[key] = deepMerge(base[key], value)\n }\n return out as T\n}\n","import {\n createTheme,\n responsiveFontSizes,\n type Theme,\n type ThemeOptions,\n} from '@mui/material'\nimport { cartoThemeOptions } from '@carto/meridian-ds/theme'\nimport { deepMerge } from './deep-merge'\n\n/**\n * The CARTO theme with MUI CSS variables enabled, so CSS (Tailwind's\n * `@theme inline`, plain stylesheets) can read `var(--mui-*)`. Same tokens\n * and responsive font sizes as meridian's `theme`.\n */\nexport function createCartoTheme(overrides?: ThemeOptions): Theme {\n const options = deepMerge<ThemeOptions>(\n { ...cartoThemeOptions, cssVariables: true },\n overrides,\n )\n return responsiveFontSizes(createTheme(options))\n}\n","import type { Theme } from '@mui/material'\n\nconst PALETTE_COLORS = [\n 'primary',\n 'secondary',\n 'tertiary',\n 'error',\n 'warning',\n 'info',\n 'success',\n 'neutral',\n 'default',\n] as const\n\nconst COLOR_KEYS: Record<string, string> = {\n main: '',\n light: '-light',\n dark: '-dark',\n contrastText: '-contrast',\n relatedLight: '-related-light',\n relatedDark: '-related-dark',\n background: '-background',\n}\n\nconst HEADER = `/*\n * Generated by generateTailwindCss() from @carto/ps-react-ui/theme.\n * Do not edit by hand: regenerate it whenever the theme changes.\n *\n * Import after \\`tailwindcss\\`. Declare the cascade layer order yourself first:\n * theme, base, mui, components, utilities (in that order).\n */`\n\ntype Dict = Record<string, unknown>\n\n/** `navyBlue` → `navy-blue`, `captionMedium` → `caption-medium`, `code1` → `code1`. */\nfunction kebab(key: string): string {\n return key.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase()\n}\n\nfunction stringKeys(obj: unknown): string[] {\n if (!obj || typeof obj !== 'object') return []\n return Object.keys(obj).filter((k) => typeof (obj as Dict)[k] === 'string')\n}\n\nfunction colorLines(theme: Theme): string[] {\n const palette = theme.palette as unknown as Dict\n const v = (path: string) => `var(--mui-palette-${path})`\n const lines: string[] = []\n\n for (const name of PALETTE_COLORS) {\n const color = palette[name] as Dict | undefined\n for (const [key, suffix] of Object.entries(COLOR_KEYS)) {\n if (typeof color?.[key] === 'string')\n lines.push(`--color-${name}${suffix}: ${v(`${name}-${key}`)};`)\n }\n }\n for (const key of ['primary', 'secondary', 'disabled']) {\n if (typeof (palette.text as Dict | undefined)?.[key] === 'string')\n lines.push(`--color-text-${key}: ${v(`text-${key}`)};`)\n }\n lines.push(`--color-background: ${v('background-default')};`)\n lines.push(`--color-paper: ${v('background-paper')};`)\n lines.push(`--color-divider: ${v('divider')};`)\n // `*Channel` keys are bare RGB triplets for `rgba()`, not colours.\n for (const key of stringKeys(palette.action).filter(\n (k) => !k.endsWith('Channel'),\n ))\n lines.push(`--color-action-${kebab(key)}: ${v(`action-${key}`)};`)\n for (const key of ['white', 'black'])\n lines.push(`--color-common-${key}: ${v(`common-${key}`)};`)\n for (const key of stringKeys(palette.grey))\n lines.push(`--color-grey-${key}: ${v(`grey-${key}`)};`)\n for (const key of stringKeys(palette.brand))\n lines.push(`--color-brand-${kebab(key)}: ${v(`brand-${key}`)};`)\n for (const shade of ['white', 'black']) {\n for (const key of stringKeys(palette[shade]))\n lines.push(`--color-${shade}-${key}: ${v(`${shade}-${key}`)};`)\n }\n const bold = (palette.qualitative as Dict | undefined)?.bold\n for (const key of stringKeys(bold))\n lines.push(`--color-qualitative-${key}: ${v(`qualitative-bold-${key}`)};`)\n return lines\n}\n\n// `rounded-theme-2` is `theme.shape.borderRadius * 2`, as in sx.\nconst RADIUS_MULTIPLES: [string, number][] = [\n ['half', 0.5],\n ['2', 2],\n ['3', 3],\n ['4', 4],\n]\n\nfunction themeBlock(theme: Theme): string {\n const lines = [\n ...colorLines(theme),\n ...theme.shadows\n .map((_, n) => `--shadow-${n}: var(--mui-shadows-${n});`)\n .slice(1),\n '--radius-theme: var(--mui-shape-borderRadius);',\n ...RADIUS_MULTIPLES.map(\n ([key, n]) =>\n `--radius-theme-${key}: calc(var(--mui-shape-borderRadius) * ${n});`,\n ),\n ...Object.entries(theme.breakpoints.values).map(\n ([key, px]) => `--breakpoint-${key}: ${px}px;`,\n ),\n '--breakpoint-2xl: initial;',\n ]\n return `@theme inline {\\n${lines.map((l) => ` ${l}`).join('\\n')}\\n}`\n}\n\n// Not inline: utilities keep `calc(var(--spacing) * n)`, and `--spacing`\n// follows the theme, so `p-2` is `theme.spacing(1)` (8px by default) even\n// when an app overrides `spacing`.\nconst SPACING_BLOCK = `@theme {\\n --spacing: calc(var(--mui-spacing) / 2);\\n}`\n\nfunction cssValue(prop: string, value: unknown): string {\n if (\n typeof value === 'number' &&\n (prop === 'font-size' || prop === 'letter-spacing')\n )\n return value === 0 ? '0' : `${value}px`\n return String(value)\n}\n\nconst TYPOGRAPHY_PROPS: [string, string][] = [\n ['fontFamily', 'font-family'],\n ['fontWeight', 'font-weight'],\n ['fontSize', 'font-size'],\n ['lineHeight', 'line-height'],\n ['letterSpacing', 'letter-spacing'],\n ['textTransform', 'text-transform'],\n]\n\nfunction typographyUtilities(theme: Theme): string[] {\n const typography = theme.typography as unknown as Dict\n return Object.entries(typography)\n .filter(\n ([name, style]) =>\n name !== 'inherit' &&\n !!style &&\n typeof style === 'object' &&\n 'fontSize' in style,\n )\n .map(([name, style]) => {\n const s = style as Dict\n const body = TYPOGRAPHY_PROPS.filter(([key]) => s[key] !== undefined).map(\n ([key, prop]) => ` ${prop}: ${cssValue(prop, s[key])};`,\n )\n for (const [query, rule] of Object.entries(s)) {\n if (!query.startsWith('@media') || !rule || typeof rule !== 'object')\n continue\n const size = (rule as Dict).fontSize\n if (size !== undefined)\n body.push(\n ` ${query} {\\n font-size: ${cssValue('font-size', size)};\\n }`,\n )\n }\n return `@utility typography-${kebab(name)} {\\n${body.join('\\n')}\\n}`\n })\n}\n\n/**\n * Tailwind v4 source CSS for the CARTO theme: colours, shadows and radius\n * read the runtime MUI variables; breakpoints and typography are literals\n * because `@media` cannot read variables and MUI's font variables are not\n * responsive.\n */\nexport function generateTailwindCss(theme: Theme): string {\n return (\n [\n HEADER,\n themeBlock(theme),\n SPACING_BLOCK,\n ...typographyUtilities(theme),\n ].join('\\n\\n') + '\\n'\n )\n}\n"],"mappings":";;;AAAA,SAASA,EAAc,GAAkD;CACvE,IAAsB,OAAOC,KAAU,aAAnCA,GAA6C,OAAO;CACxD,IAAMC,IAAQ,OAAO,eAAeD,CAAK;CACzC,OAAOC,MAAU,OAAO,aAAaA,MAAU;AACjD;AAOA,SAAgBC,EAAa,GAAS,GAAsB;CAC1D,IAAI,CAACH,EAAcI,CAAI,KAAK,CAACJ,EAAcK,CAAQ,GACjD,OAAQA,MAAa,KAAA,IAAYD,IAAOC;CAE1C,IAAMC,IAA+B,EAAE,GAAGF,EAAK;CAC/C,KAAK,IAAM,CAACG,GAAKN,MAAU,OAAO,QAAQI,CAAQ,GAChD,AAAIJ,MAAU,KAAA,MACd,EAAIM,KAAOJ,EAAUC,EAAKG,IAAMN,CAAK;CAEvC,OAAOK;AACT;;;ACPA,SAAgBE,EAAiB,GAAiC;CAChE,IAAMC,IAAUN,EACd;EAAE,GAAGO;EAAmB,cAAc;CAAK,GAC3CC,CACF;CACA,OAAOC,EAAoBC,EAAYJ,CAAO,CAAC;AACjD;;;AClBA,IAAMK,IAAiB;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEMC,IAAqC;CACzC,MAAM;CACN,OAAO;CACP,MAAM;CAC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BI,EAAoB,GAAsB;CACxD,OACE;EACEjC;EACAiB,EAAWV,CAAK;EAChBc;EACA,GAAGI,EAAoBlB,CAAK;CAC9B,CAAC,CAAC,KAAK,MAAM,IAAI;AAErB"}
|
|
@@ -14,7 +14,7 @@ export declare const styles: {
|
|
|
14
14
|
justifyContent: "flex-start";
|
|
15
15
|
overflow: "hidden";
|
|
16
16
|
width: string;
|
|
17
|
-
'&.inline': {
|
|
17
|
+
'&.PsLassoTools-inline': {
|
|
18
18
|
flexDirection: "column";
|
|
19
19
|
alignItems: "flex-start";
|
|
20
20
|
gap: ({ spacing }: Theme) => string;
|
|
@@ -46,7 +46,7 @@ export declare const styles: {
|
|
|
46
46
|
maxHeight: string;
|
|
47
47
|
};
|
|
48
48
|
paddingY: ({ spacing }: Theme) => string;
|
|
49
|
-
'&.inline': {
|
|
49
|
+
'&.PsLassoTools-inline': {
|
|
50
50
|
boxShadow: "none";
|
|
51
51
|
backgroundColor: "transparent";
|
|
52
52
|
borderRadius: ({ spacing }: Theme) => string;
|
|
@@ -109,7 +109,7 @@ export declare const styles: {
|
|
|
109
109
|
title: {
|
|
110
110
|
paddingX: ({ spacing }: Theme) => string;
|
|
111
111
|
paddingBottom: ({ spacing }: Theme) => string;
|
|
112
|
-
'&.inline': {
|
|
112
|
+
'&.PsLassoTools-inline': {
|
|
113
113
|
paddingX: number;
|
|
114
114
|
paddingBottom: number;
|
|
115
115
|
};
|
|
@@ -138,7 +138,7 @@ export declare const styles: {
|
|
|
138
138
|
overflowX: "auto";
|
|
139
139
|
scrollbarWidth: "none";
|
|
140
140
|
paddingX: ({ spacing }: Theme) => string;
|
|
141
|
-
'&.inline': {
|
|
141
|
+
'&.PsLassoTools-inline': {
|
|
142
142
|
overflowX: "visible";
|
|
143
143
|
flexWrap: "wrap";
|
|
144
144
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Theme, ThemeOptions } from '@mui/material';
|
|
2
|
+
/**
|
|
3
|
+
* The CARTO theme with MUI CSS variables enabled, so CSS (Tailwind's
|
|
4
|
+
* `@theme inline`, plain stylesheets) can read `var(--mui-*)`. Same tokens
|
|
5
|
+
* and responsive font sizes as meridian's `theme`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createCartoTheme(overrides?: ThemeOptions): Theme;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deep-merges `override` into a copy of `base`. Plain objects merge key by
|
|
3
|
+
* key; arrays, functions and other values replace. `undefined` in the
|
|
4
|
+
* override keeps the base value. Inputs are not mutated.
|
|
5
|
+
*/
|
|
6
|
+
export declare function deepMerge<T>(base: T, override: unknown): T;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
/**
|
|
3
|
+
* Tailwind v4 source CSS for the CARTO theme: colours, shadows and radius
|
|
4
|
+
* read the runtime MUI variables; breakpoints and typography are literals
|
|
5
|
+
* because `@media` cannot read variables and MUI's font variables are not
|
|
6
|
+
* responsive.
|
|
7
|
+
*/
|
|
8
|
+
export declare function generateTailwindCss(theme: Theme): string;
|
|
@@ -3,7 +3,7 @@ export { StackToggle, addStack, DEFAULT_STACK_TOGGLE_LABELS, type StackTogglePro
|
|
|
3
3
|
export { ShowAllToggle, setShowAll, SHOW_ALL_ID, DEFAULT_SHOW_ALL_LABELS, type ShowAllToggleProps, type ShowAllLabels, } from './show-all/index.js';
|
|
4
4
|
export { ZoomToggle, addZoom, createAddZoom, ZOOM_LAYOUT, DEFAULT_ZOOM_TOGGLE_LABELS, type ZoomToggleProps, type ZoomToggleLabels, } from './zoom-toggle/index.js';
|
|
5
5
|
export { BrushToggle, addBrush, DEFAULT_BRUSH_TOGGLE_LABELS, type BrushToggleProps, type BrushToggleLabels, } from './brush-toggle/index.js';
|
|
6
|
-
export { RelativeData, toRelativeData, createPercentFormatter, DEFAULT_RELATIVE_DATA_LABELS, type RelativeDataProps, type RelativeDataLabels, } from './relative-data/index.js';
|
|
6
|
+
export { RelativeData, toRelativeData, createPercentFormatter, DEFAULT_RELATIVE_DATA_LABELS, type RelativeDataProps, type RelativeDataLabels, type RelativeScale, } from './relative-data/index.js';
|
|
7
7
|
export { Download, downloadToCSV, downloadDOMToPNG, toCsvString, triggerLinkDownload, buildPngDownloadItem, buildCsvDownloadItem, withPngItem, CSVIcon, PNGIcon, MarkdownIcon, DEFAULT_DOWNLOAD_LABELS, DOWNLOAD_ITEM_IDS, type DownloadProps, type DownloadItem, type DownloadContext, type DownloadItemId, type DownloadHandle, type DownloadDOMToPNGOptions, type BuildPngDownloadItemArgs, type BuildCsvDownloadItemArgs, type WidgetDownloadArgs, type DownloadLabels, } from './download/index.js';
|
|
8
8
|
export { FullScreen, DEFAULT_FULLSCREEN_LABELS, type FullScreenTriggerProps, type FullScreenSlotProps, type FullScreenLabels, type FullScreenWidgetState, } from './fullscreen/index.js';
|
|
9
9
|
export { LockSelection, filterByLockedItems, DEFAULT_LOCK_SELECTION_LABELS, type LockSelectionProps, type LockSelectionKey, type LockSelectionLabels, } from './lock-selection/index.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { RelativeData, type RelativeDataProps } from './relative-data.js';
|
|
2
2
|
export { toRelativeData, createPercentFormatter } from './transforms.js';
|
|
3
|
+
export type { RelativeScale } from './scale.js';
|
|
3
4
|
export { DEFAULT_RELATIVE_DATA_LABELS, type RelativeDataLabels } from './labels.js';
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
2
|
import { SvgIconProps } from '@mui/material';
|
|
3
|
+
import { RelativeScale } from './scale.js';
|
|
3
4
|
import { RelativeDataLabels } from './labels.js';
|
|
4
5
|
export interface RelativeDataProps {
|
|
5
6
|
initialEnabled?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Initial bar scale: `'max'` (the largest item fills its bar) or
|
|
9
|
+
* `'total'` (bars end at 100%). Values are the share of the total
|
|
10
|
+
* either way. Only seeds the store — the menu, or a write to
|
|
11
|
+
* `transformStates['relative-data'].scale`, changes it afterwards.
|
|
12
|
+
*/
|
|
13
|
+
scale?: RelativeScale;
|
|
6
14
|
/**
|
|
7
15
|
* BCP-47 locale tag forwarded to `Intl.NumberFormat`. Defaults to the
|
|
8
16
|
* runtime locale.
|
|
@@ -25,7 +33,8 @@ export interface RelativeDataProps {
|
|
|
25
33
|
transform?: (data: unknown) => unknown;
|
|
26
34
|
}
|
|
27
35
|
/**
|
|
28
|
-
* Toggle between absolute and relative (percentage) values
|
|
36
|
+
* Toggle between absolute and relative (percentage) values, as a split
|
|
37
|
+
* button: the toggle plus an arrow that opens the scale menu.
|
|
29
38
|
*
|
|
30
39
|
* - **Data side**: a single data transform ({@link toRelativeData}) registered
|
|
31
40
|
* through `useSingleTransform`. When disabled, the pipeline skips it and the
|
|
@@ -35,5 +44,10 @@ export interface RelativeDataProps {
|
|
|
35
44
|
* reads `state.rawFormatter` (the consumer-supplied original, always live)
|
|
36
45
|
* and writes it back to `formatter`. No "original" snapshot is captured —
|
|
37
46
|
* `rawFormatter` is the original.
|
|
47
|
+
* - **Scale**: lives in `transformStates['relative-data'].scale` next to
|
|
48
|
+
* `enabled`, so duplicate mounts (Toolbox inline + overflow) and
|
|
49
|
+
* `keepAlive` remounts agree on it. It never changes the values; under
|
|
50
|
+
* `'total'` a config transform pins the ECharts value axis to 100%, and
|
|
51
|
+
* Category reads it through `selectRelativeScale`.
|
|
38
52
|
*/
|
|
39
|
-
export declare function RelativeData({ initialEnabled, locale, labels, icon: Icon, iconProps, transform, }: RelativeDataProps): import('react').JSX.Element;
|
|
53
|
+
export declare function RelativeData({ initialEnabled, scale: initialScale, locale, labels, icon: Icon, iconProps, transform, }: RelativeDataProps): import('react').JSX.Element;
|