Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(checkbox): add check icon for selected state #47

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/hot-apricots-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baloise/ds-core': minor
---

**checkbox**: add check icon for selected state
14 changes: 7 additions & 7 deletions docs/stories/contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@
</span>
<span className='block title text-medium text-align-center mb-none text-decoration-none'>madaluca</span>
</a>
<a href="https://github.com/Gagne87" target='_blank' style="flex: 1;" className="sb-unstyled text-decoration-none doc-button-card doc-shadow-hover flex flex-1 flex-direction-column bg-purple-1 p-normal radius-normal text-large text-primary"
>
<span className='block text-xx-large text-align-center'>
<img src="https://avatars.githubusercontent.com/u/29020214?v=4" alt="Gagne87" />
</span>
<span className='block title text-medium text-align-center mb-none text-decoration-none'>Gagne87</span>
</a>
<a href="https://github.com/yannickholzenkamp" target='_blank' style="flex: 1;" className="sb-unstyled text-decoration-none doc-button-card doc-shadow-hover flex flex-1 flex-direction-column bg-purple-1 p-normal radius-normal text-large text-primary"
>
<span className='block text-xx-large text-align-center'>
Expand Down Expand Up @@ -97,6 +90,13 @@
</span>
<span className='block title text-medium text-align-center mb-none text-decoration-none'>sebaotlacan</span>
</a>
<a href="https://github.com/Gagne87" target='_blank' style="flex: 1;" className="sb-unstyled text-decoration-none doc-button-card doc-shadow-hover flex flex-1 flex-direction-column bg-purple-1 p-normal radius-normal text-large text-primary"
>
<span className='block text-xx-large text-align-center'>
<img src="https://avatars.githubusercontent.com/u/29020214?v=4" alt="Gagne87" />
</span>
<span className='block title text-medium text-align-center mb-none text-decoration-none'>Gagne87</span>
</a>
<a href="https://github.com/max-voss" target='_blank' style="flex: 1;" className="sb-unstyled text-decoration-none doc-button-card doc-shadow-hover flex flex-1 flex-direction-column bg-purple-1 p-normal radius-normal text-large text-primary"
>
<span className='block text-xx-large text-align-center'>
Expand Down
5 changes: 3 additions & 2 deletions libs/nx/src/executors/create-changeset/executor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import prompts from 'prompts'
import { readFile, rm, writeFile } from 'fs/promises'
import { join } from 'path'
import path, { join } from 'path'
import { promisify } from 'util'
import { exec } from 'child_process'
import { CreateChangesetExecutorSchema } from './schema'
Expand Down Expand Up @@ -93,8 +93,9 @@ export default async function runExecutor(options: CreateChangesetExecutorSchema
`

// create new changeset file
const changesetDir = '.changeset' + path.sep
const { stdout } = await promisify(exec)(`npx changeset add --empty`)
const start = stdout.lastIndexOf('.changeset/') + '.changeset/'.length
const start = stdout.lastIndexOf(changesetDir) + changesetDir.length
const end = stdout.lastIndexOf('.md') + '.md'.length
const filename = stdout.substring(start, end).trim()
const filepath = join(options.workspaceRoot, '.changeset', filename)
Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/components/bal-checkbox/bal-checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ export class Checkbox implements ComponentInterface, FormInput<any>, Loggable, B
const block = BEM.block('radio-checkbox')
const inputEl = block.element('input')
const labelEl = block.element('label')
const iconEl = block.element('icon')
const labelTextEl = labelEl.element('text')

const focused = this.focused && this.buttonTabindex !== -1
Expand Down Expand Up @@ -483,6 +484,10 @@ export class Checkbox implements ComponentInterface, FormInput<any>, Loggable, B
{...labelAttributes}
data-testid="bal-checkbox-label"
>
<bal-icon class={{
...iconEl.class(),
...iconEl.modifier('hidden').class(this.labelHidden || this.interface !== 'switch'),
}} name="check" color='white' size='x-small'></bal-icon>
<span
class={{
...labelTextEl.class(),
Expand Down
11 changes: 11 additions & 0 deletions packages/core/src/components/bal-checkbox/radio-checkbox.sass
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ bal-radio .bal-radio-checkbox__label
position: absolute
top: 0.25rem !important
left: 0.25rem
z-index: 2
width: 1rem
height: 1rem
margin-top: 0.25rem
Expand Down Expand Up @@ -409,3 +410,13 @@ bal-radio .bal-radio-checkbox__label
background: var(--bal-radio-checkbox-switch-label-background-disabled-checked-hover-active-before)
.bal-radio-checkbox__label::after
background: var(--bal-radio-checkbox-switch-label-background-disabled-checked-hover-active-after)

//
// swicth check icon when selected
+block(radio-checkbox)
+element(icon)
position: absolute !important
left: 5.5px
z-index: 1
+modifier(hidden)
display: none !important
Loading