mistercrunch commented on code in PR #31590:
URL: https://github.com/apache/superset/pull/31590#discussion_r1930923681


##########
superset-frontend/packages/superset-ui-core/src/theme/types.ts:
##########
@@ -0,0 +1,334 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/* eslint-disable @typescript-eslint/no-unused-vars */
+// eslint-disable-next-line no-restricted-syntax
+import { theme as antdThemeImport } from 'antd-v5';
+
+/**
+ * Grab all antd tokens via getDesignToken(...).
+ * (Same as in the original file.)
+ */
+export type AntdTokens = ReturnType<typeof antdThemeImport.getDesignToken>;
+
+/** Minimal color system references. */
+export interface SystemColors {
+  colorPrimary: string;
+  colorError: string;
+  colorWarning: string;
+  colorSuccess: string;
+  colorInfo: string;
+}
+
+export interface ColorVariants {
+  bg: string;
+  border: string;
+  hover: string;
+  active: string;
+  textHover: string;
+  text: string;
+  borderHover: string;
+  bgHover: string;
+  textActive: string;
+}
+
+export interface DeprecatedColorVariations {
+  base: string;
+  light1: string;
+  light2: string;
+  light3: string;
+  light4: string;
+  light5: string;
+  dark1: string;
+  dark2: string;
+  dark3: string;
+  dark4: string;
+  dark5: string;
+}
+
+export interface DeprecatedThemeColors {
+  primary: DeprecatedColorVariations;
+  error: DeprecatedColorVariations;
+  warning: DeprecatedColorVariations;
+  success: DeprecatedColorVariations;
+  info: DeprecatedColorVariations;
+  grayscale: DeprecatedColorVariations;
+}
+
+export interface LegacySupersetTheme {
+  // Old colors structure with light/dark semantics still heavily referenced 
in code base
+  // TODO: replace/realign with antd-type tokens
+  colors: DeprecatedThemeColors;
+  transitionTiming: number;
+}
+
+export interface SupersetSpecificTokens {
+  // Brand-related
+  brandIconMaxWidth: number;
+
+  // Font-related
+  fontSizeXS: string;
+  fontSizeXXL: string;
+  fontWeightNormal: string;
+  fontWeightLight: string;
+  fontWeightMedium: string;
+}
+
+/**
+ * This array is used to define which keys from the full Antd token set
+ * we actually allow in the SupersetTheme.
+ */
+export const allowedAntdTokens = [

Review Comment:
   One thing that's great about inheriting a whole set of 1:1 mapped token from 
AntD is that they are all pretty well thought-through, applied to perfection in 
the AntD components we use, well described in their docs, and well-typed as 
well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to