diff --git a/.github/workflows/deploy-github-pages.yml b/.github/workflows/deploy-github-pages.yml index c49004f..1a35455 100644 --- a/.github/workflows/deploy-github-pages.yml +++ b/.github/workflows/deploy-github-pages.yml @@ -5,12 +5,12 @@ name: Build and Publish Storybook to GitHub Pages on: # temp only so we can skip this build - push: - tags: - - v* # push: - # branches: - # - main + # tags: + # - v* + push: + branches: + - main permissions: contents: read diff --git a/package.json b/package.json index c4ef652..1a628fb 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,10 @@ "build-palette": "ts-node -O '{\"module\": \"commonjs\"}' ./scripts/build-palette.ts", "build-typography": "ts-node -O '{\"module\": \"commonjs\"}' ./scripts/build-typography.ts", "build-colors": "ts-node -O '{\"module\": \"commonjs\"}' ./scripts/build-colors.ts", + "build-constants": "ts-node -O '{\"module\": \"commonjs\"}' ./scripts/build-constants.ts", "start": "ng serve", - "build": "yarn run build-typography && yarn run build-colors && ng build", + "prebuild": "yarn run build-constants && yarn run build-typography && yarn run build-colors", + "build": "ng build", "watch": "ng build --watch --configuration development", "test": "ng test", "storybook": "ng run lfx-component-lib:storybook", diff --git a/projects/lfx-component-lib/documentation.json b/projects/lfx-component-lib/documentation.json index 6e89cef..98f3474 100644 --- a/projects/lfx-component-lib/documentation.json +++ b/projects/lfx-component-lib/documentation.json @@ -14,131 +14,31 @@ "name": "Info", "ctype": "miscellaneous", "subtype": "variable", - "file": "projects/lfx-component-lib/src/lib/containers/notice/__docs__/notice.stories.ts", + "file": "projects/lfx-component-lib/src/lib/containers/toast/__docs__/toast.stories.ts", "deprecated": false, "deprecationMessage": "", "type": "Story", - "defaultValue": "{\n render: (args: any) => ({\n template: `\n

Title

\n

Body paragraph

\n
`,\n }),\n}" - }, - { - "name": "Large", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/button.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{\n args: {\n size: 'large',\n label: 'Button',\n },\n}" - }, - { - "name": "LFXPrimary", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/lib/__docs__/lfx-component-lib.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{}" - }, - { - "name": "LoggedIn", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/header.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{\n args: {\n user: {\n name: 'Jane Doe',\n },\n },\n}" - }, - { - "name": "LoggedIn", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/page.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{\n play: async ({ canvasElement }) => {\n const canvas = within(canvasElement);\n const loginButton = canvas.getByRole('button', { name: /Log in/i });\n await expect(loginButton).toBeInTheDocument();\n await userEvent.click(loginButton);\n await expect(loginButton).not.toBeInTheDocument();\n\n const logoutButton = canvas.getByRole('button', { name: /Log out/i });\n await expect(logoutButton).toBeInTheDocument();\n },\n}" - }, - { - "name": "LoggedOut", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/header.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{}" - }, - { - "name": "LoggedOut", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/page.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{}" - }, - { - "name": "meta", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/button.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Meta", - "defaultValue": "{\n title: 'Example/Button',\n component: ButtonComponent,\n tags: ['autodocs'],\n argTypes: {\n backgroundColor: {\n control: 'color',\n },\n },\n // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args\n args: { onClick: fn() },\n}" + "defaultValue": "{\n render: (args: any) => ({\n template: `\n

Title

\n

Body paragraph

\n
`,\n }),\n}" }, { "name": "meta", "ctype": "miscellaneous", "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/header.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Meta", - "defaultValue": "{\n title: 'Example/Header',\n component: HeaderComponent,\n // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs\n tags: ['autodocs'],\n parameters: {\n // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout\n layout: 'fullscreen',\n },\n args: {\n onLogin: fn(),\n onLogout: fn(),\n onCreateAccount: fn(),\n },\n}" - }, - { - "name": "meta", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/page.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Meta", - "defaultValue": "{\n title: 'Example/Page',\n component: PageComponent,\n parameters: {\n // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout\n layout: 'fullscreen',\n },\n}" - }, - { - "name": "meta", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/lib/__docs__/lfx-component-lib.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Meta", - "defaultValue": "{\n title: 'Example/Button',\n component: LfxComponentLibComponent,\n tags: ['autodocs'],\n argTypes: {\n backgroundColor: {\n control: 'color',\n },\n },\n // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args\n args: { onClick: fn() },\n}" - }, - { - "name": "meta", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/lib/containers/notice/__docs__/notice.stories.ts", + "file": "projects/lfx-component-lib/src/lib/containers/sections/__docs__/sections.stories.ts", "deprecated": false, "deprecationMessage": "", - "type": "Meta", - "defaultValue": "{\n title: 'Example/Containers/Sections',\n component: NoticeComponent,\n tags: ['autodocs'],\n argTypes: {\n type: {\n control: 'select',\n options: ['info', 'warning', 'success', 'error'],\n },\n },\n parameters: {\n backgrounds: { default: 'dark' },\n },\n}" + "type": "Meta", + "defaultValue": "{\n title: 'LFX Components/Containers/Sections',\n component: SectionsComponent,\n tags: ['autodocs'],\n argTypes: {\n backgroundColor: {\n control: 'color',\n },\n },\n parameters: {\n backgrounds: { default: 'dark' },\n },\n}" }, { "name": "meta", "ctype": "miscellaneous", "subtype": "variable", - "file": "projects/lfx-component-lib/src/lib/containers/sections/__docs__/sections.stories.ts", + "file": "projects/lfx-component-lib/src/lib/containers/toast/__docs__/toast.stories.ts", "deprecated": false, "deprecationMessage": "", - "type": "Meta", - "defaultValue": "{\n title: 'Example/Containers/Sections',\n component: SectionsComponent,\n tags: ['autodocs'],\n argTypes: {\n backgroundColor: {\n control: 'color',\n },\n },\n parameters: {\n backgrounds: { default: 'dark' },\n },\n}" + "type": "Meta", + "defaultValue": "{\n title: 'LFX Components/Containers/Toast',\n component: ToastComponent,\n tags: ['autodocs'],\n argTypes: {\n type: {\n control: 'select',\n options: ['notice', 'warning', 'success', 'error'],\n defaultValue: 'notice',\n },\n },\n}" }, { "name": "preview", @@ -150,26 +50,6 @@ "type": "Preview", "defaultValue": "{\n parameters: {\n controls: {\n matchers: {\n color: /(background|color)$/i,\n date: /Date$/i,\n },\n },\n },\n}" }, - { - "name": "Primary", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/button.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{\n args: {\n primary: true,\n label: 'Button',\n },\n}" - }, - { - "name": "Secondary", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/button.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{\n args: {\n label: 'Button',\n },\n}" - }, { "name": "Section", "ctype": "miscellaneous", @@ -179,16 +59,6 @@ "deprecationMessage": "", "type": "Story", "defaultValue": "{\n render: (args: any) => ({\n template: `\n

Section

\n

Section content here

\n
\n
\n \n

Section

\n

Section content here

\n
\n \n

Section

\n

Section content here

\n
\n
`,\n }),\n}" - }, - { - "name": "Small", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/button.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{\n args: {\n size: 'small',\n label: 'Button',\n },\n}" } ], "functions": [], @@ -197,52 +67,8 @@ "name": "Story", "ctype": "miscellaneous", "subtype": "typealias", - "rawtype": "StoryObj", - "file": "projects/lfx-component-lib/src/stories/button.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "description": "", - "kind": 183 - }, - { - "name": "Story", - "ctype": "miscellaneous", - "subtype": "typealias", - "rawtype": "StoryObj", - "file": "projects/lfx-component-lib/src/stories/header.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "description": "", - "kind": 183 - }, - { - "name": "Story", - "ctype": "miscellaneous", - "subtype": "typealias", - "rawtype": "StoryObj", - "file": "projects/lfx-component-lib/src/stories/page.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "description": "", - "kind": 183 - }, - { - "name": "Story", - "ctype": "miscellaneous", - "subtype": "typealias", - "rawtype": "StoryObj", - "file": "projects/lfx-component-lib/src/lib/__docs__/lfx-component-lib.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "description": "", - "kind": 183 - }, - { - "name": "Story", - "ctype": "miscellaneous", - "subtype": "typealias", - "rawtype": "StoryObj", - "file": "projects/lfx-component-lib/src/lib/containers/notice/__docs__/notice.stories.ts", + "rawtype": "StoryObj", + "file": "projects/lfx-component-lib/src/lib/containers/sections/__docs__/sections.stories.ts", "deprecated": false, "deprecationMessage": "", "description": "", @@ -252,8 +78,8 @@ "name": "Story", "ctype": "miscellaneous", "subtype": "typealias", - "rawtype": "StoryObj", - "file": "projects/lfx-component-lib/src/lib/containers/sections/__docs__/sections.stories.ts", + "rawtype": "StoryObj", + "file": "projects/lfx-component-lib/src/lib/containers/toast/__docs__/toast.stories.ts", "deprecated": false, "deprecationMessage": "", "description": "", @@ -262,164 +88,26 @@ ], "enumerations": [], "groupedVariables": { - "projects/lfx-component-lib/src/lib/containers/notice/__docs__/notice.stories.ts": [ + "projects/lfx-component-lib/src/lib/containers/toast/__docs__/toast.stories.ts": [ { "name": "Info", "ctype": "miscellaneous", "subtype": "variable", - "file": "projects/lfx-component-lib/src/lib/containers/notice/__docs__/notice.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{\n render: (args: any) => ({\n template: `\n

Title

\n

Body paragraph

\n
`,\n }),\n}" - }, - { - "name": "meta", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/lib/containers/notice/__docs__/notice.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Meta", - "defaultValue": "{\n title: 'Example/Containers/Sections',\n component: NoticeComponent,\n tags: ['autodocs'],\n argTypes: {\n type: {\n control: 'select',\n options: ['info', 'warning', 'success', 'error'],\n },\n },\n parameters: {\n backgrounds: { default: 'dark' },\n },\n}" - } - ], - "projects/lfx-component-lib/src/stories/button.stories.ts": [ - { - "name": "Large", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/button.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{\n args: {\n size: 'large',\n label: 'Button',\n },\n}" - }, - { - "name": "meta", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/button.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Meta", - "defaultValue": "{\n title: 'Example/Button',\n component: ButtonComponent,\n tags: ['autodocs'],\n argTypes: {\n backgroundColor: {\n control: 'color',\n },\n },\n // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args\n args: { onClick: fn() },\n}" - }, - { - "name": "Primary", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/button.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{\n args: {\n primary: true,\n label: 'Button',\n },\n}" - }, - { - "name": "Secondary", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/button.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{\n args: {\n label: 'Button',\n },\n}" - }, - { - "name": "Small", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/button.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{\n args: {\n size: 'small',\n label: 'Button',\n },\n}" - } - ], - "projects/lfx-component-lib/src/lib/__docs__/lfx-component-lib.stories.ts": [ - { - "name": "LFXPrimary", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/lib/__docs__/lfx-component-lib.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{}" - }, - { - "name": "meta", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/lib/__docs__/lfx-component-lib.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Meta", - "defaultValue": "{\n title: 'Example/Button',\n component: LfxComponentLibComponent,\n tags: ['autodocs'],\n argTypes: {\n backgroundColor: {\n control: 'color',\n },\n },\n // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args\n args: { onClick: fn() },\n}" - } - ], - "projects/lfx-component-lib/src/stories/header.stories.ts": [ - { - "name": "LoggedIn", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/header.stories.ts", + "file": "projects/lfx-component-lib/src/lib/containers/toast/__docs__/toast.stories.ts", "deprecated": false, "deprecationMessage": "", "type": "Story", - "defaultValue": "{\n args: {\n user: {\n name: 'Jane Doe',\n },\n },\n}" - }, - { - "name": "LoggedOut", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/header.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{}" + "defaultValue": "{\n render: (args: any) => ({\n template: `\n

Title

\n

Body paragraph

\n
`,\n }),\n}" }, { "name": "meta", "ctype": "miscellaneous", "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/header.stories.ts", + "file": "projects/lfx-component-lib/src/lib/containers/toast/__docs__/toast.stories.ts", "deprecated": false, "deprecationMessage": "", - "type": "Meta", - "defaultValue": "{\n title: 'Example/Header',\n component: HeaderComponent,\n // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs\n tags: ['autodocs'],\n parameters: {\n // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout\n layout: 'fullscreen',\n },\n args: {\n onLogin: fn(),\n onLogout: fn(),\n onCreateAccount: fn(),\n },\n}" - } - ], - "projects/lfx-component-lib/src/stories/page.stories.ts": [ - { - "name": "LoggedIn", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/page.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{\n play: async ({ canvasElement }) => {\n const canvas = within(canvasElement);\n const loginButton = canvas.getByRole('button', { name: /Log in/i });\n await expect(loginButton).toBeInTheDocument();\n await userEvent.click(loginButton);\n await expect(loginButton).not.toBeInTheDocument();\n\n const logoutButton = canvas.getByRole('button', { name: /Log out/i });\n await expect(logoutButton).toBeInTheDocument();\n },\n}" - }, - { - "name": "LoggedOut", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/page.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Story", - "defaultValue": "{}" - }, - { - "name": "meta", - "ctype": "miscellaneous", - "subtype": "variable", - "file": "projects/lfx-component-lib/src/stories/page.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "type": "Meta", - "defaultValue": "{\n title: 'Example/Page',\n component: PageComponent,\n parameters: {\n // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout\n layout: 'fullscreen',\n },\n}" + "type": "Meta", + "defaultValue": "{\n title: 'LFX Components/Containers/Toast',\n component: ToastComponent,\n tags: ['autodocs'],\n argTypes: {\n type: {\n control: 'select',\n options: ['notice', 'warning', 'success', 'error'],\n defaultValue: 'notice',\n },\n },\n}" } ], "projects/lfx-component-lib/src/lib/containers/sections/__docs__/sections.stories.ts": [ @@ -431,7 +119,7 @@ "deprecated": false, "deprecationMessage": "", "type": "Meta", - "defaultValue": "{\n title: 'Example/Containers/Sections',\n component: SectionsComponent,\n tags: ['autodocs'],\n argTypes: {\n backgroundColor: {\n control: 'color',\n },\n },\n parameters: {\n backgrounds: { default: 'dark' },\n },\n}" + "defaultValue": "{\n title: 'LFX Components/Containers/Sections',\n component: SectionsComponent,\n tags: ['autodocs'],\n argTypes: {\n backgroundColor: {\n control: 'color',\n },\n },\n parameters: {\n backgrounds: { default: 'dark' },\n },\n}" }, { "name": "Section", @@ -460,78 +148,26 @@ "groupedFunctions": {}, "groupedEnumerations": {}, "groupedTypeAliases": { - "projects/lfx-component-lib/src/stories/button.stories.ts": [ - { - "name": "Story", - "ctype": "miscellaneous", - "subtype": "typealias", - "rawtype": "StoryObj", - "file": "projects/lfx-component-lib/src/stories/button.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "description": "", - "kind": 183 - } - ], - "projects/lfx-component-lib/src/stories/header.stories.ts": [ - { - "name": "Story", - "ctype": "miscellaneous", - "subtype": "typealias", - "rawtype": "StoryObj", - "file": "projects/lfx-component-lib/src/stories/header.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "description": "", - "kind": 183 - } - ], - "projects/lfx-component-lib/src/stories/page.stories.ts": [ - { - "name": "Story", - "ctype": "miscellaneous", - "subtype": "typealias", - "rawtype": "StoryObj", - "file": "projects/lfx-component-lib/src/stories/page.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "description": "", - "kind": 183 - } - ], - "projects/lfx-component-lib/src/lib/__docs__/lfx-component-lib.stories.ts": [ - { - "name": "Story", - "ctype": "miscellaneous", - "subtype": "typealias", - "rawtype": "StoryObj", - "file": "projects/lfx-component-lib/src/lib/__docs__/lfx-component-lib.stories.ts", - "deprecated": false, - "deprecationMessage": "", - "description": "", - "kind": 183 - } - ], - "projects/lfx-component-lib/src/lib/containers/notice/__docs__/notice.stories.ts": [ + "projects/lfx-component-lib/src/lib/containers/sections/__docs__/sections.stories.ts": [ { "name": "Story", "ctype": "miscellaneous", "subtype": "typealias", - "rawtype": "StoryObj", - "file": "projects/lfx-component-lib/src/lib/containers/notice/__docs__/notice.stories.ts", + "rawtype": "StoryObj", + "file": "projects/lfx-component-lib/src/lib/containers/sections/__docs__/sections.stories.ts", "deprecated": false, "deprecationMessage": "", "description": "", "kind": 183 } ], - "projects/lfx-component-lib/src/lib/containers/sections/__docs__/sections.stories.ts": [ + "projects/lfx-component-lib/src/lib/containers/toast/__docs__/toast.stories.ts": [ { "name": "Story", "ctype": "miscellaneous", "subtype": "typealias", - "rawtype": "StoryObj", - "file": "projects/lfx-component-lib/src/lib/containers/sections/__docs__/sections.stories.ts", + "rawtype": "StoryObj", + "file": "projects/lfx-component-lib/src/lib/containers/toast/__docs__/toast.stories.ts", "deprecated": false, "deprecationMessage": "", "description": "", @@ -555,46 +191,6 @@ "coverageCount": "0/1", "status": "low" }, - { - "filePath": "projects/lfx-component-lib/src/lib/__docs__/lfx-component-lib.stories.ts", - "type": "variable", - "linktype": "miscellaneous", - "linksubtype": "variable", - "name": "LFXPrimary", - "coveragePercent": 0, - "coverageCount": "0/1", - "status": "low" - }, - { - "filePath": "projects/lfx-component-lib/src/lib/__docs__/lfx-component-lib.stories.ts", - "type": "variable", - "linktype": "miscellaneous", - "linksubtype": "variable", - "name": "meta", - "coveragePercent": 0, - "coverageCount": "0/1", - "status": "low" - }, - { - "filePath": "projects/lfx-component-lib/src/lib/containers/notice/__docs__/notice.stories.ts", - "type": "variable", - "linktype": "miscellaneous", - "linksubtype": "variable", - "name": "Info", - "coveragePercent": 0, - "coverageCount": "0/1", - "status": "low" - }, - { - "filePath": "projects/lfx-component-lib/src/lib/containers/notice/__docs__/notice.stories.ts", - "type": "variable", - "linktype": "miscellaneous", - "linksubtype": "variable", - "name": "meta", - "coveragePercent": 0, - "coverageCount": "0/1", - "status": "low" - }, { "filePath": "projects/lfx-component-lib/src/lib/containers/sections/__docs__/sections.stories.ts", "type": "variable", @@ -616,107 +212,17 @@ "status": "low" }, { - "filePath": "projects/lfx-component-lib/src/stories/button.stories.ts", - "type": "variable", - "linktype": "miscellaneous", - "linksubtype": "variable", - "name": "Large", - "coveragePercent": 0, - "coverageCount": "0/1", - "status": "low" - }, - { - "filePath": "projects/lfx-component-lib/src/stories/button.stories.ts", - "type": "variable", - "linktype": "miscellaneous", - "linksubtype": "variable", - "name": "meta", - "coveragePercent": 0, - "coverageCount": "0/1", - "status": "low" - }, - { - "filePath": "projects/lfx-component-lib/src/stories/button.stories.ts", - "type": "variable", - "linktype": "miscellaneous", - "linksubtype": "variable", - "name": "Primary", - "coveragePercent": 0, - "coverageCount": "0/1", - "status": "low" - }, - { - "filePath": "projects/lfx-component-lib/src/stories/button.stories.ts", - "type": "variable", - "linktype": "miscellaneous", - "linksubtype": "variable", - "name": "Secondary", - "coveragePercent": 0, - "coverageCount": "0/1", - "status": "low" - }, - { - "filePath": "projects/lfx-component-lib/src/stories/button.stories.ts", - "type": "variable", - "linktype": "miscellaneous", - "linksubtype": "variable", - "name": "Small", - "coveragePercent": 0, - "coverageCount": "0/1", - "status": "low" - }, - { - "filePath": "projects/lfx-component-lib/src/stories/header.stories.ts", - "type": "variable", - "linktype": "miscellaneous", - "linksubtype": "variable", - "name": "LoggedIn", - "coveragePercent": 0, - "coverageCount": "0/1", - "status": "low" - }, - { - "filePath": "projects/lfx-component-lib/src/stories/header.stories.ts", - "type": "variable", - "linktype": "miscellaneous", - "linksubtype": "variable", - "name": "LoggedOut", - "coveragePercent": 0, - "coverageCount": "0/1", - "status": "low" - }, - { - "filePath": "projects/lfx-component-lib/src/stories/header.stories.ts", - "type": "variable", - "linktype": "miscellaneous", - "linksubtype": "variable", - "name": "meta", - "coveragePercent": 0, - "coverageCount": "0/1", - "status": "low" - }, - { - "filePath": "projects/lfx-component-lib/src/stories/page.stories.ts", - "type": "variable", - "linktype": "miscellaneous", - "linksubtype": "variable", - "name": "LoggedIn", - "coveragePercent": 0, - "coverageCount": "0/1", - "status": "low" - }, - { - "filePath": "projects/lfx-component-lib/src/stories/page.stories.ts", + "filePath": "projects/lfx-component-lib/src/lib/containers/toast/__docs__/toast.stories.ts", "type": "variable", "linktype": "miscellaneous", "linksubtype": "variable", - "name": "LoggedOut", + "name": "Info", "coveragePercent": 0, "coverageCount": "0/1", "status": "low" }, { - "filePath": "projects/lfx-component-lib/src/stories/page.stories.ts", + "filePath": "projects/lfx-component-lib/src/lib/containers/toast/__docs__/toast.stories.ts", "type": "variable", "linktype": "miscellaneous", "linksubtype": "variable", diff --git a/projects/lfx-component-lib/package.json b/projects/lfx-component-lib/package.json index 2addc57..fd28653 100644 --- a/projects/lfx-component-lib/package.json +++ b/projects/lfx-component-lib/package.json @@ -1,6 +1,6 @@ { "name": "@emlimlf/lfx-component-lib", - "version": "0.0.9", + "version": "0.0.10", "peerDependencies": { "@angular/common": "^18.1.0", "@angular/core": "^18.1.0" diff --git a/projects/lfx-component-lib/src/lib/__docs__/Example.tsx b/projects/lfx-component-lib/src/lib/__docs__/Example.tsx deleted file mode 100644 index e69de29..0000000 diff --git a/projects/lfx-component-lib/src/lib/__docs__/lfx-component-lib.stories.ts b/projects/lfx-component-lib/src/lib/__docs__/lfx-component-lib.stories.ts deleted file mode 100644 index 6594700..0000000 --- a/projects/lfx-component-lib/src/lib/__docs__/lfx-component-lib.stories.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/angular'; -import { fn } from '@storybook/test'; -import { LfxComponentLibComponent } from '../lfx-component-lib.component'; - -// More on how to set up stories at: https://storybook.js.org/docs/writing-stories -const meta: Meta = { - title: 'Example/Button', - component: LfxComponentLibComponent, - tags: ['autodocs'], - argTypes: { - backgroundColor: { - control: 'color', - }, - }, - // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args - args: { onClick: fn() }, -}; - -export default meta; -type Story = StoryObj; - -// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args -export const LFXPrimary: Story = {}; diff --git a/projects/lfx-component-lib/src/lib/containers/notice/notice.component.html b/projects/lfx-component-lib/src/lib/containers/notice/notice.component.html deleted file mode 100644 index fad5a9c..0000000 --- a/projects/lfx-component-lib/src/lib/containers/notice/notice.component.html +++ /dev/null @@ -1,3 +0,0 @@ -
- -
diff --git a/projects/lfx-component-lib/src/lib/containers/notice/notice.component.scss b/projects/lfx-component-lib/src/lib/containers/notice/notice.component.scss deleted file mode 100644 index 90e72a9..0000000 --- a/projects/lfx-component-lib/src/lib/containers/notice/notice.component.scss +++ /dev/null @@ -1,19 +0,0 @@ -.lfx-notice { - padding: 20px; - border: 1px solid; - border-radius: 10px; - margin-bottom: 16px; - - &.info { - background-color: blue; - } - &.warning { - background-color: orange; - } - &.success { - background-color: green; - } - &.error { - background-color: red; - } -} diff --git a/projects/lfx-component-lib/src/lib/containers/notice/notice.component.ts b/projects/lfx-component-lib/src/lib/containers/notice/notice.component.ts deleted file mode 100644 index 4deba3a..0000000 --- a/projects/lfx-component-lib/src/lib/containers/notice/notice.component.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Component, input } from '@angular/core'; - -type IType = 'info' | 'warning' | 'success' | 'error'; -@Component({ - selector: 'lfx-notice', - standalone: true, - imports: [], - templateUrl: './notice.component.html', - styleUrl: './notice.component.scss', -}) -export class NoticeComponent { - type = input('info'); -} diff --git a/projects/lfx-component-lib/src/lib/containers/sections/__docs__/sections.stories.ts b/projects/lfx-component-lib/src/lib/containers/sections/__docs__/sections.stories.ts index 87421ef..638308b 100644 --- a/projects/lfx-component-lib/src/lib/containers/sections/__docs__/sections.stories.ts +++ b/projects/lfx-component-lib/src/lib/containers/sections/__docs__/sections.stories.ts @@ -4,7 +4,7 @@ import { SectionsComponent } from '../sections.component'; // More on how to set up stories at: https://storybook.js.org/docs/writing-stories const meta: Meta = { - title: 'Example/Containers/Sections', + title: 'LFX Components/Containers/Sections', component: SectionsComponent, tags: ['autodocs'], argTypes: { diff --git a/projects/lfx-component-lib/src/lib/containers/sections/sections.component.scss b/projects/lfx-component-lib/src/lib/containers/sections/sections.component.scss index cdb1c32..c02eb08 100644 --- a/projects/lfx-component-lib/src/lib/containers/sections/sections.component.scss +++ b/projects/lfx-component-lib/src/lib/containers/sections/sections.component.scss @@ -1,8 +1,11 @@ +@import "../../styles/constants.scss"; + +// TODO: This should be auto generated from the design tokens +// TODO: use alias instead of the direct primitive values section { - background-color: #fff; - padding: 20px; - border: 1px solid; - border-radius: 10px; - margin-right: 16px; - margin-bottom: 16px; + background-color: $grey-0; + padding: $dim-24; + border-radius: $dim-8; + margin-right: $dim-16; + margin-bottom: $dim-16; } diff --git a/projects/lfx-component-lib/src/lib/containers/notice/__docs__/notice.stories.ts b/projects/lfx-component-lib/src/lib/containers/toast/__docs__/toast.stories.ts similarity index 56% rename from projects/lfx-component-lib/src/lib/containers/notice/__docs__/notice.stories.ts rename to projects/lfx-component-lib/src/lib/containers/toast/__docs__/toast.stories.ts index 0199b48..b46b288 100644 --- a/projects/lfx-component-lib/src/lib/containers/notice/__docs__/notice.stories.ts +++ b/projects/lfx-component-lib/src/lib/containers/toast/__docs__/toast.stories.ts @@ -1,28 +1,29 @@ import type { Meta, StoryObj } from '@storybook/angular'; -import { NoticeComponent } from '../notice.component'; +import { ToastComponent } from '../toast.component'; // More on how to set up stories at: https://storybook.js.org/docs/writing-stories -const meta: Meta = { - title: 'Example/Containers/Notice', - component: NoticeComponent, +const meta: Meta = { + title: 'LFX Components/Containers/Toast', + component: ToastComponent, tags: ['autodocs'], argTypes: { type: { control: 'select', - options: ['info', 'warning', 'success', 'error'], + options: ['notice', 'warning', 'success', 'error'], + defaultValue: 'notice', }, }, }; export default meta; -type Story = StoryObj; +type Story = StoryObj; // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args export const Info: Story = { render: (args: any) => ({ - template: ` + template: `

Title

Body paragraph

-
`, + `, }), }; diff --git a/projects/lfx-component-lib/src/lib/containers/toast/toast.component.html b/projects/lfx-component-lib/src/lib/containers/toast/toast.component.html new file mode 100644 index 0000000..9a9eada --- /dev/null +++ b/projects/lfx-component-lib/src/lib/containers/toast/toast.component.html @@ -0,0 +1,3 @@ +
+ +
diff --git a/projects/lfx-component-lib/src/lib/containers/toast/toast.component.scss b/projects/lfx-component-lib/src/lib/containers/toast/toast.component.scss new file mode 100644 index 0000000..e233830 --- /dev/null +++ b/projects/lfx-component-lib/src/lib/containers/toast/toast.component.scss @@ -0,0 +1,27 @@ +@import "../../styles/constants.scss"; + +// TODO: This should be auto generated from the design tokens +// TODO: use alias instead of the direct primitive values +.lfx-toast { + padding: $dim-24 $dim-32; + border-radius: $dim-8; + border-left-width: $dim-8; + border-left-style: solid; + + &.notice { + background-color: $blue-50; + border-left-color: $blue-500; + } + &.warning { + background-color: $orange-50; + border-left-color: $orange-500; + } + &.success { + background-color: $green-50; + border-left-color: $green-500; + } + &.error { + background-color: $red-50; + border-left-color: $red-500; + } +} diff --git a/projects/lfx-component-lib/src/lib/containers/notice/notice.component.spec.ts b/projects/lfx-component-lib/src/lib/containers/toast/toast.component.spec.ts similarity index 50% rename from projects/lfx-component-lib/src/lib/containers/notice/notice.component.spec.ts rename to projects/lfx-component-lib/src/lib/containers/toast/toast.component.spec.ts index 4a01835..3cd9aaa 100644 --- a/projects/lfx-component-lib/src/lib/containers/notice/notice.component.spec.ts +++ b/projects/lfx-component-lib/src/lib/containers/toast/toast.component.spec.ts @@ -1,18 +1,17 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { NoticeComponent } from './notice.component'; +import { ToastComponent } from './toast.component'; -describe('NoticeComponent', () => { - let component: NoticeComponent; - let fixture: ComponentFixture; +describe('ToastComponent', () => { + let component: ToastComponent; + let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [NoticeComponent] - }) - .compileComponents(); + imports: [ToastComponent], + }).compileComponents(); - fixture = TestBed.createComponent(NoticeComponent); + fixture = TestBed.createComponent(ToastComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/projects/lfx-component-lib/src/lib/containers/toast/toast.component.ts b/projects/lfx-component-lib/src/lib/containers/toast/toast.component.ts new file mode 100644 index 0000000..afc8fcb --- /dev/null +++ b/projects/lfx-component-lib/src/lib/containers/toast/toast.component.ts @@ -0,0 +1,13 @@ +import { Component, input } from '@angular/core'; + +type IType = 'notice' | 'warning' | 'success' | 'error'; +@Component({ + selector: 'lfx-toast', + standalone: true, + imports: [], + templateUrl: './toast.component.html', + styleUrl: './toast.component.scss', +}) +export class ToastComponent { + type = input('notice'); +} diff --git a/projects/lfx-component-lib/src/lib/lfx-component-lib.component.spec.ts b/projects/lfx-component-lib/src/lib/lfx-component-lib.component.spec.ts deleted file mode 100644 index 66de2ea..0000000 --- a/projects/lfx-component-lib/src/lib/lfx-component-lib.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { LfxComponentLibComponent } from './lfx-component-lib.component'; - -describe('LfxComponentLibComponent', () => { - let component: LfxComponentLibComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [LfxComponentLibComponent] - }) - .compileComponents(); - - fixture = TestBed.createComponent(LfxComponentLibComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/projects/lfx-component-lib/src/lib/lfx-component-lib.component.ts b/projects/lfx-component-lib/src/lib/lfx-component-lib.component.ts deleted file mode 100644 index 2a5b6cd..0000000 --- a/projects/lfx-component-lib/src/lib/lfx-component-lib.component.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'lib-lfx-component-lib', - standalone: true, - imports: [], - template: ` `, - styles: ``, -}) -export class LfxComponentLibComponent {} diff --git a/projects/lfx-component-lib/src/lib/lfx-component-lib.service.spec.ts b/projects/lfx-component-lib/src/lib/lfx-component-lib.service.spec.ts deleted file mode 100644 index 09a1c65..0000000 --- a/projects/lfx-component-lib/src/lib/lfx-component-lib.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { LfxComponentLibService } from './lfx-component-lib.service'; - -describe('LfxComponentLibService', () => { - let service: LfxComponentLibService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(LfxComponentLibService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/projects/lfx-component-lib/src/lib/styles/constants.scss b/projects/lfx-component-lib/src/lib/styles/constants.scss new file mode 100644 index 0000000..febf54f --- /dev/null +++ b/projects/lfx-component-lib/src/lib/styles/constants.scss @@ -0,0 +1,93 @@ +$grey-0: #fafcfe; +$grey-50: #f2f3f4; +$grey-100: #d8dbdd; +$grey-200: #c5cacc; +$grey-300: #aab1b5; +$grey-400: #99a2a7; +$grey-500: #808b91; +$grey-600: #747e84; +$grey-700: #5b6367; +$grey-800: #464c50; +$grey-900: #363a3d; +$grey-1000: #282e32; +$blue-50: #ebf5fc; +$blue-100: #c0e0f5; +$blue-200: #a2d1f0; +$blue-300: #78bbe9; +$blue-400: #5daee5; +$blue-500: #359ade; +$blue-600: #308cca; +$blue-700: #266d9e; +$blue-800: #1d557a; +$blue-900: #16415d; +$blue-1000: #0f2d40; +$green-50: #ecfaf5; +$green-100: #c4efe0; +$green-200: #a7e7d1; +$green-300: #7fdbbd; +$green-400: #66d5b0; +$green-500: #40ca9c; +$green-600: #3ab88e; +$green-700: #2d8f6f; +$green-800: #236f56; +$green-900: #1b5542; +$green-1000: #133b2e; +$red-50: #faece8; +$red-100: #efc4b6; +$red-200: #e7a893; +$red-300: #db8062; +$red-400: #d56744; +$red-500: #ca4115; +$red-600: #b83b13; +$red-700: #8f2e0f; +$red-800: #6f240c; +$red-900: #551b09; +$red-1000: #3b1206; +$yellow-50: #fef8e8; +$yellow-100: #faeab9; +$yellow-200: #f8df97; +$yellow-300: #f5d168; +$yellow-400: #f3c84a; +$yellow-500: #f0ba1d; +$yellow-600: #daa91a; +$yellow-700: #aa8415; +$yellow-800: #846610; +$yellow-900: #654e0c; +$yellow-1000: #463608; +$orange-50: #fcf1e6; +$orange-100: #f5d5b0; +$orange-200: #f0c08a; +$orange-300: #e9a455; +$orange-400: #e59234; +$orange-500: #de7701; +$orange-600: #ca6c01; +$orange-700: #9e5401; +$orange-800: #7a4101; +$orange-900: #5d3200; +$orange-1000: #402300; +$overlay-grey-0-50: #fafcfe80; +$overlay-grey-1000-50: #282e3280; + +$dim-0: 0px; +$dim-1: 1px; +$dim-2: 2px; +$dim-4: 4px; +$dim-6: 6px; +$dim-8: 8px; +$dim-11: 11px; +$dim-12: 12px; +$dim-14: 14px; +$dim-16: 16px; +$dim-18: 18px; +$dim-22: 22px; +$dim-24: 24px; +$dim-27: 27px; +$dim-32: 32px; +$dim-40: 40px; +$dim-48: 48px; +$dim-56: 56px; +$dim-64: 64px; +$dim-88: 88px; +$dim-104: 104px; +$dim-144: 144px; +$dim-160: 160px; \ No newline at end of file diff --git a/projects/lfx-component-lib/src/public-api.ts b/projects/lfx-component-lib/src/public-api.ts index c0d1015..d6e7987 100644 --- a/projects/lfx-component-lib/src/public-api.ts +++ b/projects/lfx-component-lib/src/public-api.ts @@ -3,4 +3,5 @@ */ export * from './lib/lfx-component-lib.service'; -export * from './lib/lfx-component-lib.component'; +export * from './lib/containers/sections/sections.component'; +export * from './lib/containers/toast/toast.component'; diff --git a/projects/lfx-component-lib/src/stories/.eslintrc.json b/projects/lfx-component-lib/src/stories/.eslintrc.json deleted file mode 100644 index 57c1b32..0000000 --- a/projects/lfx-component-lib/src/stories/.eslintrc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "rules": { - "@typescript-eslint/consistent-type-imports": ["error", { "disallowTypeAnnotations": false }] - } -} diff --git a/projects/lfx-component-lib/src/stories/Configure.mdx b/projects/lfx-component-lib/src/stories/Configure.mdx deleted file mode 100644 index 532066d..0000000 --- a/projects/lfx-component-lib/src/stories/Configure.mdx +++ /dev/null @@ -1,364 +0,0 @@ -import { Meta } from "@storybook/blocks"; - -import Github from "./assets/github.svg"; -import Discord from "./assets/discord.svg"; -import Youtube from "./assets/youtube.svg"; -import Tutorials from "./assets/tutorials.svg"; -import Styling from "./assets/styling.png"; -import Context from "./assets/context.png"; -import Assets from "./assets/assets.png"; -import Docs from "./assets/docs.png"; -import Share from "./assets/share.png"; -import FigmaPlugin from "./assets/figma-plugin.png"; -import Testing from "./assets/testing.png"; -import Accessibility from "./assets/accessibility.png"; -import Theming from "./assets/theming.png"; -import AddonLibrary from "./assets/addon-library.png"; - -export const RightArrow = () => - - - - - -
-
- # Configure your project - - Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community. -
-
-
- A wall of logos representing different styling technologies -

Add styling and CSS

-

Like with web applications, there are many ways to include CSS within Storybook. Learn more about setting up styling within Storybook.

- Learn more -
-
- An abstraction representing the composition of data for a component -

Provide context and mocking

-

Often when a story doesn't render, it's because your component is expecting a specific environment or context (like a theme provider) to be available.

- Learn more -
-
- A representation of typography and image assets -
-

Load assets and resources

-

To link static files (like fonts) to your projects and stories, use the - `staticDirs` configuration option to specify folders to load when - starting Storybook.

- Learn more -
-
-
-
-
-
- # Do more with Storybook - - Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs. -
- -
-
-
- A screenshot showing the autodocs tag being set, pointing a docs page being generated -

Autodocs

-

Auto-generate living, - interactive reference documentation from your components and stories.

- Learn more -
-
- A browser window showing a Storybook being published to a chromatic.com URL -

Publish to Chromatic

-

Publish your Storybook to review and collaborate with your entire team.

- Learn more -
-
- Windows showing the Storybook plugin in Figma -

Figma Plugin

-

Embed your stories into Figma to cross-reference the design and live - implementation in one place.

- Learn more -
-
- Screenshot of tests passing and failing -

Testing

-

Use stories to test a component in all its variations, no matter how - complex.

- Learn more -
-
- Screenshot of accessibility tests passing and failing -

Accessibility

-

Automatically test your components for a11y issues as you develop.

- Learn more -
-
- Screenshot of Storybook in light and dark mode -

Theming

-

Theme Storybook's UI to personalize it to your project.

- Learn more -
-
-
-
-
-
-

Addons

-

Integrate your tools with Storybook to connect workflows.

- Discover all addons -
-
- Integrate your tools with Storybook to connect workflows. -
-
- -
-
- Github logo - Join our contributors building the future of UI development. - - Star on GitHub -
-
- Discord logo -
- Get support and chat with frontend developers. - - Join Discord server -
-
-
- Youtube logo -
- Watch tutorials, feature previews and interviews. - - Watch on YouTube -
-
-
- A book -

Follow guided walkthroughs on for key workflows.

- - Discover tutorials -
-
- - diff --git a/projects/lfx-component-lib/src/stories/assets/accessibility.png b/projects/lfx-component-lib/src/stories/assets/accessibility.png deleted file mode 100644 index 6ffe6fe..0000000 Binary files a/projects/lfx-component-lib/src/stories/assets/accessibility.png and /dev/null differ diff --git a/projects/lfx-component-lib/src/stories/assets/accessibility.svg b/projects/lfx-component-lib/src/stories/assets/accessibility.svg deleted file mode 100644 index 107e93f..0000000 --- a/projects/lfx-component-lib/src/stories/assets/accessibility.svg +++ /dev/null @@ -1 +0,0 @@ -Accessibility \ No newline at end of file diff --git a/projects/lfx-component-lib/src/stories/assets/addon-library.png b/projects/lfx-component-lib/src/stories/assets/addon-library.png deleted file mode 100644 index 95deb38..0000000 Binary files a/projects/lfx-component-lib/src/stories/assets/addon-library.png and /dev/null differ diff --git a/projects/lfx-component-lib/src/stories/assets/assets.png b/projects/lfx-component-lib/src/stories/assets/assets.png deleted file mode 100644 index cfba681..0000000 Binary files a/projects/lfx-component-lib/src/stories/assets/assets.png and /dev/null differ diff --git a/projects/lfx-component-lib/src/stories/assets/avif-test-image.avif b/projects/lfx-component-lib/src/stories/assets/avif-test-image.avif deleted file mode 100644 index 530709b..0000000 Binary files a/projects/lfx-component-lib/src/stories/assets/avif-test-image.avif and /dev/null differ diff --git a/projects/lfx-component-lib/src/stories/assets/context.png b/projects/lfx-component-lib/src/stories/assets/context.png deleted file mode 100644 index e5cd249..0000000 Binary files a/projects/lfx-component-lib/src/stories/assets/context.png and /dev/null differ diff --git a/projects/lfx-component-lib/src/stories/assets/discord.svg b/projects/lfx-component-lib/src/stories/assets/discord.svg deleted file mode 100644 index d638958..0000000 --- a/projects/lfx-component-lib/src/stories/assets/discord.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/projects/lfx-component-lib/src/stories/assets/docs.png b/projects/lfx-component-lib/src/stories/assets/docs.png deleted file mode 100644 index a749629..0000000 Binary files a/projects/lfx-component-lib/src/stories/assets/docs.png and /dev/null differ diff --git a/projects/lfx-component-lib/src/stories/assets/figma-plugin.png b/projects/lfx-component-lib/src/stories/assets/figma-plugin.png deleted file mode 100644 index 8f79b08..0000000 Binary files a/projects/lfx-component-lib/src/stories/assets/figma-plugin.png and /dev/null differ diff --git a/projects/lfx-component-lib/src/stories/assets/github.svg b/projects/lfx-component-lib/src/stories/assets/github.svg deleted file mode 100644 index dc51352..0000000 --- a/projects/lfx-component-lib/src/stories/assets/github.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/projects/lfx-component-lib/src/stories/assets/share.png b/projects/lfx-component-lib/src/stories/assets/share.png deleted file mode 100644 index 8097a37..0000000 Binary files a/projects/lfx-component-lib/src/stories/assets/share.png and /dev/null differ diff --git a/projects/lfx-component-lib/src/stories/assets/styling.png b/projects/lfx-component-lib/src/stories/assets/styling.png deleted file mode 100644 index d341e82..0000000 Binary files a/projects/lfx-component-lib/src/stories/assets/styling.png and /dev/null differ diff --git a/projects/lfx-component-lib/src/stories/assets/testing.png b/projects/lfx-component-lib/src/stories/assets/testing.png deleted file mode 100644 index d4ac39a..0000000 Binary files a/projects/lfx-component-lib/src/stories/assets/testing.png and /dev/null differ diff --git a/projects/lfx-component-lib/src/stories/assets/theming.png b/projects/lfx-component-lib/src/stories/assets/theming.png deleted file mode 100644 index 1535eb9..0000000 Binary files a/projects/lfx-component-lib/src/stories/assets/theming.png and /dev/null differ diff --git a/projects/lfx-component-lib/src/stories/assets/tutorials.svg b/projects/lfx-component-lib/src/stories/assets/tutorials.svg deleted file mode 100644 index b492a9c..0000000 --- a/projects/lfx-component-lib/src/stories/assets/tutorials.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/projects/lfx-component-lib/src/stories/assets/youtube.svg b/projects/lfx-component-lib/src/stories/assets/youtube.svg deleted file mode 100644 index a7515d7..0000000 --- a/projects/lfx-component-lib/src/stories/assets/youtube.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/projects/lfx-component-lib/src/stories/button.component.ts b/projects/lfx-component-lib/src/stories/button.component.ts deleted file mode 100644 index badc6ba..0000000 --- a/projects/lfx-component-lib/src/stories/button.component.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { Component, Input, Output, EventEmitter } from '@angular/core'; - -@Component({ - selector: 'storybook-button', - standalone: true, - imports: [CommonModule], - template: ` `, - styleUrls: ['./button.css'], -}) -export class ButtonComponent { - /** - * Is this the principal call to action on the page? - */ - @Input() - primary = false; - - /** - * What background color to use - */ - @Input() - backgroundColor?: string; - - /** - * How large should the button be? - */ - @Input() - size: 'small' | 'medium' | 'large' = 'medium'; - - /** - * Button contents - * - * @required - */ - @Input() - label = 'Button'; - - /** - * Optional click handler - */ - @Output() - onClick = new EventEmitter(); - - public get classes(): string[] { - const mode = this.primary ? 'storybook-button--primary' : 'storybook-button--secondary'; - - return ['storybook-button', `storybook-button--${this.size}`, mode]; - } -} diff --git a/projects/lfx-component-lib/src/stories/button.css b/projects/lfx-component-lib/src/stories/button.css deleted file mode 100644 index dc91dc7..0000000 --- a/projects/lfx-component-lib/src/stories/button.css +++ /dev/null @@ -1,30 +0,0 @@ -.storybook-button { - font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - font-weight: 700; - border: 0; - border-radius: 3em; - cursor: pointer; - display: inline-block; - line-height: 1; -} -.storybook-button--primary { - color: white; - background-color: #1ea7fd; -} -.storybook-button--secondary { - color: #333; - background-color: transparent; - box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset; -} -.storybook-button--small { - font-size: 12px; - padding: 10px 16px; -} -.storybook-button--medium { - font-size: 14px; - padding: 11px 20px; -} -.storybook-button--large { - font-size: 16px; - padding: 12px 24px; -} diff --git a/projects/lfx-component-lib/src/stories/button.stories.ts b/projects/lfx-component-lib/src/stories/button.stories.ts deleted file mode 100644 index 886310b..0000000 --- a/projects/lfx-component-lib/src/stories/button.stories.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/angular'; -import { fn } from '@storybook/test'; -import { ButtonComponent } from './button.component'; - -// More on how to set up stories at: https://storybook.js.org/docs/writing-stories -const meta: Meta = { - title: 'Example/Button', - component: ButtonComponent, - tags: ['autodocs'], - argTypes: { - backgroundColor: { - control: 'color', - }, - }, - // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args - args: { onClick: fn() }, -}; - -export default meta; -type Story = StoryObj; - -// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args -export const Primary: Story = { - args: { - primary: true, - label: 'Button', - }, -}; - -export const Secondary: Story = { - args: { - label: 'Button', - }, -}; - -export const Large: Story = { - args: { - size: 'large', - label: 'Button', - }, -}; - -export const Small: Story = { - args: { - size: 'small', - label: 'Button', - }, -}; diff --git a/projects/lfx-component-lib/src/stories/header.component.ts b/projects/lfx-component-lib/src/stories/header.component.ts deleted file mode 100644 index 1c3544f..0000000 --- a/projects/lfx-component-lib/src/stories/header.component.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { Component, Input, Output, EventEmitter } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -import { ButtonComponent } from './button.component'; -import type { User } from './user'; - -@Component({ - selector: 'storybook-header', - standalone: true, - imports: [CommonModule, ButtonComponent], - template: `
-
-
- - - - - - - -

Acme

-
-
-
- - Welcome, {{ user.name }}! - - -
-
- - -
-
-
-
`, - styleUrls: ['./header.css'], -}) -export class HeaderComponent { - @Input() - user: User | null = null; - - @Output() - onLogin = new EventEmitter(); - - @Output() - onLogout = new EventEmitter(); - - @Output() - onCreateAccount = new EventEmitter(); -} diff --git a/projects/lfx-component-lib/src/stories/header.css b/projects/lfx-component-lib/src/stories/header.css deleted file mode 100644 index d9a7052..0000000 --- a/projects/lfx-component-lib/src/stories/header.css +++ /dev/null @@ -1,32 +0,0 @@ -.storybook-header { - font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - padding: 15px 20px; - display: flex; - align-items: center; - justify-content: space-between; -} - -.storybook-header svg { - display: inline-block; - vertical-align: top; -} - -.storybook-header h1 { - font-weight: 700; - font-size: 20px; - line-height: 1; - margin: 6px 0 6px 10px; - display: inline-block; - vertical-align: top; -} - -.storybook-header button + button { - margin-left: 10px; -} - -.storybook-header .welcome { - color: #333; - font-size: 14px; - margin-right: 10px; -} diff --git a/projects/lfx-component-lib/src/stories/header.stories.ts b/projects/lfx-component-lib/src/stories/header.stories.ts deleted file mode 100644 index 3f3fb68..0000000 --- a/projects/lfx-component-lib/src/stories/header.stories.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/angular'; - -import { HeaderComponent } from './header.component'; -import { fn } from '@storybook/test'; - -const meta: Meta = { - title: 'Example/Header', - component: HeaderComponent, - // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs - tags: ['autodocs'], - parameters: { - // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout - layout: 'fullscreen', - }, - args: { - onLogin: fn(), - onLogout: fn(), - onCreateAccount: fn(), - }, -}; - -export default meta; -type Story = StoryObj; - -export const LoggedIn: Story = { - args: { - user: { - name: 'Jane Doe', - }, - }, -}; - -export const LoggedOut: Story = {}; diff --git a/projects/lfx-component-lib/src/stories/page.component.ts b/projects/lfx-component-lib/src/stories/page.component.ts deleted file mode 100644 index 08cc9ca..0000000 --- a/projects/lfx-component-lib/src/stories/page.component.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { Component } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -import { HeaderComponent } from './header.component'; -import type { User } from './user'; - -@Component({ - selector: 'storybook-page', - standalone: true, - imports: [CommonModule, HeaderComponent], - template: `
- -
-

Pages in Storybook

-

- We recommend building UIs with a - - component-driven - - process starting with atomic components and ending with pages. -

-

- Render pages with mock data. This makes it easy to build and review page states without - needing to navigate to them in your app. Here are some handy patterns for managing page data - in Storybook: -

-
    -
  • - Use a higher-level connected component. Storybook helps you compose such data from the - "args" of child component stories -
  • -
  • - Assemble data in the page component from your services. You can mock these services out - using Storybook. -
  • -
-

- Get a guided tutorial on component-driven development at - - Storybook tutorials - - . Read more in the - docs - . -

-
- Tip Adjust the width of the canvas with the - - - - - - Viewports addon in the toolbar -
-
-
`, - styleUrls: ['./page.css'], -}) -export class PageComponent { - user: User | null = null; - - doLogout() { - this.user = null; - } - - doLogin() { - this.user = { name: 'Jane Doe' }; - } - - doCreateAccount() { - this.user = { name: 'Jane Doe' }; - } -} diff --git a/projects/lfx-component-lib/src/stories/page.css b/projects/lfx-component-lib/src/stories/page.css deleted file mode 100644 index 098dad1..0000000 --- a/projects/lfx-component-lib/src/stories/page.css +++ /dev/null @@ -1,69 +0,0 @@ -.storybook-page { - font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - font-size: 14px; - line-height: 24px; - padding: 48px 20px; - margin: 0 auto; - max-width: 600px; - color: #333; -} - -.storybook-page h2 { - font-weight: 700; - font-size: 32px; - line-height: 1; - margin: 0 0 4px; - display: inline-block; - vertical-align: top; -} - -.storybook-page p { - margin: 1em 0; -} - -.storybook-page a { - text-decoration: none; - color: #1ea7fd; -} - -.storybook-page ul { - padding-left: 30px; - margin: 1em 0; -} - -.storybook-page li { - margin-bottom: 8px; -} - -.storybook-page .tip { - display: inline-block; - border-radius: 1em; - font-size: 11px; - line-height: 12px; - font-weight: 700; - background: #e7fdd8; - color: #66bf3c; - padding: 4px 12px; - margin-right: 10px; - vertical-align: top; -} - -.storybook-page .tip-wrapper { - font-size: 13px; - line-height: 20px; - margin-top: 40px; - margin-bottom: 40px; -} - -.storybook-page .tip-wrapper svg { - display: inline-block; - height: 12px; - width: 12px; - margin-right: 4px; - vertical-align: top; - margin-top: 3px; -} - -.storybook-page .tip-wrapper svg path { - fill: #1ea7fd; -} diff --git a/projects/lfx-component-lib/src/stories/page.stories.ts b/projects/lfx-component-lib/src/stories/page.stories.ts deleted file mode 100644 index 5a64cdb..0000000 --- a/projects/lfx-component-lib/src/stories/page.stories.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/angular'; -import { within, userEvent, expect } from '@storybook/test'; - -import { PageComponent } from './page.component'; - -const meta: Meta = { - title: 'Example/Page', - component: PageComponent, - parameters: { - // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout - layout: 'fullscreen', - }, -}; - -export default meta; -type Story = StoryObj; - -export const LoggedOut: Story = {}; - -// More on interaction testing: https://storybook.js.org/docs/writing-tests/interaction-testing -export const LoggedIn: Story = { - play: async ({ canvasElement }) => { - const canvas = within(canvasElement); - const loginButton = canvas.getByRole('button', { name: /Log in/i }); - await expect(loginButton).toBeInTheDocument(); - await userEvent.click(loginButton); - await expect(loginButton).not.toBeInTheDocument(); - - const logoutButton = canvas.getByRole('button', { name: /Log out/i }); - await expect(logoutButton).toBeInTheDocument(); - }, -}; diff --git a/projects/lfx-component-lib/src/stories/user.ts b/projects/lfx-component-lib/src/stories/user.ts deleted file mode 100644 index c664619..0000000 --- a/projects/lfx-component-lib/src/stories/user.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface User { - name: string; -} diff --git a/scripts/build-colors.ts b/scripts/build-colors.ts index 3f05146..3d5a1f7 100644 --- a/scripts/build-colors.ts +++ b/scripts/build-colors.ts @@ -1,11 +1,7 @@ // Copyright The Linux Foundation and each contributor to LFX. // SPDX-License-Identifier: MIT import { colorBase } from './helpers/base-css'; -import { - getKeyValue, - findKeyValue, - getPrimitiveValue, -} from './helpers/helper-functions'; +import { getPrimitiveValue } from './helpers/helper-functions'; import { primitives, lightMode } from './helpers/read-json'; import { colorDefinitions, diff --git a/scripts/build-constants.ts b/scripts/build-constants.ts new file mode 100644 index 0000000..be104f2 --- /dev/null +++ b/scripts/build-constants.ts @@ -0,0 +1,65 @@ +// Copyright The Linux Foundation and each contributor to LFX. +// SPDX-License-Identifier: MIT + +import { primitives } from './helpers/read-json'; +import { IPrimitiveObj } from './interfaces/colors'; + +function buildColors() { + console.log('Building colors...'); + const colors = primitives.colors; + let output: string[] = []; + + if (colors) { + Object.keys(colors).forEach((color: string) => { + output = output.concat(generateSubColors(color, colors[color])); + }); + } + + return output; +} + +function buildDimensions() { + console.log('Building dimensions...'); + const dimensions = primitives.dimensions; + let output: string[] = []; + + if (dimensions) { + Object.keys(dimensions).forEach((dim: string) => { + output.push(`$${dim}: ${dimensions[dim].value};`); + }); + } + + return output; +} + +function generateSubColors( + colorKey: string, + colorObj: Record, +): string[] { + return Object.keys(colorObj).map( + (subColor: string) => + '$' + colorKey + '-' + subColor + ': ' + colorObj[subColor].value + ';', + ); +} + +function buildConstants() { + const { writeFile } = require('fs'); + + const targetPath = `./projects/lfx-component-lib/src/lib/styles/constants.scss`; + + const colorOuput = buildColors(); + const dimOutput = buildDimensions(); + + const output = colorOuput.join('\n') + '\n\n' + dimOutput.join('\n'); + + // write the content to the respective file + writeFile(targetPath, output, (err: any) => { + if (err) { + console.log(err); + } else { + console.log(`Wrote variables to ${targetPath}`); + } + }); +} + +buildConstants();