@nanahoshi/mona-ui 0.26.1 → 0.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -169,6 +169,7 @@ const buttonThemeVariants = cva(`
|
|
|
169
169
|
look: "default",
|
|
170
170
|
selected: true,
|
|
171
171
|
class: `
|
|
172
|
+
after:-inset-px
|
|
172
173
|
bg-(--color-selected) text-(--color-selected-foreground)
|
|
173
174
|
hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground)
|
|
174
175
|
active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
|
|
@@ -232,6 +233,7 @@ const buttonThemeVariants = cva(`
|
|
|
232
233
|
look: "outline",
|
|
233
234
|
selected: true,
|
|
234
235
|
class: `
|
|
236
|
+
after:-inset-px
|
|
235
237
|
bg-(--color-selected) text-(--color-selected-foreground)
|
|
236
238
|
hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground)
|
|
237
239
|
active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
|
|
@@ -9,7 +9,7 @@ import { MonaI18nService } from '@nanahoshi/mona-ui/i18n';
|
|
|
9
9
|
import { fromEvent } from 'rxjs';
|
|
10
10
|
import { twMerge } from 'tailwind-merge';
|
|
11
11
|
import { cva } from 'class-variance-authority';
|
|
12
|
-
import { themeRaisedSurfaceClasses } from '@nanahoshi/mona-ui/internal';
|
|
12
|
+
import { themeSelectionBorderClasses, themeRaisedSurfaceClasses } from '@nanahoshi/mona-ui/internal';
|
|
13
13
|
|
|
14
14
|
// Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
|
|
15
15
|
// Edit the JSON file and run `npm run generate:locale-catalogs`.
|
|
@@ -101,11 +101,8 @@ const chipThemeVariants = cva(`
|
|
|
101
101
|
`
|
|
102
102
|
},
|
|
103
103
|
selected: {
|
|
104
|
-
// A border in the text's color
|
|
105
|
-
true:
|
|
106
|
-
after:pointer-events-none after:absolute after:inset-0
|
|
107
|
-
after:rounded-[inherit] after:border-2 after:border-current
|
|
108
|
-
`,
|
|
104
|
+
// A border in the text's color under prefers-contrast: more and forced colors, where the fill alone isn't enough.
|
|
105
|
+
true: themeSelectionBorderClasses,
|
|
109
106
|
false: ""
|
|
110
107
|
}
|
|
111
108
|
},
|
|
@@ -113,7 +110,7 @@ const chipThemeVariants = cva(`
|
|
|
113
110
|
{
|
|
114
111
|
look: "default",
|
|
115
112
|
selected: true,
|
|
116
|
-
class: "bg-(--color-selected) text-(--color-selected-foreground)"
|
|
113
|
+
class: "after:-inset-px bg-(--color-selected) text-(--color-selected-foreground)"
|
|
117
114
|
},
|
|
118
115
|
{
|
|
119
116
|
look: "primary",
|
|
@@ -148,7 +145,7 @@ const chipThemeVariants = cva(`
|
|
|
148
145
|
{
|
|
149
146
|
look: "outline",
|
|
150
147
|
selected: true,
|
|
151
|
-
class: "bg-(--color-selected) text-(--color-selected-foreground)"
|
|
148
|
+
class: "after:-inset-px bg-(--color-selected) text-(--color-selected-foreground)"
|
|
152
149
|
},
|
|
153
150
|
{
|
|
154
151
|
look: "ghost",
|
|
@@ -687,11 +687,16 @@ const themeSelectionBarClasses = `
|
|
|
687
687
|
before:absolute before:inset-y-0 before:start-0 before:w-0.5 before:bg-(--color-selected-border)
|
|
688
688
|
before:forced-color-adjust-none forced-colors:before:bg-[Highlight]
|
|
689
689
|
`;
|
|
690
|
-
/**
|
|
690
|
+
/**
|
|
691
|
+
* A border in the text's color for a selected control, drawn only when the user asks for more contrast or forced colors
|
|
692
|
+
* are on. Elsewhere the fill says it alone. A control with a border of its own adds `after:-inset-px`, so this one
|
|
693
|
+
* replaces it.
|
|
694
|
+
*/
|
|
691
695
|
const themeSelectionBorderClasses = `
|
|
692
696
|
relative
|
|
693
697
|
after:pointer-events-none after:absolute after:inset-0
|
|
694
|
-
after:rounded-[inherit] after:border-
|
|
698
|
+
after:rounded-[inherit] after:border-current
|
|
699
|
+
contrast-more:after:border-2 forced-colors:after:border-2
|
|
695
700
|
`;
|
|
696
701
|
const themeControlBackdropClasses = `
|
|
697
702
|
[background-image:var(--mona-effect-control-background-image,none)]
|
package/package.json
CHANGED
|
@@ -237,8 +237,12 @@ type VariantInputs<T> = {
|
|
|
237
237
|
* has to be positioned.
|
|
238
238
|
*/
|
|
239
239
|
declare const themeSelectionBarClasses = "\n before:absolute before:inset-y-0 before:start-0 before:w-0.5 before:bg-(--color-selected-border)\n before:forced-color-adjust-none forced-colors:before:bg-[Highlight]\n";
|
|
240
|
-
/**
|
|
241
|
-
|
|
240
|
+
/**
|
|
241
|
+
* A border in the text's color for a selected control, drawn only when the user asks for more contrast or forced colors
|
|
242
|
+
* are on. Elsewhere the fill says it alone. A control with a border of its own adds `after:-inset-px`, so this one
|
|
243
|
+
* replaces it.
|
|
244
|
+
*/
|
|
245
|
+
declare const themeSelectionBorderClasses = "\n relative\n after:pointer-events-none after:absolute after:inset-0\n after:rounded-[inherit] after:border-current\n contrast-more:after:border-2 forced-colors:after:border-2\n";
|
|
242
246
|
declare const themeControlBackdropClasses = "\n [background-image:var(--mona-effect-control-background-image,none)]\n [backdrop-filter:var(--mona-effect-control-backdrop-filter,none)]\n [-webkit-backdrop-filter:var(--mona-effect-control-backdrop-filter,none)]\n";
|
|
243
247
|
declare const themeControlSurfaceClasses = "\n [background-color:var(--mona-effect-control-background-color,var(--color-input-background))]\n \n [background-image:var(--mona-effect-control-background-image,none)]\n [backdrop-filter:var(--mona-effect-control-backdrop-filter,none)]\n [-webkit-backdrop-filter:var(--mona-effect-control-backdrop-filter,none)]\n\n";
|
|
244
248
|
declare const themeRaisedBackdropClasses = "\n [background-image:var(--mona-effect-raised-background-image,none)]\n [backdrop-filter:var(--mona-effect-raised-backdrop-filter,none)]\n [-webkit-backdrop-filter:var(--mona-effect-raised-backdrop-filter,none)]\n";
|