@warp-ds/uno
Advanced tools
Comparing version 1.0.0-alpha.32 to 1.0.0-alpha.33
{ | ||
"name": "@warp-ds/uno", | ||
"repository": "git@github.com:warp-ds/drive.git", | ||
"version": "1.0.0-alpha.32", | ||
"version": "1.0.0-alpha.33", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "exports": { |
import { escapeSelector } from '@unocss/core'; | ||
/*----LOADING----*/ | ||
// Very hardcoded styling for loading, not decided if it will be themable so let's have this for now and change if applicable later | ||
@@ -7,2 +8,9 @@ const inProgress = 'background-image:linear-gradient(135deg,rgba(0, 0, 0, 0.05) 25%,transparent 0,transparent 50%,rgba(0, 0, 0, 0.05) 0,rgba(0, 0, 0, 0.05) 75%,transparent 0,transparent) !important;background-size: 30px 30px;animation: animate-inprogress 3s linear infinite;'; | ||
/*----SPINNER----*/ | ||
const spinner = '--spinner-size: 24px;height: var(--spinner-size);width: var(--spinner-size);border-radius: 50%;border: calc(var(--spinner-size) / 8) solid var(--w-color-spinner-border);border-top-color: var(--w-color-spinner-border-top);position: relative;animation: animate-spinner 0.75s infinite linear;'; | ||
const spinnerPseudo = `content: ' ';height: calc(var(--spinner-size) / 8);width: calc(var(--spinner-size) / 8);border-radius: 50%;position: absolute;top: calc(var(--spinner-size) / 180);`; | ||
const spinnerBefore = 'left:0;'; | ||
const spinnerAfter = 'right:0;'; | ||
const spinnerKeyframes = '@keyframes animate-spinner {to{transform:rotate(359deg);}}'; | ||
export const animations = [ | ||
@@ -14,2 +22,10 @@ [/^animate-inprogress$/, ([_selector]) => { | ||
}], | ||
[/^animate-spinner$/, ([_selector]) => { | ||
const selector = escapeSelector(_selector); | ||
const baseSpinner = `.${selector}{${spinner}}`; | ||
const pseudo = `.${selector}::before,.${selector}::after{${spinnerPseudo}}`; | ||
const pseudoAfter = `.${selector}::after{${spinnerAfter}}`; | ||
const pseudoBefore = `.${selector}::before{${spinnerBefore}}`; | ||
return baseSpinner + pseudo + pseudoAfter + pseudoBefore + spinnerKeyframes; | ||
}], | ||
]; |
@@ -1,2 +0,2 @@ | ||
import { entriesToCss } from '@unocss/core'; | ||
import { entriesToCss, escapeSelector } from '@unocss/core'; | ||
@@ -17,9 +17,28 @@ // TODO: use actual variables and values when those has been defined | ||
const combinatorsByTag = { | ||
'group': ' ', | ||
'peer': '~', | ||
'parent': '>', | ||
'previous': '+', | ||
}; | ||
export const focusRing = [ | ||
[/^focusable$/, ([selector]) => { | ||
const focus = `.${selector}:focus,.${selector}:focus-visible{${focusRingStyle}}`; | ||
const notFocusVisible = `.${selector}:not(:focus-visible){${outlineNone}}`; | ||
return focus + notFocusVisible; | ||
[/focusable$/, ([], { rawSelector: selectorWithVariant, currentSelector }) => { | ||
if (currentSelector !== selectorWithVariant) { | ||
const escapedSelector = escapeSelector(selectorWithVariant); | ||
const tagLabel = selectorWithVariant?.split('-')?.[0] ?? ''; | ||
const combinator = combinatorsByTag[tagLabel]; | ||
if (!!combinator) { | ||
const focus = `.${tagLabel}:focus${combinator}.${escapedSelector},.${tagLabel}:focus-visible${combinator}.${escapedSelector}{${focusRingStyle}}`; | ||
const notFocusVisible = `.${tagLabel}:not(:focus-visible)${combinator}.${escapedSelector}{${outlineNone}}`; | ||
return focus + notFocusVisible; | ||
} | ||
return `.${escapedSelector}:${selectorWithVariant.split(':')?.[0]}{${focusRingStyle}}`; | ||
} else { | ||
const focus = `.${currentSelector}:focus,.${currentSelector}:focus-visible{${focusRingStyle}}`; | ||
const notFocusVisible = `.${currentSelector}:not(:focus-visible){${outlineNone}}`; | ||
return focus + notFocusVisible; | ||
} | ||
}], | ||
["focusable-inset", { ... focusRingInsetStyle }], | ||
]; |
@@ -10,4 +10,6 @@ import { | ||
import { variantSpaceAndDivide } from './spaceAndDivide.js'; | ||
import { variantLastChild } from './lastChild.js'; | ||
export const variants = [ | ||
variantLastChild, | ||
variantBreakpoints(), | ||
@@ -23,2 +25,3 @@ variantImportant(), | ||
export { | ||
variantLastChild, | ||
variantBreakpoints, | ||
@@ -25,0 +28,0 @@ variantImportant, |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
201988
57
5715