From e8334135b3b21ba1b3a94d7de082a868070ced5a Mon Sep 17 00:00:00 2001 From: Mari Nez Date: Tue, 6 Aug 2024 13:05:24 -0600 Subject: [PATCH 1/3] feat(emulsif-240): convert menus to support sdc --- .../breadcrumbs/breadcrumbs.component.yml | 20 +++++++ .../menus/breadcrumbs/breadcrumbs.yml | 6 --- .../menus/inline/inline-menu.component.yml | 21 ++++++++ src/components/menus/inline/inline-menu.yml | 7 --- .../menus/main-menu/main-menu.component.yml | 53 +++++++++++++++++++ src/components/menus/main-menu/main-menu.yml | 39 -------------- src/components/menus/menus.stories.js | 23 +++++--- .../social-menu/social-menu.component.yml | 27 ++++++++++ .../menus/social-menu/social-menu.yml | 13 ----- 9 files changed, 136 insertions(+), 73 deletions(-) create mode 100644 src/components/menus/breadcrumbs/breadcrumbs.component.yml delete mode 100644 src/components/menus/breadcrumbs/breadcrumbs.yml create mode 100644 src/components/menus/inline/inline-menu.component.yml delete mode 100644 src/components/menus/inline/inline-menu.yml create mode 100644 src/components/menus/main-menu/main-menu.component.yml delete mode 100644 src/components/menus/main-menu/main-menu.yml create mode 100644 src/components/menus/social-menu/social-menu.component.yml delete mode 100644 src/components/menus/social-menu/social-menu.yml diff --git a/src/components/menus/breadcrumbs/breadcrumbs.component.yml b/src/components/menus/breadcrumbs/breadcrumbs.component.yml new file mode 100644 index 00000000..299cb31e --- /dev/null +++ b/src/components/menus/breadcrumbs/breadcrumbs.component.yml @@ -0,0 +1,20 @@ +$schema: https://git.drupalcode.org/project/drupal/-/raw/10.1.x/core/modules/sdc/src/metadata.schema.json + +name: Breadcrumbs +group: Components/Menus +status: stable +props: + type: object + required: + - breadcrumb + properties: + breadcrumb: + type: array + title: Breadcrumb items + description: The items of the breadcrumb. + data: + - url: '#' + text: 'Home' + - url: '#' + text: 'Parent Page' + - text: 'Current Page' diff --git a/src/components/menus/breadcrumbs/breadcrumbs.yml b/src/components/menus/breadcrumbs/breadcrumbs.yml deleted file mode 100644 index 05875dcf..00000000 --- a/src/components/menus/breadcrumbs/breadcrumbs.yml +++ /dev/null @@ -1,6 +0,0 @@ -breadcrumb: - - url: '#' - text: 'Home' - - url: '#' - text: 'Parent Page' - - text: 'Current Page' diff --git a/src/components/menus/inline/inline-menu.component.yml b/src/components/menus/inline/inline-menu.component.yml new file mode 100644 index 00000000..8295fca7 --- /dev/null +++ b/src/components/menus/inline/inline-menu.component.yml @@ -0,0 +1,21 @@ +$schema: https://git.drupalcode.org/project/drupal/-/raw/10.1.x/core/modules/sdc/src/metadata.schema.json + +name: Inline Menu +group: Components/Menus +status: stable +props: + type: object + required: + - inline_menu_items + properties: + inline_menu_items: + type: array + title: Inline menu items + description: The items of the inline menu. + data: + - title: 'Test' + url: '#' + - title: 'Number 2' + url: '#' + - title: 'Item Number 3' + url: '#' diff --git a/src/components/menus/inline/inline-menu.yml b/src/components/menus/inline/inline-menu.yml deleted file mode 100644 index 45382e76..00000000 --- a/src/components/menus/inline/inline-menu.yml +++ /dev/null @@ -1,7 +0,0 @@ -inline_menu_items: - - title: 'Test' - url: '#' - - title: 'Number 2' - url: '#' - - title: 'Item Number 3' - url: '#' diff --git a/src/components/menus/main-menu/main-menu.component.yml b/src/components/menus/main-menu/main-menu.component.yml new file mode 100644 index 00000000..82fd43f9 --- /dev/null +++ b/src/components/menus/main-menu/main-menu.component.yml @@ -0,0 +1,53 @@ +$schema: https://git.drupalcode.org/project/drupal/-/raw/10.1.x/core/modules/sdc/src/metadata.schema.json + +name: Main Menu +group: Components/Menus +status: stable +props: + type: object + required: + - menu_items + properties: + menu_items: + type: array + title: Main menu items + description: The items of the main menu. + data: + - title: 'Academics' + url: '#' + below: + - title: 'Menu Item 1 Sub 1' + url: '#' + - title: 'Menu Item 1 Sub 2' + url: '#' + below: + - title: 'Menu Item 1 Sub Sub 1' + url: '#' + - title: 'Menu Item 1 Sub Sub 2' + url: '#' + - title: 'Menu Item 1 Sub 3' + url: '#' + - title: 'Menu Item 1 Sub 4' + url: '#' + - title: 'Admissions' + url: '#' + below: + - title: 'Menu Item 2 Sub 1' + url: '#' + - title: 'Menu Item 2 Sub 2' + url: '#' + - title: 'Menu Item 2 Sub 3' + url: '#' + - title: 'Research' + url: '#' + below: + - title: 'Menu Item 3 Sub 1' + url: '#' + - title: 'Menu Item 3 Sub 2' + url: '#' + - title: 'Menu Item 3 Sub 3' + url: '#' + - title: 'Menu Item 3 Sub 4' + url: '#' + - title: 'About' + url: '#' diff --git a/src/components/menus/main-menu/main-menu.yml b/src/components/menus/main-menu/main-menu.yml deleted file mode 100644 index 15c00117..00000000 --- a/src/components/menus/main-menu/main-menu.yml +++ /dev/null @@ -1,39 +0,0 @@ -menu_items: - - title: 'Academics' - url: '#' - below: - - title: 'Menu Item 1 Sub 1' - url: '#' - - title: 'Menu Item 1 Sub 2' - url: '#' - below: - - title: 'Menu Item 1 Sub Sub 1' - url: '#' - - title: 'Menu Item 1 Sub Sub 2' - url: '#' - - title: 'Menu Item 1 Sub 3' - url: '#' - - title: 'Menu Item 1 Sub 4' - url: '#' - - title: 'Admissions' - url: '#' - below: - - title: 'Menu Item 2 Sub 1' - url: '#' - - title: 'Menu Item 2 Sub 2' - url: '#' - - title: 'Menu Item 2 Sub 3' - url: '#' - - title: 'Research' - url: '#' - below: - - title: 'Menu Item 3 Sub 1' - url: '#' - - title: 'Menu Item 3 Sub 2' - url: '#' - - title: 'Menu Item 3 Sub 3' - url: '#' - - title: 'Menu Item 3 Sub 4' - url: '#' - - title: 'About' - url: '#' \ No newline at end of file diff --git a/src/components/menus/menus.stories.js b/src/components/menus/menus.stories.js index 8098ed31..6c52e3d0 100644 --- a/src/components/menus/menus.stories.js +++ b/src/components/menus/menus.stories.js @@ -3,22 +3,29 @@ import inlineMenu from './inline/inline-menu.twig'; import mainMenu from './main-menu/main-menu.twig'; import socialMenu from './social-menu/social-menu.twig'; -import breadcrumbsData from './breadcrumbs/breadcrumbs.yml'; -import inlineMenuData from './inline/inline-menu.yml'; -import mainMenuData from './main-menu/main-menu.yml'; -import socialMenuData from './social-menu/social-menu.yml'; +import breadcrumbsDataProps from './breadcrumbs/breadcrumbs.component.yml'; +import inlineMenuDataProps from './inline/inline-menu.component.yml'; +import mainMenuDataProps from './main-menu/main-menu.component.yml'; +import socialMenuDataProps from './social-menu/social-menu.component.yml'; import './main-menu/main-menu'; +const breadcrumbsData = breadcrumbsDataProps.props.properties.breadcrumb.data; +const inlineMenuData = + inlineMenuDataProps.props.properties.inline_menu_items.data; +const mainMenuData = mainMenuDataProps.props.properties.menu_items.data; +const socialMenuData = + socialMenuDataProps.props.properties.social_menu_items.data; + /** * Storybook Definition. */ export default { title: 'Components/Menus' }; -export const breadcrumbs = () => breadcrumb(breadcrumbsData); +export const breadcrumbs = () => breadcrumb({ breadcrumb: breadcrumbsData }); -export const inline = () => inlineMenu(inlineMenuData); +export const inline = () => inlineMenu({ inline_menu_items: inlineMenuData }); -export const main = () => mainMenu(mainMenuData); +export const main = () => mainMenu({ menu_items: mainMenuData }); -export const social = () => socialMenu(socialMenuData); +export const social = () => socialMenu({ social_menu_items: socialMenuData }); diff --git a/src/components/menus/social-menu/social-menu.component.yml b/src/components/menus/social-menu/social-menu.component.yml new file mode 100644 index 00000000..bff6d851 --- /dev/null +++ b/src/components/menus/social-menu/social-menu.component.yml @@ -0,0 +1,27 @@ +$schema: https://git.drupalcode.org/project/drupal/-/raw/10.1.x/core/modules/sdc/src/metadata.schema.json + +name: Social Menu +group: Components/Menus +status: stable +props: + type: object + required: + - social_menu_items + properties: + social_menu_items: + type: array + title: Social menu items + description: The items of the social menu. + data: + - title: 'Twitter' + url: '#' + icon: 'twitter' + - title: 'Facebook' + url: '#' + icon: 'facebook' + - title: 'Instagram' + url: '#' + icon: 'instagram' + - title: 'LinkedIn' + url: '#' + icon: 'linkedin' diff --git a/src/components/menus/social-menu/social-menu.yml b/src/components/menus/social-menu/social-menu.yml deleted file mode 100644 index 465d6245..00000000 --- a/src/components/menus/social-menu/social-menu.yml +++ /dev/null @@ -1,13 +0,0 @@ -social_menu_items: - - title: 'Twitter' - url: '#' - icon: 'twitter' - - title: 'Facebook' - url: '#' - icon: 'facebook' - - title: 'Instagram' - url: '#' - icon: 'instagram' - - title: 'LinkedIn' - url: '#' - icon: 'linkedin' From 03c8e8637dfae8d48860a27700d85c0ae2afdf45 Mon Sep 17 00:00:00 2001 From: mariannuar Date: Tue, 6 Aug 2024 19:11:45 +0000 Subject: [PATCH 2/3] feat: create tokens --- src/components/tokens/_tokens.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/tokens/_tokens.scss b/src/components/tokens/_tokens.scss index 43d3401f..402d55f9 100644 --- a/src/components/tokens/_tokens.scss +++ b/src/components/tokens/_tokens.scss @@ -1,6 +1,6 @@ /** * Do not edit directly - * Generated on Mon, 05 Aug 2024 16:30:15 GMT + * Generated on Tue, 06 Aug 2024 19:11:43 GMT */ :root { From 49fdfc1020447d3b76d74c526cdb76555307e7f5 Mon Sep 17 00:00:00 2001 From: mariannuar Date: Fri, 16 Aug 2024 00:39:28 +0000 Subject: [PATCH 3/3] feat: create tokens --- src/components/tokens/_tokens.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/tokens/_tokens.scss b/src/components/tokens/_tokens.scss index ead51c31..fd378fed 100644 --- a/src/components/tokens/_tokens.scss +++ b/src/components/tokens/_tokens.scss @@ -1,6 +1,6 @@ /** * Do not edit directly - * Generated on Fri, 16 Aug 2024 00:35:36 GMT + * Generated on Fri, 16 Aug 2024 00:39:27 GMT */ :root {