diff --git a/implem/src/app/styles/_app.scss b/implem/src/app/styles/_app.scss new file mode 100644 index 0000000..ae60380 --- /dev/null +++ b/implem/src/app/styles/_app.scss @@ -0,0 +1,10 @@ + +// libs +//@use 'remixicon/fonts/remixicon.scss'; + +// dev tools +//@use '_app.scss'; +@use '_global.scss'; +@use '_debug.scss'; +@use '_variables.scss'; + diff --git a/implem/src/app/styles/_debug.scss b/implem/src/app/styles/_debug.scss new file mode 100644 index 0000000..e69de29 diff --git a/implem/src/app/styles/_global.scss b/implem/src/app/styles/_global.scss new file mode 100644 index 0000000..ba2bb61 --- /dev/null +++ b/implem/src/app/styles/_global.scss @@ -0,0 +1,5 @@ +body{ + background: #dedede; + margin: 0 auto; + padding: 1rem 3rem; +} diff --git a/implem/src/app/styles/_variables.scss b/implem/src/app/styles/_variables.scss new file mode 100644 index 0000000..e69de29 diff --git a/implem/src/stories/Configure.mdx b/implem/src/stories/Configure.mdx deleted file mode 100644 index a38feff..0000000 --- a/implem/src/stories/Configure.mdx +++ /dev/null @@ -1,364 +0,0 @@ -import { Meta } from "@storybook/addon-docs/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/implem/src/stories/assets/accessibility.png b/implem/src/stories/assets/accessibility.png deleted file mode 100644 index 6ffe6fe..0000000 Binary files a/implem/src/stories/assets/accessibility.png and /dev/null differ diff --git a/implem/src/stories/assets/accessibility.svg b/implem/src/stories/assets/accessibility.svg deleted file mode 100644 index 107e93f..0000000 --- a/implem/src/stories/assets/accessibility.svg +++ /dev/null @@ -1 +0,0 @@ -Accessibility \ No newline at end of file diff --git a/implem/src/stories/assets/addon-library.png b/implem/src/stories/assets/addon-library.png deleted file mode 100644 index 95deb38..0000000 Binary files a/implem/src/stories/assets/addon-library.png and /dev/null differ diff --git a/implem/src/stories/assets/assets.png b/implem/src/stories/assets/assets.png deleted file mode 100644 index cfba681..0000000 Binary files a/implem/src/stories/assets/assets.png and /dev/null differ diff --git a/implem/src/stories/assets/avif-test-image.avif b/implem/src/stories/assets/avif-test-image.avif deleted file mode 100644 index 530709b..0000000 Binary files a/implem/src/stories/assets/avif-test-image.avif and /dev/null differ diff --git a/implem/src/stories/assets/context.png b/implem/src/stories/assets/context.png deleted file mode 100644 index e5cd249..0000000 Binary files a/implem/src/stories/assets/context.png and /dev/null differ diff --git a/implem/src/stories/assets/discord.svg b/implem/src/stories/assets/discord.svg deleted file mode 100644 index d638958..0000000 --- a/implem/src/stories/assets/discord.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/implem/src/stories/assets/docs.png b/implem/src/stories/assets/docs.png deleted file mode 100644 index a749629..0000000 Binary files a/implem/src/stories/assets/docs.png and /dev/null differ diff --git a/implem/src/stories/assets/figma-plugin.png b/implem/src/stories/assets/figma-plugin.png deleted file mode 100644 index 8f79b08..0000000 Binary files a/implem/src/stories/assets/figma-plugin.png and /dev/null differ diff --git a/implem/src/stories/assets/github.svg b/implem/src/stories/assets/github.svg deleted file mode 100644 index dc51352..0000000 --- a/implem/src/stories/assets/github.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/implem/src/stories/assets/share.png b/implem/src/stories/assets/share.png deleted file mode 100644 index 8097a37..0000000 Binary files a/implem/src/stories/assets/share.png and /dev/null differ diff --git a/implem/src/stories/assets/styling.png b/implem/src/stories/assets/styling.png deleted file mode 100644 index d341e82..0000000 Binary files a/implem/src/stories/assets/styling.png and /dev/null differ diff --git a/implem/src/stories/assets/testing.png b/implem/src/stories/assets/testing.png deleted file mode 100644 index d4ac39a..0000000 Binary files a/implem/src/stories/assets/testing.png and /dev/null differ diff --git a/implem/src/stories/assets/theming.png b/implem/src/stories/assets/theming.png deleted file mode 100644 index 1535eb9..0000000 Binary files a/implem/src/stories/assets/theming.png and /dev/null differ diff --git a/implem/src/stories/assets/tutorials.svg b/implem/src/stories/assets/tutorials.svg deleted file mode 100644 index b492a9c..0000000 --- a/implem/src/stories/assets/tutorials.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/implem/src/stories/assets/youtube.svg b/implem/src/stories/assets/youtube.svg deleted file mode 100644 index a7515d7..0000000 --- a/implem/src/stories/assets/youtube.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/implem/src/stories/button.component.ts b/implem/src/stories/button.component.ts deleted file mode 100644 index a1cdf6a..0000000 --- a/implem/src/stories/button.component.ts +++ /dev/null @@ -1,48 +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/implem/src/stories/button.css b/implem/src/stories/button.css deleted file mode 100644 index 4e3620b..0000000 --- a/implem/src/stories/button.css +++ /dev/null @@ -1,30 +0,0 @@ -.storybook-button { - display: inline-block; - cursor: pointer; - border: 0; - border-radius: 3em; - font-weight: 700; - line-height: 1; - font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; -} -.storybook-button--primary { - background-color: #555ab9; - color: white; -} -.storybook-button--secondary { - box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset; - background-color: transparent; - color: #333; -} -.storybook-button--small { - padding: 10px 16px; - font-size: 12px; -} -.storybook-button--medium { - padding: 11px 20px; - font-size: 14px; -} -.storybook-button--large { - padding: 12px 24px; - font-size: 16px; -} diff --git a/implem/src/stories/button.stories.ts b/implem/src/stories/button.stories.ts deleted file mode 100644 index 5c12e31..0000000 --- a/implem/src/stories/button.stories.ts +++ /dev/null @@ -1,49 +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/implem/src/stories/header.component.ts b/implem/src/stories/header.component.ts deleted file mode 100644 index 4d3a4fd..0000000 --- a/implem/src/stories/header.component.ts +++ /dev/null @@ -1,76 +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/implem/src/stories/header.css b/implem/src/stories/header.css deleted file mode 100644 index 5efd46c..0000000 --- a/implem/src/stories/header.css +++ /dev/null @@ -1,32 +0,0 @@ -.storybook-header { - display: flex; - justify-content: space-between; - align-items: center; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - padding: 15px 20px; - font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; -} - -.storybook-header svg { - display: inline-block; - vertical-align: top; -} - -.storybook-header h1 { - display: inline-block; - vertical-align: top; - margin: 6px 0 6px 10px; - font-weight: 700; - font-size: 20px; - line-height: 1; -} - -.storybook-header button + button { - margin-left: 10px; -} - -.storybook-header .welcome { - margin-right: 10px; - color: #333; - font-size: 14px; -} diff --git a/implem/src/stories/header.stories.ts b/implem/src/stories/header.stories.ts deleted file mode 100644 index 8a9f73b..0000000 --- a/implem/src/stories/header.stories.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/angular'; -import { fn } from 'storybook/test'; - -import { HeaderComponent } from './header.component'; - -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/implem/src/stories/page.component.ts b/implem/src/stories/page.component.ts deleted file mode 100644 index fca9d29..0000000 --- a/implem/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/implem/src/stories/page.css b/implem/src/stories/page.css deleted file mode 100644 index 77c81d2..0000000 --- a/implem/src/stories/page.css +++ /dev/null @@ -1,68 +0,0 @@ -.storybook-page { - margin: 0 auto; - padding: 48px 20px; - max-width: 600px; - color: #333; - font-size: 14px; - line-height: 24px; - font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; -} - -.storybook-page h2 { - display: inline-block; - vertical-align: top; - margin: 0 0 4px; - font-weight: 700; - font-size: 32px; - line-height: 1; -} - -.storybook-page p { - margin: 1em 0; -} - -.storybook-page a { - color: inherit; -} - -.storybook-page ul { - margin: 1em 0; - padding-left: 30px; -} - -.storybook-page li { - margin-bottom: 8px; -} - -.storybook-page .tip { - display: inline-block; - vertical-align: top; - margin-right: 10px; - border-radius: 1em; - background: #e7fdd8; - padding: 4px 12px; - color: #357a14; - font-weight: 700; - font-size: 11px; - line-height: 12px; -} - -.storybook-page .tip-wrapper { - margin-top: 40px; - margin-bottom: 40px; - font-size: 13px; - line-height: 20px; -} - -.storybook-page .tip-wrapper svg { - display: inline-block; - vertical-align: top; - margin-top: 3px; - margin-right: 4px; - width: 12px; - height: 12px; -} - -.storybook-page .tip-wrapper svg path { - fill: #1ea7fd; -} diff --git a/implem/src/stories/page.stories.ts b/implem/src/stories/page.stories.ts deleted file mode 100644 index 659a14c..0000000 --- a/implem/src/stories/page.stories.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/angular'; -import { expect, userEvent, within } 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 component 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/implem/src/stories/user.ts b/implem/src/stories/user.ts deleted file mode 100644 index c664619..0000000 --- a/implem/src/stories/user.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface User { - name: string; -} diff --git a/implem/src/styles.scss b/implem/src/styles.scss index 90d4ee0..1075de2 100644 --- a/implem/src/styles.scss +++ b/implem/src/styles.scss @@ -1 +1,4 @@ -/* You can add global styles to this file, and also import other style files */ +// from global to more precise +// sass lang utils +@use "sass:color"; +@use "app/styles/app.scss";