-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dyne-inline): add ability to put el inline
- Loading branch information
Showing
17 changed files
with
236 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export const allModes = { | ||
'dark mobile': { | ||
backgrounds: 'dark', | ||
theme: 'dark', | ||
viewport: 'small', | ||
}, | ||
'dark desktop': { | ||
backgrounds: 'dark', | ||
theme: 'dark', | ||
viewport: 'large', | ||
}, | ||
'light mobile': { | ||
backgrounds: 'light', | ||
theme: 'light', | ||
viewport: 'small', | ||
}, | ||
'light desktop': { | ||
backgrounds: 'light', | ||
theme: 'light', | ||
viewport: 'large', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
:host { | ||
@apply flex flex-row; | ||
} | ||
|
||
$gaps: 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 72, 80, 96; | ||
|
||
@each $gap in $gaps { | ||
:host([gap='#{$gap}']) { | ||
@apply gap-#{$gap}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { Components } from '@/src/components'; | ||
import { Meta, StoryObj } from '@storybook/html'; | ||
|
||
const meta = { | ||
title: 'Design System/Atoms/Inline', | ||
component: 'dyne-inline', | ||
render: args => `<dyne-inline gap="${args.gap}"><dyne-button>Click me</dyne-button><dyne-button>Trust me</dyne-button></dyne-inline>`, | ||
argTypes: { | ||
gap: { | ||
control: { | ||
type: 'number', | ||
}, | ||
defaultValue: 4, | ||
}, | ||
}, | ||
} satisfies Meta<Components.DyneInline>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<Components.DyneInline>; | ||
|
||
export const Defaults: Story = { | ||
args: { | ||
gap: 4, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Component, Host, Prop, h } from '@stencil/core'; | ||
|
||
@Component({ | ||
tag: 'dyne-inline', | ||
styleUrl: 'dyne-inline.scss', | ||
shadow: true, | ||
}) | ||
export class DyneButton { | ||
@Prop({ reflect: true }) gap?: number = 4; | ||
render() { | ||
return ( | ||
<Host> | ||
<slot></slot> | ||
</Host> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# dyne-inline | ||
|
||
|
||
|
||
<!-- Auto Generated Below --> | ||
|
||
|
||
## Properties | ||
|
||
| Property | Attribute | Description | Type | Default | | ||
| -------- | --------- | ----------- | -------- | ------- | | ||
| `gap` | `gap` | | `number` | `4` | | ||
|
||
|
||
---------------------------------------------- | ||
|
||
*Built with [StencilJS](https://stenciljs.com/)* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf8" /> | ||
|
||
<!-- Replace with the path to your entrypoint --> | ||
<script src="../../../build/dyne-components.esm.js" type="module"></script> | ||
<script src="../../../build/dyne-components.js" nomodule></script> | ||
</head> | ||
<body> | ||
<dyne-inline> | ||
<dyne-button>Click me</dyne-button> | ||
<dyne-button>Trust me</dyne-button> | ||
</dyne-mimmo> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { expect } from '@playwright/test'; | ||
import { test } from '@stencil/playwright'; | ||
|
||
test.describe('dyne-inline', () => { | ||
test('should render', async ({ page }) => { | ||
// The path here is the path to the www output relative to the dev server root directory | ||
await page.goto('/components/dyne-inline/test/dyne-inline.e2e.html'); | ||
|
||
// Rest of test | ||
const component = await page.locator('dyne-inline'); | ||
await expect(component).toHaveCSS('display', 'flex'); | ||
await expect(component).toHaveClass('flex flex-row hydrated'); | ||
await expect(component).toHaveText(` | ||
Click me | ||
Trust me | ||
`); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters