From f6176927cb1f97096c6447431bb026d1e1ff6658 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Iv=C3=A1n=20G=C3=B3mez=20Pinta?=
<44321109+GomezIvann@users.noreply.github.com>
Date: Wed, 13 Nov 2024 13:15:58 +0100
Subject: [PATCH 01/19] Raquel's incredible work on the Alert
---
.../pages/components/data-grid/index.tsx | 2 +-
.../components/data-grid/specifications.tsx | 2 +-
.../pages/components/data-grid/usage.tsx | 2 +-
.../screens/common/componentsList.json | 2 +-
.../screens/common/themes/advanced-theme.json | 78 +--
.../common/themes/opinionated-theme.json | 2 -
.../components/alert/AlertPageLayout.tsx | 4 +-
.../components/alert/code/AlertCodePage.tsx | 138 +++--
.../components/alert/code/examples/actions.ts | 34 ++
.../components/alert/code/examples/banner.ts | 16 +
.../alert/code/examples/basicUsage.ts | 2 +-
.../components/alert/code/examples/modal.ts | 5 +-
.../alert/code/examples/semantic.ts | 22 +
.../alert/code/examples/severalMessages.ts | 53 ++
.../components/alert/specs/AlertSpecsPage.tsx | 430 +++++++++-------
.../alert/specs/images/alert_anatomy.png | Bin 17451 -> 257506 bytes
.../alert/specs/images/alert_banner_specs.png | Bin 0 -> 126933 bytes
.../alert/specs/images/alert_inline_specs.png | Bin 0 -> 258908 bytes
.../alert/specs/images/alert_modal_specs.png | Bin 0 -> 202326 bytes
.../alert/specs/images/alert_specs.png | Bin 15842 -> 0 bytes
.../alert/specs/images/alert_states.png | Bin 14236 -> 0 bytes
.../components/alert/usage/AlertUsagePage.tsx | 487 ++++++++++++++----
.../alert/usage/examples/content.ts | 27 -
.../components/alert/usage/examples/types.ts | 38 --
.../alert/usage/images/alert_banner.png | Bin 0 -> 293173 bytes
.../alert/usage/images/alert_inline.png | Bin 0 -> 761994 bytes
.../alert/usage/images/alert_modal.png | Bin 0 -> 574479 bytes
.../button/usage/ButtonUsagePage.tsx | 14 +-
.../data-grid/DatagridPageLayout.tsx | 8 +-
.../screens/components/tag/TagPageLayout.tsx | 42 +-
.../typography/TypographyPageLayout.tsx | 12 +-
.../screens/principles/themes/ThemesPage.tsx | 129 ++---
.../components/ComponentPreview.tsx | 2 +-
.../components/previews/Alert.tsx | 56 +-
.../themes/schemas/advanced.schema.json | 74 +--
.../themes/schemas/opinionated.schema.json | 2 -
.../HalstackProviderPage.tsx | 69 ++-
packages/lib/src/HalstackContext.tsx | 3 -
.../src/alert/Alert.accessibility.test.tsx | 16 +-
packages/lib/src/alert/Alert.stories.tsx | 348 ++++++++-----
packages/lib/src/alert/Alert.test.tsx | 30 +-
packages/lib/src/alert/Alert.tsx | 470 ++++++++++-------
packages/lib/src/alert/types.ts | 75 ++-
packages/lib/src/common/variables.ts | 79 +--
packages/lib/src/dialog/Dialog.stories.tsx | 10 +-
45 files changed, 1764 insertions(+), 1019 deletions(-)
create mode 100644 apps/website/screens/components/alert/code/examples/actions.ts
create mode 100644 apps/website/screens/components/alert/code/examples/banner.ts
create mode 100644 apps/website/screens/components/alert/code/examples/semantic.ts
create mode 100644 apps/website/screens/components/alert/code/examples/severalMessages.ts
create mode 100644 apps/website/screens/components/alert/specs/images/alert_banner_specs.png
create mode 100644 apps/website/screens/components/alert/specs/images/alert_inline_specs.png
create mode 100644 apps/website/screens/components/alert/specs/images/alert_modal_specs.png
delete mode 100644 apps/website/screens/components/alert/specs/images/alert_specs.png
delete mode 100644 apps/website/screens/components/alert/specs/images/alert_states.png
delete mode 100644 apps/website/screens/components/alert/usage/examples/content.ts
delete mode 100644 apps/website/screens/components/alert/usage/examples/types.ts
create mode 100644 apps/website/screens/components/alert/usage/images/alert_banner.png
create mode 100644 apps/website/screens/components/alert/usage/images/alert_inline.png
create mode 100644 apps/website/screens/components/alert/usage/images/alert_modal.png
diff --git a/apps/website/pages/components/data-grid/index.tsx b/apps/website/pages/components/data-grid/index.tsx
index 7dda5ffb71..7c03d6d97f 100644
--- a/apps/website/pages/components/data-grid/index.tsx
+++ b/apps/website/pages/components/data-grid/index.tsx
@@ -1,7 +1,7 @@
import Head from "next/head";
import type { ReactElement } from "react";
import DataGridCodePage from "screens/components/data-grid/code/DataGridCodePage";
-import DataGridPageLayout from "screens/components/data-grid/DatagridPageLayout";
+import DataGridPageLayout from "screens/components/data-grid/DataGridPageLayout";
const Usage = () => {
return (
diff --git a/apps/website/pages/components/data-grid/specifications.tsx b/apps/website/pages/components/data-grid/specifications.tsx
index 76a440f795..254c432ffd 100644
--- a/apps/website/pages/components/data-grid/specifications.tsx
+++ b/apps/website/pages/components/data-grid/specifications.tsx
@@ -1,7 +1,7 @@
import Head from "next/head";
import type { ReactElement } from "react";
import DataGridSpecsPage from "screens/components/data-grid/specs/DataGridSpecsPage";
-import DataGridPageLayout from "screens/components/data-grid/DatagridPageLayout";
+import DataGridPageLayout from "screens/components/data-grid/DataGridPageLayout";
const Specifications = () => {
return (
diff --git a/apps/website/pages/components/data-grid/usage.tsx b/apps/website/pages/components/data-grid/usage.tsx
index c426cb7228..9c297879fd 100644
--- a/apps/website/pages/components/data-grid/usage.tsx
+++ b/apps/website/pages/components/data-grid/usage.tsx
@@ -1,7 +1,7 @@
import Head from "next/head";
import type { ReactElement } from "react";
import DataGridUsagePage from "screens/components/data-grid/usage/DataGridUsagePage";
-import DataGridPageLayout from "../../../screens/components/data-grid/DatagridPageLayout";
+import DataGridPageLayout from "../../../screens/components/data-grid/DataGridPageLayout";
const Usage = () => {
return (
diff --git a/apps/website/screens/common/componentsList.json b/apps/website/screens/common/componentsList.json
index aea357ea21..a167d3779b 100644
--- a/apps/website/screens/common/componentsList.json
+++ b/apps/website/screens/common/componentsList.json
@@ -1,6 +1,6 @@
[
{ "label": "Accordion", "path": "/components/accordion", "status": "stable" },
- { "label": "Alert", "path": "/components/alert", "status": "stable" },
+ { "label": "Alert", "path": "/components/alert", "status": "new" },
{
"label": "Application Layout",
"path": "/components/application-layout",
diff --git a/apps/website/screens/common/themes/advanced-theme.json b/apps/website/screens/common/themes/advanced-theme.json
index 26b63b1416..0a2cbdc4aa 100644
--- a/apps/website/screens/common/themes/advanced-theme.json
+++ b/apps/website/screens/common/themes/advanced-theme.json
@@ -43,47 +43,51 @@
"accordionGroupSeparatorBorderStyle": "solid"
},
"alert": {
- "titleFontFamily": "Open Sans, sans-serif",
- "titleFontColor": "#000000",
- "titleFontSize": "0.75rem",
- "titleFontStyle": "normal",
- "titleFontWeight": "bold",
- "titleTextTransform": "uppercase",
- "titlePaddingRight": "0rem",
- "titlePaddingLeft": "0rem",
- "inlineTextFontFamily": "Open Sans, sans-serif",
- "inlineTextFontColor": "#000000",
- "inlineTextFontSize": "0.75rem",
- "inlineTextFontStyle": "normal",
- "inlineTextFontWeight": "400",
- "inlineTextPaddingLeft": "0rem",
- "inlineTextPaddingRight": "0rem",
- "contentPaddingLeft": "0rem",
- "contentPaddingRight": "0rem",
- "contentPaddingTop": "20px",
- "contentPaddingBottom": "30px",
- "borderRadius": "4px",
- "borderStyle": "solid",
- "borderThickness": "1px",
- "infoBorderColor": "#0067b3",
- "successBorderColor": "#24a148",
- "warningBorderColor": "#c59f07",
- "errorBorderColor": "#d0011b",
- "iconSize": "24px",
- "iconPaddingLeft": "0rem",
- "iconPaddingRight": "0rem",
- "infoIconColor": "#0067b3",
- "successIconColor": "#24a148",
- "warningIconColor": "#c59f07",
- "errorIconColor": "#d0011b",
+ "overlayColor": "#000000b3",
+ "modalPaddingTop": "1.5rem",
+ "modalPaddingRight": "1.5rem",
+ "modalPaddingBottom": "1.5rem",
+ "modalPaddingLeft": "1.5rem",
+ "paddingTop": "0.5rem",
+ "paddingRight": "0.75rem",
+ "paddingBottom": "0.5rem",
+ "paddingLeft": "0.75rem",
+ "borderRadius": "0.25rem",
+ "boxShadowOffsetX": "1px",
+ "boxShadowOffsetY": "4px",
+ "boxShadowBlur": "6px",
+ "boxShadowSpreadRadius": "0px",
+ "boxShadowColor": "",
+ "modalBackgroundColor": "#ffffff",
"infoBackgroundColor": "#e6f4ff",
"successBackgroundColor": "#eafaef",
"warningBackgroundColor": "#fef9e6",
"errorBackgroundColor": "#ffe6e9",
- "hoverActionBackgroundColor": "#0000000d",
- "activeActionBackgroundColor": "#0000001a",
- "focusActionBorderColor": "#0095ff",
- "overlayColor": "#000000b3"
+ "iconPaddingRight": "0.5rem",
+ "infoIconColor": "#0086e6",
+ "successIconColor": "#24a148",
+ "warningIconColor": "#c59f07",
+ "errorIconColor": "#d0011b",
+ "iconSize": "24px",
+ "titleFontFamily": "Open Sans, sans-serif",
+ "titleFontColor": "#333333",
+ "titleFontSize": "0.875rem",
+ "modalTitleFontSize": "1.5rem",
+ "titleFontStyle": "normal",
+ "titleFontWeight": "bold",
+ "titlePaddingRight": "0.25rem",
+ "messageFontFamily": "Open Sans, sans-serif",
+ "messageFontColor": "#333333",
+ "messageFontSize": "0.875rem",
+ "messageFontStyle": "normal",
+ "messageFontWeight": "400",
+ "messagePaddingLeft": "0.25rem",
+ "messagePaddingRight": "0.75rem",
+ "navigationTextFontFamily": "Open Sans, sans-serif",
+ "navigationTextFontSize": "0.75rem",
+ "navigationTextFontStyle": "normal",
+ "navigationTextFontWeight": "400",
+ "navigationTextFontColor": "#000000"
},
"bulletedList": {
"fontColor": "#000000",
diff --git a/apps/website/screens/common/themes/opinionated-theme.json b/apps/website/screens/common/themes/opinionated-theme.json
index c48fccd00a..f62aac464d 100644
--- a/apps/website/screens/common/themes/opinionated-theme.json
+++ b/apps/website/screens/common/themes/opinionated-theme.json
@@ -5,8 +5,6 @@
"assistiveTextFontColor": "#666666"
},
"alert": {
- "baseColor": "#e6f4ff",
- "accentColor": "#0067b3",
"overlayColor": "#000000b3"
},
"button": {
diff --git a/apps/website/screens/components/alert/AlertPageLayout.tsx b/apps/website/screens/components/alert/AlertPageLayout.tsx
index d5691a3193..76b524fff5 100644
--- a/apps/website/screens/components/alert/AlertPageLayout.tsx
+++ b/apps/website/screens/components/alert/AlertPageLayout.tsx
@@ -16,7 +16,9 @@ const AlertPageHeading = ({ children }: { children: React.ReactNode }) => {
mode="modal" this function will also be executed when the background overlay is clicked. The
+ user has the responsibility of hiding the modal, otherwise it will remain visible.???)
+ onClose event,
otherwise the overlaid modal will remain visible.
mode="modal" this function will also be executed when the background overlay is
- clicked. The user has the responsibility of hiding the modal, otherwise it will remain visible.
- infoIconColor
- color-blue-800
- successIconColor
- color-green-700
- warningIconColor
+ overlayColor
color-yellow-700
+ color-grey-800-a
errorIconColor
+ modalBackgroundColor
color-red-700
+ color-white
infoBackgroundColor
color-blue-100
successBackgroundColor
color-green-100
warningBackgroundColor
color-yellow-100
errorBackgroundColor
color-red-100
infoBorderColor
+ infoIconColor
color-blue-800
+ color-blue-700
successBorderColor
+ successIconColor
color-green-700
warningBorderColor
+ warningIconColor
errorBorderColor
+ errorIconColor
color-red-700
color-black
- inlineTextFontColor
- color-black
- hoverActionBackgroundColor
- color-grey-100-a
- activeActionBackgroundColor
- color-grey-200-a
+ color-grey-900
focusActionBorderColor
+ messageFontColor
color-blue-600
+ color-grey-900
overlayColor
+ navigationTextFontColor
color-grey-800-a
+ color-black
font-scale-01
+ font-scale-02
modalTitleFontSize
+ font-scale-05
+ titleFontStyle
+ font-normal
+ font-bold
inlineTextFontFamily
+ messageFontFamily
font-family-sans
inlineTextFontSize
+ messageFontSize
+ font-scale-02
+ messageFontStyle
+ font-normal
+ messageFontWeight
+ font-regular
+ navigationTextFontFamily
font-family-sans
+ navigationTextFontSize
+ font-scale-01
inlineTextFontWeight
+ navigationTextFontStyle
+ font-normal
+ navigationTextFontWeight
font-regular
borderThickness
+ boxShadowOffsetX
border-width-1
+ -
borderStyle
+ boxShadowOffsetY
-
+ boxShadowBlur
+ border-style-solid
+ -
boxShadowSpreadRadius
+ -
+ boxShadowColor
+
+ containerPaddingLeft
+ modalPaddingTop
spacing-12
+ spacing-24
modalPaddingRight
+ spacing-24
+ modalPaddingBottom
+ spacing-24
+ modalPaddingLeft
+ spacing-24
+ paddingTop
+ spacing-8
+ containerPaddingRight
+ paddingRight
iconMarginRight
+ paddingBottom
spacing-8
paddingLeft
+ spacing-12
+ inlineTextPaddingLeft
+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