Feat/design system (#3051)
* Storybook Boilerplate setup * Inital Setup * First story * Color Design System * Badge Story + Comp * Checkbox UI + Stories * Update Red colors + Button Group * Switch+Stories / Default brand color * Update Version + Button Group combined * Compact Butotn Group * Tidy up Selectors * Adds Tooltip to Button * TextInput * Update SB * Prefix Input * Match text area styles * Prefix Controls * Update spacing on text area * Text Input Suffix * Color Picker * Update storybook * Icon Suffix/Prefix * Datepicker + move components to monorepo * Text color on labels * Move Radio over to monorepo * Move CustomBranding to calcom/ib * Radio * IconBadge Component * Update radio indicator background * Disabled radio state * Delete yarn.lock * Revert "Delete yarn.lock" This reverts commit 9b99d244b70872153a16bec1f1f3bc651e94be7a. * Fix webhook test * Replace old toast location * Update radio path * Empty State * Update Badge.tsx * Update Badge.tsx * Banner Component+story * Creation Modal * Creation Dialog updated * Button hover dialog * Confirmation Modal * Datepicker (Booking) * PageHeader * Fix border width * PageHeader update search bar * Fix input height * Fix button group size * Add spacing between badges - font smoothing * Update button position on banner * Banner update * Fixing focus state on suffix/prefix inputs * Implement A11y addon * Add aria label * error && "text-red-800" * Fix button hover * Change colors * Generate snapshot tests for on hover button * Revert colors to demo * Change colors * Fix Linear Issues * Form Stepper component * Add padding back to input * Move ui to UI_V2 * Use V2 * Update imports for v1 * Update imports for v1 * Upgrade to nextjs in storybook root * Update website submodule * Avatar Groups * Fix webpack again * Vertical Tab Item [WIP] - active state on small item is not working currently * Vertical Tab Group * Add Github action * Fix website submodule * Fix GH action * Rename Workflow * Adds lint report for CI * Lint report fixes * NavigationItem comments * VerticalTabItem type fixes * Fix avatar blur * Fix comments * Adding isEmbed to window object * Disable components that use router mock. * Load inter via google fonts * Started select * Adding base Breadcrumb * Update readme * Formatting * Fixes * Dependencies matching * Linting * Update FormStep.stories.tsx * Linting * Update MultiSelectCheckboxes.tsx Co-authored-by: zomars <[email protected]> Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
100 files changed
+9966
-340
No files matched your search
@@ -0,0 +1,163 @@
|
||||
const tailwindcssPaletteGenerator = (input) => {
|
||||
// addColor function
|
||||
const addColor = (color) => {
|
||||
let colorParams = {
|
||||
hex: "",
|
||||
name: "",
|
||||
shades: params.shades,
|
||||
};
|
||||
|
||||
// check input params
|
||||
if (typeof color === "string") colorParams.hex = color;
|
||||
if (typeof color === "object" && Array.isArray(color)) {
|
||||
colorParams.name = color.shift();
|
||||
colorParams.hex = color.shift();
|
||||
}
|
||||
if (typeof color === "object" && !Array.isArray(color)) {
|
||||
if (Object.keys(color).length === 1) {
|
||||
colorParams.name = Object.keys(color)[0];
|
||||
colorParams.hex = Object.values(color)[0];
|
||||
}
|
||||
if (Object.keys(color).length !== 1) colorParams = Object.assign(colorParams, color);
|
||||
}
|
||||
|
||||
// check if string is invalid
|
||||
if (!/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(colorParams.hex)) return;
|
||||
|
||||
// add hash tag if needed
|
||||
if (!/^#/.test(colorParams.hex)) colorParams.hex = "#" + colorParams.hex;
|
||||
|
||||
// if no name present, get a default name
|
||||
if (colorParams.name === "") colorParams.name = params.colorNames.shift();
|
||||
|
||||
// set palette name
|
||||
palette[colorParams.name] = {};
|
||||
|
||||
// generate shades
|
||||
Object.keys(colorParams.shades).forEach((shade) => {
|
||||
palette[colorParams.name][shade] =
|
||||
colorParams.shades[shade].type === "lighten"
|
||||
? lighten(colorParams.hex, colorParams.shades[shade].intensity)
|
||||
: darken(colorParams.hex, colorParams.shades[shade].intensity);
|
||||
});
|
||||
};
|
||||
|
||||
// darken function
|
||||
const darken = (hex, intensity) => {
|
||||
// get r, g, b values
|
||||
let { r, g, b } = hexToRgb(hex);
|
||||
|
||||
// darken the r, g, b values
|
||||
r = Math.round(r * (1 - intensity));
|
||||
g = Math.round(g * (1 - intensity));
|
||||
b = Math.round(b * (1 - intensity));
|
||||
|
||||
// return the new hex color
|
||||
return rgbToHex(r, g, b);
|
||||
};
|
||||
|
||||
// lighten function
|
||||
const lighten = (hex, intensity) => {
|
||||
// get r, g, b values
|
||||
let { r, g, b } = hexToRgb(hex);
|
||||
|
||||
// lighten the r, g, b values
|
||||
r = Math.round(r + (255 - r) * intensity);
|
||||
g = Math.round(g + (255 - g) * intensity);
|
||||
b = Math.round(b + (255 - b) * intensity);
|
||||
|
||||
// return the new hex color
|
||||
return rgbToHex(r, g, b);
|
||||
};
|
||||
|
||||
// hexToRgb function
|
||||
const hexToRgb = (string) => {
|
||||
// get the r,g,b values
|
||||
const [r, g, b] = string
|
||||
.replace("#", "")
|
||||
.match(/.{1,2}/g)
|
||||
.map((a) => parseInt(a, 16));
|
||||
|
||||
return { r, g, b };
|
||||
};
|
||||
|
||||
// rgbToHex function
|
||||
const rgbToHex = (r, g, b) => `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
||||
|
||||
// toHex function
|
||||
const toHex = (n) => `0${n.toString(16)}`.slice(-2).toUpperCase();
|
||||
|
||||
// initiate palette
|
||||
const palette = {};
|
||||
|
||||
// set default params
|
||||
let params = {
|
||||
colors: [],
|
||||
colorNames: [
|
||||
"primary",
|
||||
"secondary",
|
||||
"tertiary",
|
||||
"quaternary",
|
||||
"quinary",
|
||||
"senary",
|
||||
"septenary",
|
||||
"octonary",
|
||||
"nonary",
|
||||
"denary",
|
||||
],
|
||||
shades: {
|
||||
50: {
|
||||
intensity: 0.95,
|
||||
type: "lighten",
|
||||
},
|
||||
100: {
|
||||
intensity: 0.9,
|
||||
type: "lighten",
|
||||
},
|
||||
200: {
|
||||
intensity: 0.75,
|
||||
type: "lighten",
|
||||
},
|
||||
300: {
|
||||
intensity: 0.6,
|
||||
type: "lighten",
|
||||
},
|
||||
400: {
|
||||
intensity: 0.3,
|
||||
type: "lighten",
|
||||
},
|
||||
500: {
|
||||
intensity: 0,
|
||||
type: "lighten",
|
||||
},
|
||||
600: {
|
||||
intensity: 0.1,
|
||||
type: "darken",
|
||||
},
|
||||
700: {
|
||||
intensity: 0.25,
|
||||
type: "darken",
|
||||
},
|
||||
800: {
|
||||
intensity: 0.4,
|
||||
type: "darken",
|
||||
},
|
||||
900: {
|
||||
intensity: 0.51,
|
||||
type: "darken",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// check input params
|
||||
if (typeof input === "string") params.colors.push(input);
|
||||
if (typeof input === "object" && Array.isArray(input)) params.colors = input;
|
||||
if (typeof input === "object" && !Array.isArray(input)) params = Object.assign(params, input);
|
||||
|
||||
// loop through colors
|
||||
params.colors.forEach(addColor);
|
||||
|
||||
return palette;
|
||||
};
|
||||
|
||||
module.exports = tailwindcssPaletteGenerator;
|
||||
@@ -15,7 +15,6 @@ module.exports = {
|
||||
extend: {
|
||||
colors: {
|
||||
/* your primary brand color */
|
||||
brand: "var(--brand-color)",
|
||||
brandcontrast: "var(--brand-text-color)",
|
||||
darkmodebrand: "var(--brand-color-dark-mode)",
|
||||
darkmodebrandcontrast: "var(--brand-text-color-dark-mode)",
|
||||
@@ -27,17 +26,32 @@ module.exports = {
|
||||
bookingdarker: "var(--booking-darker-color)",
|
||||
bookinghighlight: "var(--booking-highlight-color)",
|
||||
black: "#111111",
|
||||
brand: {
|
||||
// Figure out a way to automate this for self hosted users
|
||||
// Goto https://javisperez.github.io/tailwindcolorshades to generate your brand color
|
||||
50: "#d1d5db",
|
||||
100: "#9ca3af",
|
||||
200: "#6b7280",
|
||||
300: "#4b5563",
|
||||
400: "#374151",
|
||||
500: "#111827", // Brand color
|
||||
600: "#0f1623",
|
||||
700: "#0d121d",
|
||||
800: "#0a0e17",
|
||||
900: "#080c13",
|
||||
DEFAULT: "#111827",
|
||||
},
|
||||
gray: {
|
||||
50: "#F8F8F8",
|
||||
100: "#F5F5F5",
|
||||
200: "#E1E1E1",
|
||||
300: "#CFCFCF",
|
||||
400: "#ACACAC",
|
||||
500: "#888888",
|
||||
600: "#494949",
|
||||
700: "#3E3E3E",
|
||||
800: "#313131",
|
||||
900: "#292929",
|
||||
50: "#F9FAFB",
|
||||
100: "#F3F4F6",
|
||||
200: "#E5E7EB",
|
||||
300: "#D1D5DB",
|
||||
400: "#9CA3AF",
|
||||
500: "#6B7280",
|
||||
600: "#4B5563",
|
||||
700: "#374151",
|
||||
800: "#1F2937",
|
||||
900: "#111827",
|
||||
},
|
||||
neutral: {
|
||||
50: "#F8F8F8",
|
||||
@@ -76,44 +90,56 @@ module.exports = {
|
||||
900: "#223B41",
|
||||
},
|
||||
red: {
|
||||
50: "#FEF2F2",
|
||||
100: "#FEE2E2",
|
||||
200: "#FECACA",
|
||||
300: "#FCA5A5",
|
||||
400: "#F87171",
|
||||
500: "#EF4444",
|
||||
600: "#DC2626",
|
||||
700: "#B91C1C",
|
||||
800: "#991B1B",
|
||||
900: "#7F1D1D",
|
||||
50: "#FFF5F5",
|
||||
100: "#FFE3E2",
|
||||
200: "#FFC9C9",
|
||||
300: "#FEA8A8",
|
||||
400: "#FF8787",
|
||||
500: "#FF6B6B",
|
||||
600: "#FA5352",
|
||||
700: "#F03E3F",
|
||||
800: "#E03130",
|
||||
900: "#C92B2B",
|
||||
},
|
||||
orange: {
|
||||
50: "#FFF7ED",
|
||||
100: "#FFEDD5",
|
||||
200: "#FED7AA",
|
||||
300: "#FDBA74",
|
||||
400: "#FB923C",
|
||||
500: "#F97316",
|
||||
600: "#EA580C",
|
||||
700: "#C2410C",
|
||||
800: "#9A3412",
|
||||
900: "#7C2D12",
|
||||
50: "#FFF4E5",
|
||||
100: "#FFE8CC",
|
||||
200: "#FFD8A8",
|
||||
300: "#FFBF78",
|
||||
400: "#FFA94E",
|
||||
500: "#FF922B",
|
||||
600: "#FD7E14",
|
||||
700: "#F76706",
|
||||
800: "#E8580C",
|
||||
900: "#D94810",
|
||||
},
|
||||
green: {
|
||||
50: "#ECFDF5",
|
||||
100: "#D1FAE5",
|
||||
200: "#A7F3D0",
|
||||
300: "#6EE7B7",
|
||||
400: "#34D399",
|
||||
500: "#10B981",
|
||||
600: "#059669",
|
||||
700: "#047857",
|
||||
800: "#065F46",
|
||||
900: "#064E3B",
|
||||
50: "#EBFCEE",
|
||||
100: "#D2F9D9",
|
||||
200: "#B1F2BA",
|
||||
300: "#8CE99A",
|
||||
400: "#69DB7C",
|
||||
500: "#51CF66",
|
||||
600: "#40C057",
|
||||
700: "#36B24D",
|
||||
800: "#2F9E44",
|
||||
900: "#2B8A3E",
|
||||
},
|
||||
blue: {
|
||||
50: "#E7F5FF",
|
||||
100: "#D0EBFF",
|
||||
200: "#A4D8FF",
|
||||
300: "#74C0FC",
|
||||
400: "#4DABF7",
|
||||
500: "#339AF0",
|
||||
600: "#238BE6",
|
||||
700: "#1C7ED7",
|
||||
800: "#1971C2",
|
||||
900: "#1763AB",
|
||||
},
|
||||
},
|
||||
fontFamily: {
|
||||
cal: ["Cal Sans", "sans-serif"],
|
||||
cal: ["inter", "sans-serif"],
|
||||
mono: ["Roboto Mono", "monospace"],
|
||||
},
|
||||
maxHeight: (theme) => ({
|
||||
|
||||
Reference in new issue
Block a user