-
{this.success ? successIcon : failureIcon}
+
{this.success ? : failureIcon}
{this.success ? 'Verified.' : 'Failure.'}
diff --git a/src/components/session-card/readme.md b/src/components/session-card/readme.md
index 699d65c..a6bde93 100644
--- a/src/components/session-card/readme.md
+++ b/src/components/session-card/readme.md
@@ -18,12 +18,14 @@
### Depends on
+- [d-icon](../icon)
- [d-heading](../heading)
- [d-text](../text)
### Graph
```mermaid
graph TD;
+ d-session-card --> d-icon
d-session-card --> d-heading
d-session-card --> d-text
style d-session-card fill:#f9f,stroke:#333,stroke-width:4px
diff --git a/src/components/settings-menu/d-settings-menu.css b/src/components/settings-menu/d-settings-menu.css
new file mode 100644
index 0000000..5d4e87f
--- /dev/null
+++ b/src/components/settings-menu/d-settings-menu.css
@@ -0,0 +1,3 @@
+:host {
+ display: block;
+}
diff --git a/src/components/settings-menu/d-settings-menu.tsx b/src/components/settings-menu/d-settings-menu.tsx
new file mode 100644
index 0000000..7635770
--- /dev/null
+++ b/src/components/settings-menu/d-settings-menu.tsx
@@ -0,0 +1,67 @@
+import { Component, Host, Prop, h } from '@stencil/core';
+
+@Component({
+ tag: 'd-settings-menu',
+ styleUrl: 'd-settings-menu.css',
+ shadow: true,
+})
+export class DSettingsMenu {
+ @Prop() accountSettings: string;
+ @Prop() securityAndAuthentication: string;
+ @Prop() notificationsSettings: string;
+ @Prop() languages: string;
+ @Prop() support: string;
+ @Prop() privacyPolicy: string;
+ @Prop() logOut: string;
+ @Prop() version: string;
+ @Prop() developedBy: string;
+ @Prop() logoutCB: () => void;
+ @Prop() gotoLanguageSettings: () => void;
+ @Prop() openAppSettings: () => void;
+
+ render() {
+ return (
+
+
+
+
+
+ {this.accountSettings}
+
+
+
+ {this.securityAndAuthentication}
+
+
+
+ {this.notificationsSettings}
+
+
+
+ {this.languages}
+
+
+
+
+
+ {this.support}
+
+
+
+ {this.privacyPolicy}
+
+
+
+
+
+ {this.logOut}
+
+
+
+
+
+
+
+ );
+ }
+}
diff --git a/src/components/settings-menu/readme.md b/src/components/settings-menu/readme.md
new file mode 100644
index 0000000..e9f8ae8
--- /dev/null
+++ b/src/components/settings-menu/readme.md
@@ -0,0 +1,48 @@
+# d-settings-menu
+
+
+
+
+
+
+## Properties
+
+| Property | Attribute | Description | Type | Default |
+| --------------------------- | ----------------------------- | ----------- | ------------ | ----------- |
+| `accountSettings` | `account-settings` | | `string` | `undefined` |
+| `developedBy` | `developed-by` | | `string` | `undefined` |
+| `gotoLanguageSettings` | -- | | `() => void` | `undefined` |
+| `languages` | `languages` | | `string` | `undefined` |
+| `logOut` | `log-out` | | `string` | `undefined` |
+| `logoutCB` | -- | | `() => void` | `undefined` |
+| `notificationsSettings` | `notifications-settings` | | `string` | `undefined` |
+| `openAppSettings` | -- | | `() => void` | `undefined` |
+| `privacyPolicy` | `privacy-policy` | | `string` | `undefined` |
+| `securityAndAuthentication` | `security-and-authentication` | | `string` | `undefined` |
+| `support` | `support` | | `string` | `undefined` |
+| `version` | `version` | | `string` | `undefined` |
+
+
+## Dependencies
+
+### Depends on
+
+- [d-buttons-group](../buttons-group)
+- [d-button](../button)
+- [d-icon](../icon)
+- [d-app-details](../app-details)
+
+### Graph
+```mermaid
+graph TD;
+ d-settings-menu --> d-buttons-group
+ d-settings-menu --> d-button
+ d-settings-menu --> d-icon
+ d-settings-menu --> d-app-details
+ d-app-details --> d-text
+ style d-settings-menu fill:#f9f,stroke:#333,stroke-width:4px
+```
+
+----------------------------------------------
+
+*Built with [StencilJS](https://stenciljs.com/)*
diff --git a/src/components/settings-menu/settings-menu.stories.ts b/src/components/settings-menu/settings-menu.stories.ts
new file mode 100644
index 0000000..fadad59
--- /dev/null
+++ b/src/components/settings-menu/settings-menu.stories.ts
@@ -0,0 +1,40 @@
+import { Meta, StoryObj } from '@storybook/html';
+import type { Components } from '../../components.js';
+
+const meta = {
+ title: 'Design System/Molecule/SettingsMenu',
+ render: args => `
`,
+} satisfies Meta
;
+
+export default meta;
+type Story = StoryObj;
+
+export const Default: Story = {
+ args: {
+ accountSettings: 'Account settings',
+ securityAndAuthentication: 'Security and authentication',
+ notificationsSettings: 'Notifications settings',
+ languages: 'Languages',
+ support: 'Support',
+ privacyPolicy: 'Privacy policy',
+ logOut: 'Log out',
+ version: 'Version',
+ developedBy: 'Developed by',
+ logoutCB: () => {},
+ gotoLanguageSettings: () => {},
+ openAppSettings: () => {},
+ },
+};
diff --git a/src/components/settings-menu/test/d-settings-menu.e2e.ts b/src/components/settings-menu/test/d-settings-menu.e2e.ts
new file mode 100644
index 0000000..59cd6c1
--- /dev/null
+++ b/src/components/settings-menu/test/d-settings-menu.e2e.ts
@@ -0,0 +1,11 @@
+import { newE2EPage } from '@stencil/core/testing';
+
+describe('d-settings-menu', () => {
+ it('renders', async () => {
+ const page = await newE2EPage();
+ await page.setContent('');
+
+ const element = await page.find('d-settings-menu');
+ expect(element).toHaveClass('hydrated');
+ });
+});
diff --git a/src/components/settings-menu/test/d-settings-menu.spec.tsx b/src/components/settings-menu/test/d-settings-menu.spec.tsx
new file mode 100644
index 0000000..93e1401
--- /dev/null
+++ b/src/components/settings-menu/test/d-settings-menu.spec.tsx
@@ -0,0 +1,49 @@
+import { newSpecPage } from '@stencil/core/testing';
+import { DSettingsMenu } from '../d-settings-menu';
+
+describe('d-settings-menu', () => {
+ it('renders', async () => {
+ const page = await newSpecPage({
+ components: [DSettingsMenu],
+ html: ``,
+ });
+ expect(page.root).toEqualHtml(`
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `);
+ });
+});
diff --git a/src/components/swipable-page/d-swipable-page.css b/src/components/swipable-page/d-swipable-page.css
new file mode 100644
index 0000000..5d4e87f
--- /dev/null
+++ b/src/components/swipable-page/d-swipable-page.css
@@ -0,0 +1,3 @@
+:host {
+ display: block;
+}
diff --git a/src/components/swipable-page/d-swipable-page.tsx b/src/components/swipable-page/d-swipable-page.tsx
new file mode 100644
index 0000000..7a44cdf
--- /dev/null
+++ b/src/components/swipable-page/d-swipable-page.tsx
@@ -0,0 +1,34 @@
+import { Component, Host, h, Prop } from '@stencil/core';
+
+@Component({
+ tag: 'd-swipable-page',
+ styleUrl: 'd-swipable-page.css',
+ shadow: true,
+})
+export class DSwipablePage {
+ @Prop() background: string;
+ @Prop() title: string;
+ @Prop() subtitle?: string;
+ @Prop() description: string;
+
+ render() {
+ return (
+
+
+
+
+
+
+ {this.title},
+ {this.subtitle && (
+
+ {this.subtitle}
+
+ )}
+ {this.description}
+
+
+
+ );
+ }
+}
diff --git a/src/components/swipable-page/readme.md b/src/components/swipable-page/readme.md
new file mode 100644
index 0000000..1c8ac34
--- /dev/null
+++ b/src/components/swipable-page/readme.md
@@ -0,0 +1,37 @@
+# d-swipable-page
+
+
+
+
+
+
+## Properties
+
+| Property | Attribute | Description | Type | Default |
+| ------------- | ------------- | ----------- | -------- | ----------- |
+| `background` | `background` | | `string` | `undefined` |
+| `description` | `description` | | `string` | `undefined` |
+| `subtitle` | `subtitle` | | `string` | `undefined` |
+| `title` | `title` | | `string` | `undefined` |
+
+
+## Dependencies
+
+### Depends on
+
+- [d-background-illustration](../background-illustration)
+- [d-heading](../heading)
+- [d-text](../text)
+
+### Graph
+```mermaid
+graph TD;
+ d-swipable-page --> d-background-illustration
+ d-swipable-page --> d-heading
+ d-swipable-page --> d-text
+ style d-swipable-page fill:#f9f,stroke:#333,stroke-width:4px
+```
+
+----------------------------------------------
+
+*Built with [StencilJS](https://stenciljs.com/)*
diff --git a/src/components/swipable-page/swipable-page.stories.ts b/src/components/swipable-page/swipable-page.stories.ts
new file mode 100644
index 0000000..b370a02
--- /dev/null
+++ b/src/components/swipable-page/swipable-page.stories.ts
@@ -0,0 +1,26 @@
+import { Meta, StoryObj } from '@storybook/html';
+import type { Components } from '../../components.js';
+
+const meta = {
+ title: 'Design System/Molecule/SwipablePage',
+ render: args => `
+
+ `,
+} satisfies Meta;
+
+export default meta;
+type Story = StoryObj;
+
+export const Default: Story = {
+ args: {
+ background: 'https://wallet.zenswarm.forkbomb.eu/src/lib/assets/bg-1.svg',
+ title: 'Title',
+ subtitle: 'Subtitle',
+ description: 'Description',
+ },
+};
diff --git a/src/components/swipable-page/test/d-swipable-page.e2e.ts b/src/components/swipable-page/test/d-swipable-page.e2e.ts
new file mode 100644
index 0000000..b176b69
--- /dev/null
+++ b/src/components/swipable-page/test/d-swipable-page.e2e.ts
@@ -0,0 +1,11 @@
+import { newE2EPage } from '@stencil/core/testing';
+
+describe('d-swipable-page', () => {
+ it('renders', async () => {
+ const page = await newE2EPage();
+ await page.setContent('');
+
+ const element = await page.find('d-swipable-page');
+ expect(element).toHaveClass('hydrated');
+ });
+});
diff --git a/src/components/swipable-page/test/d-swipable-page.spec.tsx b/src/components/swipable-page/test/d-swipable-page.spec.tsx
new file mode 100644
index 0000000..860d068
--- /dev/null
+++ b/src/components/swipable-page/test/d-swipable-page.spec.tsx
@@ -0,0 +1,28 @@
+import { newSpecPage } from '@stencil/core/testing';
+import { DSwipablePage } from '../d-swipable-page';
+
+describe('d-swipable-page', () => {
+ it('renders', async () => {
+ const page = await newSpecPage({
+ components: [DSwipablePage],
+ html: ``,
+ });
+ expect(page.root).toEqualHtml(`
+
+
+
+
+
+ `);
+ });
+});
diff --git a/src/components/tab-button/d-tab-button.tsx b/src/components/tab-button/d-tab-button.tsx
index 5f4a105..601ecf6 100644
--- a/src/components/tab-button/d-tab-button.tsx
+++ b/src/components/tab-button/d-tab-button.tsx
@@ -1,4 +1,5 @@
import { Component, Host, Prop, h } from '@stencil/core';
+export type Tab = 'home' | 'profile' | 'activity' | 'wallet';
@Component({
tag: 'd-tab-button',
@@ -6,164 +7,23 @@ import { Component, Host, Prop, h } from '@stencil/core';
shadow: true,
})
export class DTabButton {
- @Prop() tab: 'home' | 'profile' | 'activity' | 'wallet';
+ @Prop() tab: Tab;
@Prop() active: boolean = false;
@Prop() hasAlert: boolean = false;
render() {
- const homeSvg = (
-
- );
-
- const homeSvgFilled = (
-
- );
-
- const profileSvg = (
-
- );
-
- const profileSvgFilled = (
-
- );
-
- const walletSvg = (
-
- );
-
- const walletSvgFilled = (
-
- );
-
- const activitySvg = (
-
- );
-
- const activitySvgFilled = (
-
- );
-
- const svg = () => {
- switch (this.tab) {
- case 'home':
- return this.active ? homeSvgFilled : homeSvg;
- case 'profile':
- return this.active ? profileSvgFilled : profileSvg;
- case 'activity':
- return this.active ? activitySvgFilled : activitySvg;
- case 'wallet':
- return this.active ? walletSvgFilled : walletSvg;
- }
+ const svg = (): JSX.Element | null => {
+ const icons: Record = {
+ home: 'home',
+ profile: 'profile',
+ activity: 'notification',
+ wallet: 'wallet',
+ };
+
+ const icon = icons[this.tab];
+ if (!icon) return null;
+
+ return ;
};
return (
diff --git a/src/components/tab-button/readme.md b/src/components/tab-button/readme.md
index 3c1e67d..73a4841 100644
--- a/src/components/tab-button/readme.md
+++ b/src/components/tab-button/readme.md
@@ -18,6 +18,7 @@
### Depends on
+- [d-icon](../icon)
- ion-tab-button
- [d-info-led](../info-led)
- ion-label
@@ -26,6 +27,7 @@
### Graph
```mermaid
graph TD;
+ d-tab-button --> d-icon
d-tab-button --> ion-tab-button
d-tab-button --> d-info-led
d-tab-button --> ion-label
diff --git a/src/components/tab-button/test/d-tab-button.spec.tsx b/src/components/tab-button/test/d-tab-button.spec.tsx
index 90fa1d5..c8ae377 100644
--- a/src/components/tab-button/test/d-tab-button.spec.tsx
+++ b/src/components/tab-button/test/d-tab-button.spec.tsx
@@ -12,11 +12,7 @@ describe('d-tab-button', () => {
diff --git a/src/components/tab-page/readme.md b/src/components/tab-page/readme.md
index 7c502c3..fe4db4d 100644
--- a/src/components/tab-page/readme.md
+++ b/src/components/tab-page/readme.md
@@ -34,6 +34,7 @@ graph TD;
d-header --> ion-toolbar
d-header --> ion-buttons
d-header --> ion-button
+ d-header --> d-icon
d-header --> ion-title
d-header --> ion-menu-toggle
d-header --> ion-menu
diff --git a/src/components/text/readme.md b/src/components/text/readme.md
index 7538184..4fbbe2c 100644
--- a/src/components/text/readme.md
+++ b/src/components/text/readme.md
@@ -27,6 +27,7 @@
- [d-input](../input)
- [d-page-description](../page-description)
- [d-session-card](../session-card)
+ - [d-swipable-page](../swipable-page)
- [d-tab-button](../tab-button)
### Graph
@@ -42,6 +43,7 @@ graph TD;
d-input --> d-text
d-page-description --> d-text
d-session-card --> d-text
+ d-swipable-page --> d-text
d-tab-button --> d-text
style d-text fill:#f9f,stroke:#333,stroke-width:4px
```
diff --git a/src/components/utils.ts b/src/components/utils.ts
new file mode 100644
index 0000000..6824763
--- /dev/null
+++ b/src/components/utils.ts
@@ -0,0 +1,23 @@
+import { getAssetPath } from '@stencil/core';
+
+const assetCache = {};
+const requestCache = {};
+
+export async function fetchAsset({ asset }: { asset: string }): Promise {
+ if (assetCache[asset]) {
+ return assetCache[asset];
+ }
+ if (!requestCache[asset]) {
+ requestCache[asset] = fetch(getAssetPath(`./assets/${asset}.json`))
+ .then(resp => resp.json())
+ .catch(() => {
+ console.error(`"${asset}" is not a valid name`);
+ return '';
+ });
+ }
+
+ const path = await requestCache[asset];
+ assetCache[asset] = path;
+
+ return path;
+}
diff --git a/src/index.html b/src/index.html
index 36d62dd..919fdc9 100644
--- a/src/index.html
+++ b/src/index.html
@@ -29,6 +29,7 @@ Test page
pippo
+
Typography