-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
243 additions
and
157 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 |
---|---|---|
|
@@ -9,6 +9,24 @@ export default defineConfig({ | |
description: "A set of components based on Tapsi design system.", | ||
base: "/web-components/", | ||
vite: {}, | ||
head: [ | ||
["link", { rel: "preconnect", href: "https://fonts.googleapis.com" }], | ||
[ | ||
"link", | ||
{ | ||
rel: "preconnect", | ||
href: "https://fonts.gstatic.com", | ||
crossorigin: "true", | ||
}, | ||
], | ||
[ | ||
"link", | ||
{ | ||
rel: "stylesheet", | ||
href: "https://fonts.googleapis.com/css2?family=Vazirmatn:[email protected]&display=swap", | ||
}, | ||
], | ||
], | ||
themeConfig: { | ||
sidebar, | ||
socialLinks, | ||
|
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
35 changes: 19 additions & 16 deletions
35
packages/web-components/src/chip-group/chip-group.style.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,35 +1,38 @@ | ||
import { css } from "lit"; | ||
|
||
export default css` | ||
:host { | ||
*, | ||
*::before, | ||
*::after { | ||
box-sizing: border-box; | ||
width: 100%; | ||
} | ||
:host *, | ||
:host *::before, | ||
:host *::after { | ||
box-sizing: inherit; | ||
} | ||
[hidden] { | ||
display: none !important; | ||
} | ||
.chip-group { | ||
:host([full-width]) { | ||
width: 100%; | ||
} | ||
.root.full-width ::slotted(tap-chip) { | ||
flex: 1 1 0; | ||
} | ||
.root { | ||
display: inline-flex; | ||
gap: var(--tap-chip-group-gap, var(--tap-sys-spacing-5)); | ||
justify-content: space-between; | ||
align-items: center; | ||
gap: var(--tap-sys-spacing-5); | ||
width: 100%; | ||
overflow-x: auto; | ||
scrollbar-width: none; | ||
-ms-overflow-style: none; | ||
} | ||
.chip-group::-webkit-scrollbar { | ||
.root::-webkit-scrollbar { | ||
display: none; | ||
} | ||
:host([fullwidth]) .chip-group { | ||
display: flex; | ||
} | ||
`; |
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 |
---|---|---|
@@ -1,94 +1,102 @@ | ||
import { css } from "lit"; | ||
|
||
export default css` | ||
:host { | ||
*, | ||
*::before, | ||
*::after { | ||
box-sizing: border-box; | ||
width: 100%; | ||
} | ||
:host *, | ||
:host *::before, | ||
:host *::after { | ||
box-sizing: inherit; | ||
} | ||
[hidden] { | ||
display: none !important; | ||
} | ||
.chip { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
font: inherit; | ||
font-family: var(--tap-font-family, var(--tap-sys-font-family)); | ||
font-size: var( | ||
--tap-chip-font-size, | ||
var(--tap-sys-typography-body-sm-size) | ||
); | ||
line-height: var( | ||
--tap-chip-line-height, | ||
var(--tap-sys-typography-body-sm-height) | ||
); | ||
border-radius: var(--tap-chip-border-radius, var(--tap-sys-radius-full)); | ||
border: 1px solid; | ||
border-color: var( | ||
--tap-chip-border-color, | ||
var(--tap-sys-color-border-primary) | ||
); | ||
background-color: var( | ||
--tap-chip-background-color, | ||
var(--tap-sys-color-surface-primary) | ||
); | ||
color: var(--tap-chip-color, var(--tap-sys-color-content-primary)); | ||
padding: 0 var(--tap-chip-horizontal-padding, var(--tap-sys-spacing-4)); | ||
width: 100%; | ||
// TODO: add to the tokens | ||
min-width: var(--tap-chip-min-width, 72px); | ||
.root.disabled { | ||
--chip-color: var(--tap-sys-color-content-disabled); | ||
} | ||
.root.selected { | ||
--chip-bg-color: var(--tap-sys-color-surface-secondary); | ||
--chip-stroke-color: var(--tap-sys-color-surface-inverse-primary); | ||
} | ||
::slotted([slot="icon"]), | ||
.chip { | ||
gap: var(--tap-chip-icon-gap, var(--tap-sys-spacing-4)); | ||
.root.disabled.selected { | ||
--chip-stroke-color: var(--tap-sys-color-border-primary); | ||
} | ||
:host([hasicon]) .chip { | ||
display: flex; | ||
justify-content: end; | ||
.root.has-trailing-icon { | ||
--chip-trailing-icon-display: flex; | ||
} | ||
:host([selected]) .chip { | ||
border: 1.5px solid; | ||
background-color: var( | ||
--tap-chip-selected-background-color, | ||
var(--tap-sys-color-surface-secondary) | ||
); | ||
border-color: var( | ||
--tap-chip-selected-border-color, | ||
var(--tap-sys-color-surface-inverse-primary) | ||
); | ||
.root.has-leading-icon { | ||
--chip-leading-icon-display: flex; | ||
} | ||
:host([disabled]) .chip { | ||
color: var( | ||
--tap-chip-disabled-color, | ||
var(--tap-sys-color-content-disabled) | ||
); | ||
.root.small { | ||
--chip-height: 2rem; | ||
--chip-icon-size: 1.25rem; | ||
--chip-spacing: var(--tap-sys-spacing-3-1); | ||
} | ||
:host([selected]), | ||
:host([disabled]) .chip { | ||
border-color: var( | ||
--tap-chip-selected-and-disabled-color, | ||
var(--tap-sys-color-border-primary) | ||
); | ||
.root.medium { | ||
--chip-height: 2.5rem; | ||
--chip-icon-size: 1.5rem; | ||
--chip-spacing: var(--tap-sys-spacing-4); | ||
} | ||
.root { | ||
--chip-color: var(--tap-sys-color-content-primary); | ||
--chip-bg-color: var(--tap-sys-color-surface-primary); | ||
--chip-stroke-color: var(--tap-sys-color-border-primary); | ||
--chip-trailing-icon-display: none; | ||
--chip-leading-icon-display: none; | ||
cursor: pointer; | ||
display: inline-flex; | ||
align-items: center; | ||
justify-content: center; | ||
border-radius: var(--tap-sys-radius-full); | ||
border: var(--tap-sys-stroke-1) solid var(--chip-stroke-color); | ||
background-color: var(--chip-bg-color); | ||
color: var(--chip-color); | ||
padding: 0 var(--chip-spacing); | ||
min-width: 4.5rem; | ||
width: 100%; | ||
height: var(--chip-height); | ||
} | ||
.content { | ||
display: inline-flex; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 0 var(--chip-spacing); | ||
font-family: var(--tap-sys-font-family); | ||
font-size: var(--tap-sys-typography-body-sm-size); | ||
line-height: var(--tap-sys-typography-body-sm-height); | ||
} | ||
.icon { | ||
align-items: center; | ||
justify-content: center; | ||
width: var(--chip-icon-size); | ||
height: var(--chip-icon-size); | ||
max-width: var(--chip-icon-size); | ||
max-height: var(--chip-icon-size); | ||
text-align: center; | ||
} | ||
:host([size="sm"]) .chip { | ||
height: var(--tap-chip-group-sm-height, var(--tap-sys-spacing-9)); | ||
.icon.leading-icon { | ||
display: var(--chip-leading-icon-display); | ||
} | ||
:host([size="md"]) .chip { | ||
height: var(--tap-chip-group-md-height, var(--tap-sys-spacing-10)); | ||
.icon.trailing-icon { | ||
display: var(--chip-trailing-icon-display); | ||
} | ||
`; |
Oops, something went wrong.