oneslash-design-system 2.10.0 → 2.10.1
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.
|
@@ -6,7 +6,7 @@ var bgClassMap = {
|
|
|
6
6
|
warning: 'bg-warning-alertBg',
|
|
7
7
|
info: 'bg-info-alertBg',
|
|
8
8
|
success: 'bg-success-alertBg',
|
|
9
|
-
default: 'bg-secondary-
|
|
9
|
+
default: 'bg-secondary-main',
|
|
10
10
|
};
|
|
11
11
|
var AUTO_DISMISS_MS = 5000;
|
|
12
12
|
var EXIT_MS = 150;
|
|
@@ -62,10 +62,12 @@ export default function Alert(_a) {
|
|
|
62
62
|
if (!shouldRender)
|
|
63
63
|
return null;
|
|
64
64
|
var bgClasses = (_b = bgClassMap[type]) !== null && _b !== void 0 ? _b : bgClassMap.default;
|
|
65
|
+
// The default alert sits on secondary.main, whose label is secondary.contrast; the status backgrounds take text.primary
|
|
66
|
+
var textClasses = bgClasses === bgClassMap.default ? 'text-secondary-contrast' : 'text-fg-primary';
|
|
65
67
|
var alertContent = (<div
|
|
66
68
|
// Errors interrupt screen readers; everything else is announced politely
|
|
67
69
|
role={type === 'error' ? 'alert' : 'status'} onMouseEnter={function () { return setIsPaused(true); }} onMouseLeave={function () { return setIsPaused(false); }} onFocus={function () { return setIsPaused(true); }} onBlur={function () { return setIsPaused(false); }} className={"flex ".concat(secondMessage ? 'items-start' : 'items-center', " justify-between w-full p-2 rounded-control transition-[opacity,transform] ").concat(isVisible ? motionClasses.enter : motionClasses.exit, " motion-reduce:transition-none ").concat(bgClasses, " ").concat(isVisible ? 'opacity-100 translate-y-0' : variant === 'toast' ? 'opacity-0 -translate-y-[calc(100%+1rem)]' : 'opacity-0', " ").concat(variant === 'toast' ? 'max-w-md pointer-events-auto' : '')}>
|
|
68
|
-
<div className="flex items-start gap-2
|
|
70
|
+
<div className={"flex items-start gap-2 ".concat(textClasses)}>
|
|
69
71
|
{/* With two lines, nudge the text so its first line centers on the close button */}
|
|
70
72
|
<div className={"flex flex-col text-left ".concat(secondMessage && showCloseButton ? 'pt-[3px]' : '')}>
|
|
71
73
|
<span className="text-body2">{message}</span>
|
package/dist/components/tag.jsx
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { icons } from 'lucide-react';
|
|
4
4
|
import { focusRing, pressFeedbackAny, stateTransition } from './sharedStyles';
|
|
5
|
-
// Filled tags use the status `fill` with `onFill` text
|
|
5
|
+
// Filled tags use the status `fill` with `onFill` text (the default tag: `secondary.main` with
|
|
6
|
+
// `secondary.contrast`); text-only tags use the status `text` token.
|
|
6
7
|
// Each pair is checked at 4.5:1 by `npm run check:contrast`.
|
|
7
8
|
var colorConfig = {
|
|
8
9
|
default: {
|
|
9
|
-
bg: 'bg-secondary-
|
|
10
|
-
text: 'text-
|
|
10
|
+
bg: 'bg-secondary-main',
|
|
11
|
+
text: 'text-secondary-contrast',
|
|
11
12
|
textOnly: 'text-fg-secondary',
|
|
12
13
|
border: 'border-misc-divider',
|
|
13
14
|
dot: 'bg-fg-secondary',
|