-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from OpenIPC/qr-code
Qr code
- Loading branch information
Showing
219 changed files
with
6,501 additions
and
2,602 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: test-deployment | ||
run-name: Test deployment with GH Actions | ||
on: | ||
push: | ||
branches: | ||
- 'deploy' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.11' | ||
- name: Enable and set up Yarn | ||
run: | | ||
corepack enable | ||
yarn set version stable | ||
- name: Install packages and build | ||
run: | | ||
yarn install | ||
yarn run build-main | ||
- name: Get production artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: production-build | ||
path: dist | ||
deploy: | ||
runs-on: ubuntu-latest | ||
env: | ||
SERVER_NAME: ${{ vars.SERVER_NAME }} | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Download production articfact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: production-build | ||
- name: Prepare folders on production server | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SERVER_NAME }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.SERVER_SSH_KEY }} | ||
port: ${{ secrets.SERVER_SSH_PORT }} | ||
script: | | ||
rm -rf /var/www/webface | ||
mkdir /var/www/webface | ||
- name: Copy build to production server | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SERVER_NAME }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.SERVER_SSH_KEY }} | ||
port: ${{ secrets.SERVER_SSH_PORT }} | ||
source: main/* | ||
target: /var/www/webface/ | ||
- name: Make correct folder structure | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SERVER_NAME }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.SERVER_SSH_KEY }} | ||
port: ${{ secrets.SERVER_SSH_PORT }} | ||
script: | | ||
cp -r /var/www/webface/main/* /var/www/webface/ | ||
rm -r /var/www/webface/main |
Binary file not shown.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type MainButtonProps from './main-button-types'; | ||
|
||
export default function MainButton({ size, disabled, caption, type, Icon, clickHandler }: MainButtonProps) { | ||
function getSize(size: MainButtonProps['size']) { | ||
const sizes:Record<MainButtonProps['size'], string> = { | ||
xs: 'w-16 h-8', | ||
s: 'w-28 h-8', | ||
m: 'w-60 h-8', | ||
l: 'w-72 h-12', | ||
}; | ||
return sizes[size]; | ||
} | ||
|
||
function getClass() { | ||
const baseClass = `bg-brand-blue border border-0 rounded-md flex flex-row justify-center items-center gap-x-2 text-white hover:bg-btn-blue-hover active:bg-btn-blue-click ${getSize(size)}`; | ||
if (disabled) return `${baseClass} bg-grey flex flex-row justify-center items-center`; | ||
return baseClass; | ||
} | ||
|
||
return ( | ||
<button className={getClass()} type={type ?? 'button'} {...{disabled}} onClick={clickHandler}> | ||
{caption} | ||
{Icon && <Icon />} | ||
</button> | ||
); | ||
} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
export * as default from './main-button.tsx'; | ||
export { default } from './Main-button'; |
12 changes: 12 additions & 0 deletions
12
src/components/ui/buttons/main-button/main-button-types.d.ts
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,12 @@ | ||
import { FunctionComponent } from 'preact'; | ||
|
||
type MainButtonProps = { | ||
size: 'xs' | 's' | 'm' | 'l', | ||
disabled?: boolean, | ||
caption?: string, | ||
type?: 'button' | 'submit' | 'reset', | ||
Icon?: FunctionComponent, | ||
clickHandler?: () => void, | ||
} | ||
|
||
export default MainButtonProps; |
41 changes: 29 additions & 12 deletions
41
src/components/ui/buttons/main-button/main-button.stories.ts
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 |
---|---|---|
@@ -1,26 +1,43 @@ | ||
import type { Meta, StoryObj } from '@storybook/preact'; | ||
import Button from './main-button'; | ||
import Button from './Main-button'; | ||
import icons from '../../../../assets/icons/ui'; | ||
|
||
const { Play, Pause, Refresh } = icons; | ||
|
||
const meta = { | ||
component: Button, | ||
title: 'Design System/UI/Buttons/Main Button', | ||
argTypes: { | ||
size: { | ||
options: ['xs' , 's' , 'm' , 'l'], | ||
control: { type: 'inline-radio' }, | ||
}, | ||
Icon: { | ||
options: ['Play', 'Pause', 'Refresh', 'No icon'], | ||
mapping: { | ||
'Play': Play, | ||
'Pause': Pause, | ||
'Refresh': Refresh, | ||
'No icon': undefined, | ||
}, | ||
control: { type: 'inline-radio' }, | ||
}, | ||
type: { | ||
options: ['button', 'submit', 'reset'], | ||
control: { type: 'inline-radio' }, | ||
}, | ||
}, | ||
} satisfies Meta<typeof Button>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Primary: Story = { | ||
type Story = StoryObj<typeof Button>; | ||
|
||
export const MainButton: Story = { | ||
args: { | ||
type: 'button', | ||
caption: 'Наименование кнопки', | ||
caption: 'Generate installation guide', | ||
disabled: false, | ||
Icon: Refresh, | ||
}, | ||
} | ||
|
||
export const Disabled: Story = { | ||
args: { | ||
type: 'button', | ||
title: 'Наименование кнопки', | ||
disabled: true, | ||
}, | ||
}; |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import type ToggleButtonProps from './toggle-button-types'; | ||
|
||
export default function ToggleButton({ size, checked, disabled, Icon, changeHandler }: ToggleButtonProps) { | ||
|
||
function getSize(size: ToggleButtonProps['size']) { | ||
const sizes:Record<ToggleButtonProps['size'], string> = { | ||
xs: 'w-16 h-8', | ||
s: 'w-28 h-8', | ||
m: 'w-60 h-8', | ||
l: 'w-72 h-12', | ||
}; | ||
return sizes[size]; | ||
} | ||
|
||
function handleChange(e: Event) { | ||
if (!(e.target instanceof HTMLInputElement)) return; | ||
if (changeHandler) changeHandler(e.target.checked); | ||
} | ||
|
||
function getClass() { | ||
const baseClass = `block border border-0 rounded-md relative overflow-hidden flex flex-row justify-center items-center ${getSize(size)}`; | ||
if (disabled) return `${baseClass} bg-grey flex flex-row justify-center items-center`; | ||
return `${baseClass} bg-brand-blue has-[:checked]:bg-btn-blue-click has-[:checked]:shadow-[inset_3px_3px_6px_#000051]` | ||
} | ||
|
||
return ( | ||
<div className="max-w-min rounded"> | ||
<label className={getClass()}> | ||
{Icon && <Icon />} | ||
<input type="checkbox" onChange={handleChange} {...{checked, disabled}} className="w-0 h-0 absolute -top-1" /> | ||
</label> | ||
</div> | ||
); | ||
} |
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 @@ | ||
export { default } from './Toggle-button'; |
11 changes: 11 additions & 0 deletions
11
src/components/ui/buttons/toggle-button/toggle-button-types.d.ts
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 @@ | ||
import { FunctionComponent } from 'preact'; | ||
|
||
type ToggleButtonProps = { | ||
size: 'xs' | 's' | 'm' | 'l', | ||
checked?: boolean, | ||
disabled?: boolean, | ||
Icon?: FunctionComponent, | ||
changeHandler: (checked: boolean) => void, | ||
} | ||
|
||
export default ToggleButtonProps; |
43 changes: 43 additions & 0 deletions
43
src/components/ui/buttons/toggle-button/toggle-button.stories.tsx
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,43 @@ | ||
import type { Meta, StoryObj } from '@storybook/preact'; | ||
import ToggleButton from './Toggle-button'; | ||
import icons from '../../../../assets/icons/ui'; | ||
|
||
const { Play, Pause } = icons; | ||
|
||
const meta = { | ||
component: ToggleButton, | ||
title: 'Design System/UI/Toggle Button', | ||
argTypes: { | ||
size: { | ||
options: ['xs', 's', 'm', 'l'], | ||
control: { type: 'inline-radio' }, | ||
}, | ||
Icon: { | ||
options: ['Play', 'Pause'], | ||
mapping: { | ||
'Play': Play, | ||
'Pause': Pause, | ||
}, | ||
control: { type: 'inline-radio' }, | ||
}, | ||
type: { | ||
options: ['button', 'submit', 'reset'], | ||
control: { type: 'inline-radio' }, | ||
}, | ||
}, | ||
} satisfies Meta<typeof ToggleButton>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof ToggleButton>; | ||
|
||
export const ToggleButtonStory: Story = { | ||
args: { | ||
size: 'xs', | ||
checked: false, | ||
disabled: false, | ||
type: 'button', | ||
Icon: Play, | ||
changeHandler: (state: boolean) => console.log('Toggle button state: ', state), | ||
}, | ||
}; |
Oops, something went wrong.