Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix tokens

Jonathan Summers-Muirfe74f5656a45
diff --git a/packages/config/tailwind.config.js b/packages/config/tailwind.config.js
index ccaeca2cd4e..49c3ee3a3e8 100644
--- a/packages/config/tailwind.config.js
+++ b/packages/config/tailwind.config.js
@@ -6,14 +6,13 @@ const color = require('./../ui/build/css/tw-extend/color')
/**
*
*/
-const colorExtend = {}
+let colorExtend = {}
Object.values(color).map((x, i) => {
- colorExtend[Object.keys(color)[i]] = x.cssVariable
+ colorExtend[Object.keys(color)[i]] = `hsl(${x.cssVariable} / <alpha-value>)` // x.cssVariable
})
-// console.log('colorExtend', colorExtend)
-
-// console.log('colorExtend', kebabToNested(colorExtend))
+console.log('colorExtend', colorExtend)
+console.log('colorExtend', kebabToNested(colorExtend))
// console.log('colorExtend', kebabToNested(colorExtend).colors.gray)
@@ -49,7 +48,7 @@ function kebabToNested(obj) {
const parts = key.split('-')
let currentObj = result
for (let i = 0; i < parts.length; i++) {
- const part = parts[i].toLowerCase() // convert key to lowercase
+ const part = parts[i] === 'DEFAULT' ? parts[i] : parts[i].toLowerCase() // convert key to lowercase
if (!currentObj[part]) {
currentObj[part] = {}
}
@@ -90,6 +89,9 @@ const uiConfig = ui({
...generateTwColorClasses('border', color),
}),
extend: {
+ colors: {
+ ...kebabToNested(colorExtend),
+ },
typography: ({ theme }) => ({
// Removal of backticks in code blocks for tailwind v3.0
// https://github.com/tailwindlabs/tailwindcss-typography/issues/135
@@ -319,9 +321,6 @@ const uiConfig = ui({
sans: ['Circular', 'custom-font', 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif'],
mono: ['Office Code Pro', 'Source Code Pro', 'Menlo', 'monospace'],
},
- color: {
- ...kebabToNested(colorExtend),
- },
},
},
plugins: [require('@tailwindcss/typography')],
diff --git a/packages/config/ui.config.js b/packages/config/ui.config.js
index 96cf6ae71a7..28212e46947 100644
--- a/packages/config/ui.config.js
+++ b/packages/config/ui.config.js
@@ -290,6 +290,10 @@ const uiConfig = {
...colorClasses,
'hi-contrast': `var(--colors-fixed-scale12)`,
'lo-contrast': `var(--colors-fixed-scale1)`,
+ warning: {
+ default: 'red',
+ 100: '#342355',
+ },
},
},
},
diff --git a/packages/ui/.storybook/preview.css b/packages/ui/.storybook/preview.css
index 74148a079dd..ca8e28a9a0f 100644
--- a/packages/ui/.storybook/preview.css
+++ b/packages/ui/.storybook/preview.css
@@ -73,9 +73,9 @@
}
@layer base {
- * {
+ /* * {
@apply border-border;
- }
+ } */
body {
@apply bg-background text-foreground;
font-feature-settings: 'rlig' 1, 'calt' 1;
@@ -101,9 +101,9 @@
}
@layer base {
- * {
+ /* * {
@apply border-border;
- }
+ } */
body {
@apply bg-background text-foreground;
font-feature-settings: 'rlig' 1, 'calt' 1;
diff --git a/packages/ui/.storybook/shadcn.css b/packages/ui/.storybook/shadcn.css
index f5cf75c0ce2..b7e2bafa992 100644
--- a/packages/ui/.storybook/shadcn.css
+++ b/packages/ui/.storybook/shadcn.css
@@ -1,78 +1,78 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
-
+
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 224 71.4% 4.1%;
-
+
--muted: 220 14.3% 95.9%;
--muted-foreground: 220 8.9% 46.1%;
-
+
--popover: 0 0% 100%;
--popover-foreground: 224 71.4% 4.1%;
-
+
--card: 0 0% 100%;
--card-foreground: 224 71.4% 4.1%;
-
+
--border: 220 13% 91%;
--input: 220 13% 91%;
-
+
--primary: 220.9 39.3% 11%;
--primary-foreground: 210 20% 98%;
-
+
--secondary: 220 14.3% 95.9%;
--secondary-foreground: 220.9 39.3% 11%;
-
+
--accent: 220 14.3% 95.9%;
--accent-foreground: 220.9 39.3% 11%;
-
+
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 210 20% 98%;
-
+
--ring: 217.9 10.6% 64.9%;
-
+
--radius: 0.5rem;
}
-
+
.dark {
--background: 224 71.4% 4.1%;
--foreground: 210 20% 98%;
-
+
--muted: 215 27.9% 16.9%;
--muted-foreground: 217.9 10.6% 64.9%;
-
+
--popover: 224 71.4% 4.1%;
--popover-foreground: 210 20% 98%;
-
+
--card: 224 71.4% 4.1%;
--card-foreground: 210 20% 98%;
-
+
--border: 215 27.9% 16.9%;
--input: 215 27.9% 16.9%;
-
+
--primary: 210 20% 98%;
--primary-foreground: 220.9 39.3% 11%;
-
+
--secondary: 215 27.9% 16.9%;
--secondary-foreground: 210 20% 98%;
-
+
--accent: 215 27.9% 16.9%;
--accent-foreground: 210 20% 98%;
-
+
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 85.7% 97.3%;
-
+
--ring: 215 27.9% 16.9%;
}
}
-
+
@layer base {
- * {
+ /* * {
@apply border-border;
- }
+ } */
body {
@apply bg-background text-foreground;
}
-}
\ No newline at end of file
+}
diff --git a/packages/ui/build/css/source/global.css b/packages/ui/build/css/source/global.css
index 4711d6d54a1..ff9f4bbc820 100644
--- a/packages/ui/build/css/source/global.css
+++ b/packages/ui/build/css/source/global.css
@@ -1,6 +1,6 @@
/**
* Do not edit directly
- * Generated on Sun, 25 Jun 2023 18:14:28 GMT
+ * Generated on Tue, 27 Jun 2023 13:59:53 GMT
*/
:root {
diff --git a/packages/ui/build/css/themes/dark.css b/packages/ui/build/css/themes/dark.css
index 6407034e256..0de3fccb7bf 100644
--- a/packages/ui/build/css/themes/dark.css
+++ b/packages/ui/build/css/themes/dark.css
@@ -1,13 +1,18 @@
/**
* Do not edit directly
- * Generated on Sun, 25 Jun 2023 18:14:28 GMT
+ * Generated on Tue, 27 Jun 2023 13:59:53 GMT
*/
.dark {
+ --warning-default: 38.9deg 100% 57.1%;
+ --warning-400: 0deg 0% 8.6%;
+ --warning-300: 36.3deg 93.5% 18%;
+ --warning-200: 38.8deg 97.4% 69.8%;
--destructive-default: 358.1deg 75.1% 59%;
--destructive-400: 0deg 0% 8.6%;
--destructive-300: 0deg 40.8% 19.2%;
--destructive-200: 0deg 97% 74.1%;
+ --background-sputnik: 107.9deg 95.1% 60.2%;
--background-secondary: 0deg 0% 100%;
--background-muted: 0deg 0% 100%;
--foreground-muted: 0deg 0% 100%;
diff --git a/packages/ui/build/css/themes/light.css b/packages/ui/build/css/themes/light.css
index 1506fab6ef8..dd735c12c32 100644
--- a/packages/ui/build/css/themes/light.css
+++ b/packages/ui/build/css/themes/light.css
@@ -1,13 +1,18 @@
/**
* Do not edit directly
- * Generated on Sun, 25 Jun 2023 18:14:29 GMT
+ * Generated on Tue, 27 Jun 2023 13:59:53 GMT
*/
.light {
+ --warning-default: 38.9deg 100% 57.1%;
+ --warning-400: 38.7deg 100% 93.9%;
+ --warning-300: 38.6deg 100% 89%;
+ --warning-200: 39deg 100% 75.3%;
--destructive-default: 0deg 100% 50%;
--destructive-400: 0deg 100% 98.4%;
--destructive-300: 0deg 100% 87.5%;
--destructive-200: 0deg 97% 74.1%;
+ --background-sputnik: 60deg 100% 50%;
--background-alternative: 0deg 0% 100%;
--background-secondary: 0deg 0% 100%;
--background-muted: 0deg 0% 100%;
diff --git a/packages/ui/build/css/tw-extend/color.js b/packages/ui/build/css/tw-extend/color.js
index 5c39e43a41d..5da22f02c6b 100644
--- a/packages/ui/build/css/tw-extend/color.js
+++ b/packages/ui/build/css/tw-extend/color.js
@@ -447,6 +447,10 @@ module.exports = {
cssVariable: "var(--background-alternative)",
value: "hsl(0, 0%, 8.6%)"
},
+"background-sputnik": {
+ cssVariable: "var(--background-sputnik)",
+ value: "hsl(107.89999999999998, 95.1%, 60.2%)"
+},
"border-DEFAULT": {
cssVariable: "var(--border-default)",
value: "hsl(0, 0%, 15.7%)"
@@ -482,5 +486,21 @@ module.exports = {
"destructive-DEFAULT": {
cssVariable: "var(--destructive-default)",
value: "hsl(358.1, 75.1%, 59%)"
+},
+"warning-200": {
+ cssVariable: "var(--warning-200)",
+ value: "hsl(38.80000000000001, 97.4%, 69.8%)"
+},
+"warning-300": {
+ cssVariable: "var(--warning-300)",
+ value: "hsl(36.30000000000001, 93.5%, 18%)"
+},
+"warning-400": {
+ cssVariable: "var(--warning-400)",
+ value: "hsl(0, 0%, 8.6%)"
+},
+"warning-DEFAULT": {
+ cssVariable: "var(--warning-default)",
+ value: "hsl(38.89999999999998, 100%, 57.1%)"
}
}
\ No newline at end of file
diff --git a/packages/ui/src/components/shadcn/stories/TEST.stories.tsx b/packages/ui/src/components/shadcn/stories/TEST.stories.tsx
new file mode 100644
index 00000000000..f297a12b9fc
--- /dev/null
+++ b/packages/ui/src/components/shadcn/stories/TEST.stories.tsx
@@ -0,0 +1,26 @@
+import { Meta } from '@storybook/react'
+import { Card } from '@ui/components/shadcn/ui/card'
+import { Mail } from 'lucide-react'
+
+const meta: Meta = {
+ title: 'shadcn/TEST',
+ component: Card,
+}
+
+export const Default = () => {
+ return (
+ <div className="bg-overlay w-96 h-96 border border-overlay rounded-xl p-3">
+ <div className="text">layer 1</div>
+ <div className="shadow-sm bg-warning-400 bg-warning text-warning-300 w-96 h-96 border border-warning-300 rounded-xl p-3">
+ <div className="bg-warning h-8 w-8 text-warning-400 rounded-lg flex items-center justify-center">
+ <Mail size={16} />
+ </div>
+ <div className="bg-sputnik h-8 w-8 text-warning-400 rounded-lg flex items-center justify-center">
+ <Mail size={16} />
+ </div>
+ </div>
+ </div>
+ )
+}
+
+export default meta
diff --git a/packages/ui/tailwind.config.js b/packages/ui/tailwind.config.js
index 4f60165a5c9..4c4b14ec252 100644
--- a/packages/ui/tailwind.config.js
+++ b/packages/ui/tailwind.config.js
@@ -3,13 +3,15 @@ const { fontFamily } = require('tailwindcss/defaultTheme')
module.exports = config({
content: [
- '../../packages/common/**/*.{ts,tsx}',
+ // '../../packages/common/**/*.{ts,tsx}',
'../../packages/ui/**/*.{tsx,ts,js}',
- './pages/**/*.{tsx,mdx}',
- './components/**/*.tsx',
- './layouts/**/*.tsx',
- './src/**/*.{ts,tsx,mdx}',
- './_blog/*.mdx',
+ '../../packages/ui/**/*.*.{tsx,ts,js}',
+ // './pages/**/*.{tsx,mdx}',
+ // './components/**/*.tsx',
+ // './layouts/**/*.tsx',
+ // './src/**/*.{ts,tsx,mdx}',
+ // './_blog/*.mdx',
+ // '../../packages/ui/**/*.stories.{tsx,ts,js}',
],
theme: {
container: {