@optiaxiom/globals 0.5.0 → 0.5.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.
- package/dist/index.d.ts +6 -92
- package/dist/toaster.js +5 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/index.js +0 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactElement, useSyncExternalStore } from 'react';
|
|
3
3
|
|
|
4
4
|
declare const AxiomVersionContext: react.Context<string | undefined>;
|
|
5
5
|
|
|
@@ -187,22 +187,14 @@ declare const useToastContext: (consumerName: string) => {
|
|
|
187
187
|
open: boolean;
|
|
188
188
|
};
|
|
189
189
|
|
|
190
|
-
type
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
action?: {
|
|
195
|
-
altText: string;
|
|
196
|
-
label: string;
|
|
197
|
-
onClick: () => void;
|
|
198
|
-
};
|
|
199
|
-
title: string;
|
|
200
|
-
type?: "danger" | "neutral" | "success" | "warning";
|
|
201
|
-
};
|
|
190
|
+
type ToastOptions = {
|
|
191
|
+
action?: string;
|
|
192
|
+
onAction?: () => void;
|
|
193
|
+
type?: "danger" | "information" | "neutral" | "success" | "warning";
|
|
202
194
|
};
|
|
203
195
|
type Toaster = {
|
|
204
196
|
clear: () => void;
|
|
205
|
-
create: (
|
|
197
|
+
create: (...args: [message: string, options?: ToastOptions] | [toast: ReactElement]) => string;
|
|
206
198
|
remove: (id: string) => void;
|
|
207
199
|
store: Parameters<typeof useSyncExternalStore<ToastItem[]>>;
|
|
208
200
|
};
|
|
@@ -464,84 +456,6 @@ declare const tokensDark: {
|
|
|
464
456
|
readonly "fg.warning.strong": "#FEDF88";
|
|
465
457
|
readonly "fg.white": "#FFFFFF";
|
|
466
458
|
};
|
|
467
|
-
readonly borderRadius: {
|
|
468
|
-
readonly xs: "2px";
|
|
469
|
-
readonly sm: "4px";
|
|
470
|
-
readonly md: "6px";
|
|
471
|
-
readonly lg: "8px";
|
|
472
|
-
readonly full: "9999px";
|
|
473
|
-
};
|
|
474
|
-
readonly boxShadow: {
|
|
475
|
-
readonly sm: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)";
|
|
476
|
-
readonly md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)";
|
|
477
|
-
readonly lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)";
|
|
478
|
-
};
|
|
479
|
-
readonly fontFamily: {
|
|
480
|
-
readonly mono: "Fira Code Variable, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace";
|
|
481
|
-
readonly sans: "InterVariable, system-ui, sans-serif";
|
|
482
|
-
};
|
|
483
|
-
readonly fontSize: {
|
|
484
|
-
readonly xs: {
|
|
485
|
-
readonly fontSize: "10px";
|
|
486
|
-
readonly lineHeight: "14px";
|
|
487
|
-
};
|
|
488
|
-
readonly sm: {
|
|
489
|
-
readonly fontSize: "12px";
|
|
490
|
-
readonly lineHeight: "16px";
|
|
491
|
-
};
|
|
492
|
-
readonly md: {
|
|
493
|
-
readonly fontSize: "14px";
|
|
494
|
-
readonly lineHeight: "20px";
|
|
495
|
-
};
|
|
496
|
-
readonly lg: {
|
|
497
|
-
readonly fontSize: "16px";
|
|
498
|
-
readonly lineHeight: "24px";
|
|
499
|
-
};
|
|
500
|
-
readonly xl: {
|
|
501
|
-
readonly fontSize: "18px";
|
|
502
|
-
readonly lineHeight: "28px";
|
|
503
|
-
};
|
|
504
|
-
readonly "2xl": {
|
|
505
|
-
readonly fontSize: "20px";
|
|
506
|
-
readonly lineHeight: "28px";
|
|
507
|
-
};
|
|
508
|
-
readonly "3xl": {
|
|
509
|
-
readonly fontSize: "24px";
|
|
510
|
-
readonly lineHeight: "32px";
|
|
511
|
-
};
|
|
512
|
-
readonly "4xl": {
|
|
513
|
-
readonly fontSize: "30px";
|
|
514
|
-
readonly lineHeight: "36px";
|
|
515
|
-
};
|
|
516
|
-
readonly "5xl": {
|
|
517
|
-
readonly fontSize: "36px";
|
|
518
|
-
readonly lineHeight: "40px";
|
|
519
|
-
};
|
|
520
|
-
};
|
|
521
|
-
readonly maxSize: {
|
|
522
|
-
readonly xs: "320px";
|
|
523
|
-
readonly sm: "384px";
|
|
524
|
-
readonly md: "448px";
|
|
525
|
-
readonly lg: "512px";
|
|
526
|
-
};
|
|
527
|
-
readonly screens: {
|
|
528
|
-
readonly sm: "600px";
|
|
529
|
-
readonly md: "900px";
|
|
530
|
-
};
|
|
531
|
-
readonly size: {
|
|
532
|
-
readonly "2xs": "16px";
|
|
533
|
-
readonly xs: "20px";
|
|
534
|
-
readonly sm: "24px";
|
|
535
|
-
readonly md: "32px";
|
|
536
|
-
readonly lg: "40px";
|
|
537
|
-
readonly xl: "48px";
|
|
538
|
-
readonly "3xl": "80px";
|
|
539
|
-
};
|
|
540
|
-
readonly zIndex: {
|
|
541
|
-
readonly popover: "3000";
|
|
542
|
-
readonly toast: "3010";
|
|
543
|
-
readonly tooltip: "10000";
|
|
544
|
-
};
|
|
545
459
|
};
|
|
546
460
|
|
|
547
461
|
export { AxiomVersionContext, type MapLeafNodes, ToastContextProvider, createToaster, theme, toaster, tokens, tokensDark, useToastContext };
|
package/dist/toaster.js
CHANGED
|
@@ -24,7 +24,11 @@ const createToaster = () => {
|
|
|
24
24
|
snapshot = [];
|
|
25
25
|
emit();
|
|
26
26
|
},
|
|
27
|
-
create: (
|
|
27
|
+
create: (...args) => {
|
|
28
|
+
const toast = typeof args[0] === "string" ? {
|
|
29
|
+
...args[1],
|
|
30
|
+
title: args[0]
|
|
31
|
+
} : args[0];
|
|
28
32
|
const id2 = genId();
|
|
29
33
|
snapshot = [...snapshot, { id: id2, open: true, toast }];
|
|
30
34
|
emit();
|
package/dist/tokens/colors.js
CHANGED
package/dist/tokens/index.js
CHANGED
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"url": "https://github.com/optimizely-axiom/optiaxiom.git"
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "0.5.
|
|
10
|
+
"version": "0.5.1",
|
|
11
11
|
"files": [
|
|
12
12
|
"dist/**",
|
|
13
13
|
"LICENSE"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"inter-ui": "^4.1.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@vanilla-extract/css": "^1.
|
|
35
|
+
"@vanilla-extract/css": "^1.17.0",
|
|
36
36
|
"@optiaxiom/shared": "^0.0.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|