@autoguru/overdrive 4.40.1 → 4.41.0-next.0
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/components/Columns/Columns.stories.d.ts +16 -16
- package/dist/components/Columns/Columns.stories.d.ts.map +1 -1
- package/dist/components/DropDown/DropDown.stories.d.ts +2 -2
- package/dist/components/LoadingBox/LoadingBox.stories.d.ts +14 -14
- package/dist/components/LoadingBox/LoadingBox.stories.d.ts.map +1 -1
- package/dist/components/MinimalModal/MinimalModal.stories.d.ts +13 -0
- package/dist/components/MinimalModal/MinimalModal.stories.d.ts.map +1 -1
- package/dist/components/OptionList/OptionList.d.ts +3 -3
- package/dist/components/OverdriveProvider/FallbackProvider.d.ts +3 -0
- package/dist/components/OverdriveProvider/FallbackProvider.d.ts.map +1 -0
- package/dist/components/OverdriveProvider/FallbackProvider.js +14 -0
- package/dist/components/OverdriveProvider/OverdriveProvider.d.ts +24 -4
- package/dist/components/OverdriveProvider/OverdriveProvider.d.ts.map +1 -1
- package/dist/components/OverdriveProvider/OverdriveProvider.js +64 -17
- package/dist/components/OverdriveProvider/ThemeOverrideDebugger.d.ts.map +1 -0
- package/dist/components/OverdriveProvider/ThemeOverrideDebugger.js +56 -0
- package/dist/components/OverdriveProvider/index.d.ts +3 -1
- package/dist/components/OverdriveProvider/index.d.ts.map +1 -1
- package/dist/components/OverdriveProvider/index.js +3 -1
- package/dist/components/OverdriveProvider/useColorOverrides.d.ts +7 -0
- package/dist/components/OverdriveProvider/useColorOverrides.d.ts.map +1 -0
- package/dist/components/OverdriveProvider/useColorOverrides.js +60 -0
- package/dist/components/Portal/Portal.d.ts +5 -6
- package/dist/components/Portal/Portal.d.ts.map +1 -1
- package/dist/components/Portal/Portal.js +26 -20
- package/dist/components/Portal/Portal.stories.d.ts +1 -1
- package/dist/components/TextLink/TextLink.stories.d.ts +5 -5
- package/dist/components/VisuallyHidden/VisuallyHidden.stories.d.ts +1 -1
- package/dist/components/index.d.ts +15 -17
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +16 -18
- package/dist/hooks/useMedia/useMedia.js +1 -1
- package/dist/hooks/useWindowHeightFill/useWindowHeightFill.d.ts.map +1 -1
- package/dist/hooks/useWindowHeightFill/useWindowHeightFill.js +2 -3
- package/dist/stories/helpers/sprinkles.css.d.ts +16 -16
- package/dist/styles/sprinkles.css.d.ts +15 -15
- package/dist/test/vitest-setup.js +2 -12
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +7 -2
- package/readme.md +18 -2
- package/dist/components/ThemeOverrideProvider/ThemeOverrideDebugger.d.ts.map +0 -1
- package/dist/components/ThemeOverrideProvider/ThemeOverrideDebugger.js +0 -79
- package/dist/components/ThemeOverrideProvider/ThemeOverrideProvider.d.ts +0 -22
- package/dist/components/ThemeOverrideProvider/ThemeOverrideProvider.d.ts.map +0 -1
- package/dist/components/ThemeOverrideProvider/ThemeOverrideProvider.js +0 -47
- package/dist/components/ThemeOverrideProvider/index.d.ts +0 -3
- package/dist/components/ThemeOverrideProvider/index.d.ts.map +0 -1
- package/dist/components/ThemeOverrideProvider/index.js +0 -4
- package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.d.ts +0 -17
- package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.d.ts.map +0 -1
- package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.js +0 -107
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +0 -19
- package/dist/components/ThemeProvider/ThemeProvider.d.ts.map +0 -1
- package/dist/components/ThemeProvider/ThemeProvider.js +0 -42
- package/dist/components/ThemeProvider/index.d.ts +0 -2
- package/dist/components/ThemeProvider/index.d.ts.map +0 -1
- package/dist/components/ThemeProvider/index.js +0 -3
- /package/dist/components/{ThemeOverrideProvider → OverdriveProvider}/ThemeOverrideDebugger.d.ts +0 -0
|
@@ -3,8 +3,6 @@ declare const _default: {
|
|
|
3
3
|
title: string;
|
|
4
4
|
component: React.ForwardRefExoticComponent<Omit<import("./Columns").Props, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
5
5
|
decorators: ((story: import("@storybook/core/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
6
|
-
value?: string | number | readonly string[] | undefined;
|
|
7
|
-
id?: string | undefined | undefined;
|
|
8
6
|
colour?: keyof typeof import("../Box/useBoxStyles.css").colours | undefined;
|
|
9
7
|
backgroundColour?: keyof typeof import("../Box/useBoxStyles.css").backgroundColours | undefined;
|
|
10
8
|
space?: import("../../utils/responsiveProps.css").ResponsiveProp<keyof import("../../themes/tokens").Tokens["space"]> | undefined;
|
|
@@ -45,25 +43,16 @@ declare const _default: {
|
|
|
45
43
|
margin?: import("../../utils/responsiveProps.css").ResponsiveProp<keyof import("../../themes/tokens").Tokens["space"]> | undefined;
|
|
46
44
|
overflow?: keyof typeof import("../Box/useBoxStyles.css").overflow | undefined;
|
|
47
45
|
padding?: import("../../utils/responsiveProps.css").ResponsiveProp<keyof import("../../themes/tokens").Tokens["space"]> | undefined;
|
|
46
|
+
style?: React.CSSProperties | undefined;
|
|
48
47
|
start?: number | undefined | undefined;
|
|
49
48
|
hidden?: boolean | undefined | undefined;
|
|
50
|
-
style?: React.CSSProperties | undefined;
|
|
51
49
|
default?: boolean | undefined | undefined;
|
|
52
50
|
wrap?: string | undefined | undefined;
|
|
53
51
|
open?: boolean | undefined | undefined;
|
|
54
52
|
multiple?: boolean | undefined | undefined;
|
|
55
53
|
disabled?: boolean | undefined | undefined;
|
|
56
|
-
children?: React.ReactNode;
|
|
57
|
-
cite?: string | undefined | undefined;
|
|
58
|
-
data?: string | undefined | undefined;
|
|
59
|
-
form?: string | undefined | undefined;
|
|
60
|
-
label?: string | undefined | undefined;
|
|
61
|
-
slot?: string | undefined | undefined;
|
|
62
|
-
span?: number | undefined | undefined;
|
|
63
|
-
summary?: string | undefined | undefined;
|
|
64
|
-
title?: string | undefined | undefined;
|
|
65
|
-
pattern?: string | undefined | undefined;
|
|
66
54
|
key?: React.Key | null | undefined;
|
|
55
|
+
value?: string | number | readonly string[] | undefined;
|
|
67
56
|
as?: React.ElementType | undefined;
|
|
68
57
|
is?: React.ElementType | undefined;
|
|
69
58
|
className?: string | undefined;
|
|
@@ -84,6 +73,15 @@ declare const _default: {
|
|
|
84
73
|
borderColourRight?: keyof typeof import("../Box/useBoxStyles.css").border["colour"]["top"] | undefined;
|
|
85
74
|
borderColourBottom?: keyof typeof import("../Box/useBoxStyles.css").border["colour"]["top"] | undefined;
|
|
86
75
|
borderColourLeft?: keyof typeof import("../Box/useBoxStyles.css").border["colour"]["top"] | undefined;
|
|
76
|
+
cite?: string | undefined | undefined;
|
|
77
|
+
data?: string | undefined | undefined;
|
|
78
|
+
form?: string | undefined | undefined;
|
|
79
|
+
label?: string | undefined | undefined;
|
|
80
|
+
slot?: string | undefined | undefined;
|
|
81
|
+
span?: number | undefined | undefined;
|
|
82
|
+
summary?: string | undefined | undefined;
|
|
83
|
+
title?: string | undefined | undefined;
|
|
84
|
+
pattern?: string | undefined | undefined;
|
|
87
85
|
accept?: string | undefined | undefined;
|
|
88
86
|
acceptCharset?: string | undefined | undefined;
|
|
89
87
|
action?: string | ((formData: FormData) => void | Promise<void>) | undefined;
|
|
@@ -177,6 +175,7 @@ declare const _default: {
|
|
|
177
175
|
dir?: string | undefined | undefined;
|
|
178
176
|
draggable?: (boolean | "false" | "true") | undefined;
|
|
179
177
|
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
178
|
+
id?: string | undefined | undefined;
|
|
180
179
|
lang?: string | undefined | undefined;
|
|
181
180
|
nonce?: string | undefined | undefined;
|
|
182
181
|
spellCheck?: (boolean | "false" | "true") | undefined;
|
|
@@ -263,6 +262,7 @@ declare const _default: {
|
|
|
263
262
|
"aria-valuemin"?: number | undefined | undefined;
|
|
264
263
|
"aria-valuenow"?: number | undefined | undefined;
|
|
265
264
|
"aria-valuetext"?: string | undefined | undefined;
|
|
265
|
+
children?: React.ReactNode;
|
|
266
266
|
dangerouslySetInnerHTML?: {
|
|
267
267
|
__html: string | TrustedHTML;
|
|
268
268
|
} | undefined | undefined;
|
|
@@ -496,8 +496,6 @@ declare const _default: {
|
|
|
496
496
|
flexShrink?: import("@storybook/core/csf").InputType | undefined;
|
|
497
497
|
flexWrap?: import("@storybook/core/csf").InputType | undefined;
|
|
498
498
|
justifyContent?: import("@storybook/core/csf").InputType | undefined;
|
|
499
|
-
value?: import("@storybook/core/csf").InputType | undefined;
|
|
500
|
-
id?: import("@storybook/core/csf").InputType | undefined;
|
|
501
499
|
min?: import("@storybook/core/csf").InputType | undefined;
|
|
502
500
|
size?: import("@storybook/core/csf").InputType | undefined;
|
|
503
501
|
muted?: import("@storybook/core/csf").InputType | undefined;
|
|
@@ -505,14 +503,15 @@ declare const _default: {
|
|
|
505
503
|
color?: import("@storybook/core/csf").InputType | undefined;
|
|
506
504
|
content?: import("@storybook/core/csf").InputType | undefined;
|
|
507
505
|
translate?: import("@storybook/core/csf").InputType | undefined;
|
|
506
|
+
style?: import("@storybook/core/csf").InputType | undefined;
|
|
508
507
|
start?: import("@storybook/core/csf").InputType | undefined;
|
|
509
508
|
hidden?: import("@storybook/core/csf").InputType | undefined;
|
|
510
|
-
style?: import("@storybook/core/csf").InputType | undefined;
|
|
511
509
|
default?: import("@storybook/core/csf").InputType | undefined;
|
|
512
510
|
wrap?: import("@storybook/core/csf").InputType | undefined;
|
|
513
511
|
open?: import("@storybook/core/csf").InputType | undefined;
|
|
514
512
|
multiple?: import("@storybook/core/csf").InputType | undefined;
|
|
515
513
|
disabled?: import("@storybook/core/csf").InputType | undefined;
|
|
514
|
+
value?: import("@storybook/core/csf").InputType | undefined;
|
|
516
515
|
cite?: import("@storybook/core/csf").InputType | undefined;
|
|
517
516
|
data?: import("@storybook/core/csf").InputType | undefined;
|
|
518
517
|
form?: import("@storybook/core/csf").InputType | undefined;
|
|
@@ -615,6 +614,7 @@ declare const _default: {
|
|
|
615
614
|
dir?: import("@storybook/core/csf").InputType | undefined;
|
|
616
615
|
draggable?: import("@storybook/core/csf").InputType | undefined;
|
|
617
616
|
enterKeyHint?: import("@storybook/core/csf").InputType | undefined;
|
|
617
|
+
id?: import("@storybook/core/csf").InputType | undefined;
|
|
618
618
|
lang?: import("@storybook/core/csf").InputType | undefined;
|
|
619
619
|
nonce?: import("@storybook/core/csf").InputType | undefined;
|
|
620
620
|
spellCheck?: import("@storybook/core/csf").InputType | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Columns.stories.d.ts","sourceRoot":"","sources":["../../../lib/components/Columns/Columns.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"Columns.stories.d.ts","sourceRoot":"","sources":["../../../lib/components/Columns/Columns.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC;;;;;;;+EAkClC,6CACV;;;;;;;;;;;;;;;;;sFAgBU,6CAAgB;oFAI/B,6CACC;qFAPY,6CACL;mFAJW,6CACR;;;uFAbW,6CAExB;qFAGO,6CAEN;sFAXU,6CAEV;oFALO,6CACI;;;;;;;qFAiCH,8CACJ,SAAS;;gFApBQ,6CAAgB;;iFA3BhC,6CACG;;;;;;;;;;;;;;kFAES,6CAGhB;kFAEC,6CACD;iFAmBgB,6CACL;iFAAkC,6CAAgB;sFAmBxC,8CAAiB,SACrC;sFAIE,8CAAiB,SAAS;wFAErB,8CACP,SAAS;0FAEO,8CACJ,SAAS;2FACa,8CAElC,SACD;yFAEoB,8CAAiB,SAAS;6BAEvC,yDACS,OACb;8BACQ,yDACY,OAAO;8BACT,yDAEnB,OACH;gCAEI,yDAGiB,OAAO;kCAA4B,yDAExD,OAAO;mCAEA,yDACS,OACb;iCACW,yDACY,OACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAjGF,wBAkCiC;AA8HjC,eAAO,MAAM,QAAQ,qKAA+B,CAAC;AAQrD,eAAO,MAAM,cAAc,oKAA2C,CAAC"}
|
|
@@ -10,15 +10,15 @@ declare const meta: {
|
|
|
10
10
|
icon?: import("@autoguru/icons").IconType | undefined;
|
|
11
11
|
isOpen?: boolean | undefined;
|
|
12
12
|
onClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
13
|
-
id?: string | undefined | undefined;
|
|
14
13
|
size?: import("../Button/Button.css").ButtonSize | undefined;
|
|
15
14
|
disabled?: boolean | undefined;
|
|
16
|
-
ref?: React.Ref<HTMLButtonElement> | undefined;
|
|
17
15
|
key?: React.Key | null | undefined;
|
|
18
16
|
className?: string | undefined | undefined;
|
|
19
17
|
type?: "submit" | "reset" | "button" | undefined | undefined;
|
|
18
|
+
id?: string | undefined | undefined;
|
|
20
19
|
lang?: Partial<Record<"loading", string>> | undefined;
|
|
21
20
|
"aria-label"?: string | undefined | undefined;
|
|
21
|
+
ref?: React.Ref<HTMLButtonElement> | undefined;
|
|
22
22
|
testId?: string | undefined;
|
|
23
23
|
rounded?: boolean | undefined;
|
|
24
24
|
minimal?: import("../Button/Button.css").ButtonMinimal | undefined;
|
|
@@ -8,8 +8,6 @@ declare const _default: {
|
|
|
8
8
|
className?: string | undefined;
|
|
9
9
|
randomWidth?: boolean | undefined;
|
|
10
10
|
blinking?: boolean | undefined;
|
|
11
|
-
value?: string | number | readonly string[] | undefined;
|
|
12
|
-
id?: string | undefined | undefined;
|
|
13
11
|
colour?: keyof typeof import("../Box/useBoxStyles.css").colours | undefined;
|
|
14
12
|
backgroundColour?: keyof typeof import("../Box/useBoxStyles.css").backgroundColours | undefined;
|
|
15
13
|
min?: number | string | undefined | undefined;
|
|
@@ -47,26 +45,16 @@ declare const _default: {
|
|
|
47
45
|
margin?: import("../../utils/responsiveProps.css").ResponsiveProp<keyof import("../../themes/tokens").Tokens["space"]> | undefined;
|
|
48
46
|
overflow?: keyof typeof import("../Box/useBoxStyles.css").overflow | undefined;
|
|
49
47
|
padding?: import("../../utils/responsiveProps.css").ResponsiveProp<keyof import("../../themes/tokens").Tokens["space"]> | undefined;
|
|
48
|
+
style?: React.CSSProperties | undefined;
|
|
50
49
|
start?: number | undefined | undefined;
|
|
51
50
|
hidden?: boolean | undefined | undefined;
|
|
52
|
-
style?: React.CSSProperties | undefined;
|
|
53
51
|
default?: boolean | undefined | undefined;
|
|
54
52
|
wrap?: string | undefined | undefined;
|
|
55
53
|
open?: boolean | undefined | undefined;
|
|
56
54
|
multiple?: boolean | undefined | undefined;
|
|
57
55
|
disabled?: boolean | undefined | undefined;
|
|
58
|
-
children?: React.ReactNode;
|
|
59
|
-
ref?: React.Ref<HTMLElement> | undefined;
|
|
60
|
-
cite?: string | undefined | undefined;
|
|
61
|
-
data?: string | undefined | undefined;
|
|
62
|
-
form?: string | undefined | undefined;
|
|
63
|
-
label?: string | undefined | undefined;
|
|
64
|
-
slot?: string | undefined | undefined;
|
|
65
|
-
span?: number | undefined | undefined;
|
|
66
|
-
summary?: string | undefined | undefined;
|
|
67
|
-
title?: string | undefined | undefined;
|
|
68
|
-
pattern?: string | undefined | undefined;
|
|
69
56
|
key?: React.Key | null | undefined;
|
|
57
|
+
value?: string | number | readonly string[] | undefined;
|
|
70
58
|
as?: React.ElementType | undefined;
|
|
71
59
|
is?: React.ElementType | undefined;
|
|
72
60
|
paddingX?: import("../../utils/responsiveProps.css").ResponsiveProp<keyof import("../../themes/tokens").Tokens["space"]> | undefined;
|
|
@@ -86,6 +74,15 @@ declare const _default: {
|
|
|
86
74
|
borderColourRight?: keyof typeof import("../Box/useBoxStyles.css").border["colour"]["top"] | undefined;
|
|
87
75
|
borderColourBottom?: keyof typeof import("../Box/useBoxStyles.css").border["colour"]["top"] | undefined;
|
|
88
76
|
borderColourLeft?: keyof typeof import("../Box/useBoxStyles.css").border["colour"]["top"] | undefined;
|
|
77
|
+
cite?: string | undefined | undefined;
|
|
78
|
+
data?: string | undefined | undefined;
|
|
79
|
+
form?: string | undefined | undefined;
|
|
80
|
+
label?: string | undefined | undefined;
|
|
81
|
+
slot?: string | undefined | undefined;
|
|
82
|
+
span?: number | undefined | undefined;
|
|
83
|
+
summary?: string | undefined | undefined;
|
|
84
|
+
title?: string | undefined | undefined;
|
|
85
|
+
pattern?: string | undefined | undefined;
|
|
89
86
|
accept?: string | undefined | undefined;
|
|
90
87
|
acceptCharset?: string | undefined | undefined;
|
|
91
88
|
action?: string | ((formData: FormData) => void | Promise<void>) | undefined;
|
|
@@ -179,6 +176,7 @@ declare const _default: {
|
|
|
179
176
|
dir?: string | undefined | undefined;
|
|
180
177
|
draggable?: (boolean | "false" | "true") | undefined;
|
|
181
178
|
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
179
|
+
id?: string | undefined | undefined;
|
|
182
180
|
lang?: string | undefined | undefined;
|
|
183
181
|
nonce?: string | undefined | undefined;
|
|
184
182
|
spellCheck?: (boolean | "false" | "true") | undefined;
|
|
@@ -265,6 +263,7 @@ declare const _default: {
|
|
|
265
263
|
"aria-valuemin"?: number | undefined | undefined;
|
|
266
264
|
"aria-valuenow"?: number | undefined | undefined;
|
|
267
265
|
"aria-valuetext"?: string | undefined | undefined;
|
|
266
|
+
children?: React.ReactNode;
|
|
268
267
|
dangerouslySetInnerHTML?: {
|
|
269
268
|
__html: string | TrustedHTML;
|
|
270
269
|
} | undefined | undefined;
|
|
@@ -438,6 +437,7 @@ declare const _default: {
|
|
|
438
437
|
onTransitionRunCapture?: React.TransitionEventHandler<HTMLElement> | undefined;
|
|
439
438
|
onTransitionStart?: React.TransitionEventHandler<HTMLElement> | undefined;
|
|
440
439
|
onTransitionStartCapture?: React.TransitionEventHandler<HTMLElement> | undefined;
|
|
440
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
441
441
|
}>) => React.JSX.Element)[];
|
|
442
442
|
parameters: {
|
|
443
443
|
chromatic: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingBox.stories.d.ts","sourceRoot":"","sources":["../../../lib/components/LoadingBox/LoadingBox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC
|
|
1
|
+
{"version":3,"file":"LoadingBox.stories.d.ts","sourceRoot":"","sources":["../../../lib/components/LoadingBox/LoadingBox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;sFAiCgU,6CAAgB;oFAAqC,6CAAgB;qFAA5H,6CAAgB;mFAAtE,6CAAgB;;;uFAJhQ,6CACO;qFAGU,6CAAgB;sFAT1B,6CAEP;oFAJF,6CAAe;;;;;;;qFAWyiB,8CAAiB,SAAS;gFAAxf,6CAAgB;;iFArB9D,6CAC/B;;;;;;;;;;;;;kFACW,6CAEtB;kFAAmC,6CAE3B;iFAekI,6CAAgB;iFAAkC,6CAAgB;sFAA2a,8CAAiB,SAAS;sFAAuC,8CAAiB,SAAS;wFAAyC,8CAAiB,SAAS;0FAA2C,8CAAiB,SAAS;2FAA4C,8CAAiB,SAAS;yFAA0C,8CAAiB,SAAS;6BAAyB,yDAAiC,OAAO;8BAAwB,yDAAiC,OAAO;8BAAwB,yDAAiC,OAAO;gCAA0B,yDAAiC,OAAO;kCAA4B,yDAAiC,OAAO;mCAA6B,yDAAiC,OAAO;iCAA2B,yDAAiC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA/Br7C,wBAYoC;AAEpC,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAC;AAEzC,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAIzB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAIzB,CAAC"}
|
|
@@ -10,6 +10,19 @@ declare const _default: {
|
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
argTypes: ArgTypes<import("@storybook/react").Args>;
|
|
13
|
+
decorators: ((Story: import("@storybook/core/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
14
|
+
className?: string | undefined;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
isOpen: boolean;
|
|
17
|
+
hideBackdrop?: boolean | undefined;
|
|
18
|
+
disableBackdropClick?: boolean | undefined;
|
|
19
|
+
onRequestClose?: ((e: "backdrop" | "escapeKeyDown" | string) => void) | undefined;
|
|
20
|
+
container?: HTMLElement | undefined;
|
|
21
|
+
noThemedWrapper?: boolean | undefined;
|
|
22
|
+
ref?: React.Ref<HTMLElement | undefined> | undefined;
|
|
23
|
+
key?: React.Key | null | undefined;
|
|
24
|
+
alignItems?: import("../../utils/responsiveProps.css").ResponsiveProp<keyof typeof import("../Box/useBoxStyles.css").alignItems> | undefined;
|
|
25
|
+
}>) => React.JSX.Element)[];
|
|
13
26
|
};
|
|
14
27
|
export default _default;
|
|
15
28
|
type Story = StoryObj<typeof MinimalModal>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinimalModal.stories.d.ts","sourceRoot":"","sources":["../../../lib/components/MinimalModal/MinimalModal.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAA8B,MAAM,OAAO,CAAC;AAOnD,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC
|
|
1
|
+
{"version":3,"file":"MinimalModal.stories.d.ts","sourceRoot":"","sources":["../../../lib/components/MinimalModal/MinimalModal.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAA8B,MAAM,OAAO,CAAC;AAOnD,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;AAWjC,wBAcsC;AAEtC,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AA+H3C,eAAO,MAAM,QAAQ,EAAE,KAOtB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAQzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAQ/B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAQ/B,CAAC"}
|
|
@@ -17,17 +17,17 @@ export declare const OptionList: {
|
|
|
17
17
|
(props: WithTestId<OptionListProps>): React.JSX.Element;
|
|
18
18
|
Item: {
|
|
19
19
|
(props: {
|
|
20
|
-
value: string;
|
|
21
|
-
id?: string | undefined;
|
|
22
20
|
name?: string | undefined;
|
|
23
|
-
|
|
21
|
+
value: string;
|
|
24
22
|
autoFocus?: boolean | undefined;
|
|
23
|
+
id?: string | undefined;
|
|
25
24
|
'aria-controls'?: string | undefined;
|
|
26
25
|
'aria-describedby'?: string | undefined;
|
|
27
26
|
'aria-details'?: string | undefined;
|
|
28
27
|
'aria-errormessage'?: string | undefined;
|
|
29
28
|
'aria-label'?: string | undefined;
|
|
30
29
|
'aria-labelledby'?: string | undefined;
|
|
30
|
+
children?: React.ReactNode;
|
|
31
31
|
onFocus?: ((e: React.FocusEvent<Element, Element>) => void) | undefined;
|
|
32
32
|
onBlur?: ((e: React.FocusEvent<Element, Element>) => void) | undefined;
|
|
33
33
|
onChange?: ((isSelected: boolean) => void) | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FallbackProvider.d.ts","sourceRoot":"","sources":["../../../lib/components/OverdriveProvider/FallbackProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,eAAO,MAAM,gBAAgB,GAAI,cAAc,KAAK,CAAC,iBAAiB,sBAMrE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { warning } from '@autoguru/utilities';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
export const FallbackProvider = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
children
|
|
9
|
+
} = _ref;
|
|
10
|
+
process.env.NODE_ENV !== "production" ? warning(false, 'This application is using a provider which is now deprecated. The theme context and overrides are available from <OverdriveProvider>') : void 0;
|
|
11
|
+
return _jsx(_Fragment, {
|
|
12
|
+
children: children
|
|
13
|
+
});
|
|
14
|
+
};
|
|
@@ -1,9 +1,29 @@
|
|
|
1
|
+
import { assignInlineVars } from '@vanilla-extract/dynamic';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
3
|
+
import baseTheme from '../../themes/base';
|
|
4
|
+
import { RuntimeTokens } from '../../themes/makeTheme';
|
|
5
|
+
import { themeContractVars } from '../../themes/theme.css';
|
|
6
|
+
import { BreakPoints } from '../../themes/tokens';
|
|
7
|
+
import { type ColorOverrides } from './useColorOverrides';
|
|
8
|
+
type ThemeContract = typeof themeContractVars;
|
|
9
|
+
type PortalMountPoint = React.RefObject<HTMLElement | null>;
|
|
10
|
+
export interface ProviderProps {
|
|
11
|
+
theme?: typeof baseTheme;
|
|
12
|
+
breakpoints?: BreakPoints;
|
|
4
13
|
noBodyLevelTheming?: boolean;
|
|
14
|
+
colorOverrides?: Partial<ColorOverrides>;
|
|
15
|
+
portalMountPoint?: PortalMountPoint;
|
|
5
16
|
children?: React.ReactNode;
|
|
6
17
|
}
|
|
7
|
-
export
|
|
8
|
-
|
|
18
|
+
export interface ProviderContext extends Pick<ProviderProps, 'colorOverrides' | 'portalMountPoint'> {
|
|
19
|
+
themeClass: (typeof baseTheme)['themeRef'];
|
|
20
|
+
themeName: string;
|
|
21
|
+
overrideStyles: ReturnType<typeof assignInlineVars>;
|
|
22
|
+
vars: ThemeContract;
|
|
23
|
+
}
|
|
24
|
+
export declare const useTheme: () => ProviderContext;
|
|
25
|
+
export declare const useRuntimeTokens: () => RuntimeTokens;
|
|
26
|
+
export declare const Provider: ({ breakpoints, children, colorOverrides, noBodyLevelTheming, portalMountPoint, theme, }: ProviderProps) => React.JSX.Element;
|
|
27
|
+
export declare const OverdriveProvider: React.NamedExoticComponent<ProviderProps>;
|
|
28
|
+
export {};
|
|
9
29
|
//# sourceMappingURL=OverdriveProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverdriveProvider.d.ts","sourceRoot":"","sources":["../../../lib/components/OverdriveProvider/OverdriveProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OverdriveProvider.d.ts","sourceRoot":"","sources":["../../../lib/components/OverdriveProvider/OverdriveProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAwD,MAAM,OAAO,CAAC;AAE7E,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAqB,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE7E,KAAK,aAAa,GAAG,OAAO,iBAAiB,CAAC;AAC9C,KAAK,gBAAgB,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;AAE5D,MAAM,WAAW,aAAa;IAE7B,KAAK,CAAC,EAAE,OAAO,SAAS,CAAC;IAEzB,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B,cAAc,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAEzC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,eAChB,SAAQ,IAAI,CAAC,aAAa,EAAE,gBAAgB,GAAG,kBAAkB,CAAC;IAClE,UAAU,EAAE,CAAC,OAAO,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;IACpD,IAAI,EAAE,aAAa,CAAC;CACpB;AAMD,eAAO,MAAM,QAAQ,uBAIpB,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAO,aAInC,CAAC;AAUF,eAAO,MAAM,QAAQ,GAAI,yFAOtB,aAAa,sBAqDf,CAAC;AAEF,eAAO,MAAM,iBAAiB,2CAK7B,CAAC"}
|
|
@@ -1,29 +1,76 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
const _excluded = ["noBodyLevelTheming", "children"];
|
|
6
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
|
-
import
|
|
6
|
+
import { invariant } from '@autoguru/utilities';
|
|
7
|
+
import { isEqual } from 'es-toolkit';
|
|
8
|
+
import React, { createContext, useContext, useEffect, useMemo } from 'react';
|
|
9
|
+
import baseTheme from "../../themes/base/index.js";
|
|
10
|
+
import { makeRuntimeTokens } from "../../themes/makeTheme.js";
|
|
9
11
|
import { isBrowser } from "../../utils/index.js";
|
|
10
|
-
import {
|
|
12
|
+
import { useColorOverrides } from "./useColorOverrides.js";
|
|
11
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
|
|
14
|
+
const OverdriveContext = createContext(null);
|
|
15
|
+
const RuntimeTokensContext = createContext(null);
|
|
16
|
+
const msgInvariantError = "You haven't used an `<OverdriveProvider>`.";
|
|
17
|
+
export const useTheme = () => {
|
|
18
|
+
const context = useContext(OverdriveContext);
|
|
19
|
+
!(context !== null) ? process.env.NODE_ENV !== "production" ? invariant(false, msgInvariantError) : invariant(false) : void 0;
|
|
20
|
+
return context;
|
|
21
|
+
};
|
|
22
|
+
export const useRuntimeTokens = () => {
|
|
23
|
+
const tokens = useContext(RuntimeTokensContext);
|
|
24
|
+
!(tokens !== null) ? process.env.NODE_ENV !== "production" ? invariant(false, msgInvariantError) : invariant(false) : void 0;
|
|
25
|
+
return tokens;
|
|
26
|
+
};
|
|
27
|
+
const isSafeElement = element => {
|
|
28
|
+
return element instanceof HTMLElement && !element.hasAttribute('onclick') && !element.hasAttribute('onerror');
|
|
29
|
+
};
|
|
30
|
+
export const Provider = _ref => {
|
|
13
31
|
let {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
32
|
+
breakpoints,
|
|
33
|
+
children,
|
|
34
|
+
colorOverrides,
|
|
35
|
+
noBodyLevelTheming = false,
|
|
36
|
+
portalMountPoint,
|
|
37
|
+
theme = baseTheme
|
|
38
|
+
} = _ref;
|
|
39
|
+
const runtimeTokens = useMemo(() => makeRuntimeTokens(breakpoints), [breakpoints]);
|
|
40
|
+
const styles = useColorOverrides(colorOverrides, String(theme.vars.mode));
|
|
41
|
+
const themeValues = useMemo(() => ({
|
|
42
|
+
themeClass: theme.themeRef,
|
|
43
|
+
themeName: theme.name,
|
|
44
|
+
colorOverrides,
|
|
45
|
+
overrideStyles: styles,
|
|
46
|
+
portalMountPoint,
|
|
47
|
+
vars: theme.vars
|
|
48
|
+
}), [colorOverrides, portalMountPoint, styles, theme]);
|
|
18
49
|
useEffect(() => {
|
|
19
|
-
if (!isBrowser || noBodyLevelTheming || document.body.classList.contains(
|
|
20
|
-
document.body.classList.add(
|
|
50
|
+
if (!isBrowser || noBodyLevelTheming || document.body.classList.contains(theme.themeRef)) return;
|
|
51
|
+
document.body.classList.add(theme.themeRef);
|
|
21
52
|
return () => {
|
|
22
|
-
document.body.classList.remove(
|
|
53
|
+
document.body.classList.remove(theme.themeRef);
|
|
23
54
|
};
|
|
24
|
-
}, [noBodyLevelTheming,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
55
|
+
}, [noBodyLevelTheming, theme]);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (portalMountPoint !== null && portalMountPoint !== void 0 && portalMountPoint.current && !isSafeElement(portalMountPoint.current)) {
|
|
58
|
+
console.error('Unsafe portal mount point detected');
|
|
59
|
+
portalMountPoint.current = null;
|
|
60
|
+
}
|
|
61
|
+
}, [portalMountPoint]);
|
|
62
|
+
return _jsx(OverdriveContext.Provider, {
|
|
63
|
+
value: themeValues,
|
|
64
|
+
children: _jsx(RuntimeTokensContext.Provider, {
|
|
65
|
+
value: runtimeTokens,
|
|
66
|
+
children: _jsx("div", {
|
|
67
|
+
className: theme.themeRef,
|
|
68
|
+
style: styles,
|
|
69
|
+
children: children
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
});
|
|
28
73
|
};
|
|
29
|
-
export
|
|
74
|
+
export const OverdriveProvider = React.memo(props => _jsx(Provider, _objectSpread({}, props)), (prevProps, nextProps) => {
|
|
75
|
+
return isEqual(prevProps, nextProps);
|
|
76
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeOverrideDebugger.d.ts","sourceRoot":"","sources":["../../../lib/components/OverdriveProvider/ThemeOverrideDebugger.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAU1D,eAAO,MAAM,qBAAqB,EAAE,iBAiFnC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
|
+
import { passesAccessibilityContrast } from "../../themes/helpers.js";
|
|
5
|
+
import { Column, Columns } from "../Columns/index.js";
|
|
6
|
+
import { Stack } from "../Stack/index.js";
|
|
7
|
+
import { Text } from "../Text/index.js";
|
|
8
|
+
import { useTheme } from "./OverdriveProvider.js";
|
|
9
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
export const ThemeOverrideDebugger = () => {
|
|
11
|
+
const {
|
|
12
|
+
colorOverrides,
|
|
13
|
+
themeName,
|
|
14
|
+
vars
|
|
15
|
+
} = useTheme();
|
|
16
|
+
const colorBackground = (colorOverrides === null || colorOverrides === void 0 ? void 0 : colorOverrides.primaryBackground) || vars.colours.intent.primary.background.standard;
|
|
17
|
+
const colorForeground = (colorOverrides === null || colorOverrides === void 0 ? void 0 : colorOverrides.primaryForeground) || vars.colours.intent.primary.foreground;
|
|
18
|
+
const passesAA = useMemo(() => passesAccessibilityContrast({
|
|
19
|
+
colour1: colorForeground,
|
|
20
|
+
colour2: colorBackground,
|
|
21
|
+
level: 'AA',
|
|
22
|
+
textSize: 'LARGE'
|
|
23
|
+
}), [colorForeground, colorBackground]);
|
|
24
|
+
const passesAAA = useMemo(() => passesAccessibilityContrast({
|
|
25
|
+
colour1: colorForeground,
|
|
26
|
+
colour2: colorBackground,
|
|
27
|
+
level: 'AAA',
|
|
28
|
+
textSize: 'LARGE'
|
|
29
|
+
}), [colorForeground, colorBackground]);
|
|
30
|
+
return _jsx(Columns, {
|
|
31
|
+
space: "3",
|
|
32
|
+
style: {
|
|
33
|
+
position: 'fixed',
|
|
34
|
+
right: '10px',
|
|
35
|
+
bottom: '20px',
|
|
36
|
+
zIndex: 9,
|
|
37
|
+
backgroundColor: 'white',
|
|
38
|
+
width: '350px',
|
|
39
|
+
padding: '8px',
|
|
40
|
+
boxShadow: '0 14px 28px rgb(0 0 0 / 25%), 0 10px 10px rgb(0 0 0 / 22%)',
|
|
41
|
+
borderRadius: '4px'
|
|
42
|
+
},
|
|
43
|
+
children: _jsx(Column, {
|
|
44
|
+
children: _jsxs(Stack, {
|
|
45
|
+
children: [_jsxs(Text, {
|
|
46
|
+
children: ["AA: ", passesAA ? 'PASSED' : 'FAILED']
|
|
47
|
+
}), _jsxs(Text, {
|
|
48
|
+
children: ["AAA: ", passesAAA ? 'PASSED' : 'FAILED']
|
|
49
|
+
}), _jsx(Text, {
|
|
50
|
+
colour: "primary",
|
|
51
|
+
children: themeName
|
|
52
|
+
})]
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export { OverdriveProvider } from './OverdriveProvider';
|
|
1
|
+
export { OverdriveProvider, useRuntimeTokens, useTheme, } from './OverdriveProvider';
|
|
2
|
+
export { FallbackProvider as ThemeProvider, FallbackProvider as ThemeOverrideProvider, } from './FallbackProvider';
|
|
3
|
+
export { ThemeOverrideDebugger, ThemeOverrideDebugger as ThemeAnalyser, } from './ThemeOverrideDebugger';
|
|
2
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/OverdriveProvider/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/OverdriveProvider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,GACR,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,gBAAgB,IAAI,aAAa,EACjC,gBAAgB,IAAI,qBAAqB,GACzC,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACN,qBAAqB,EACrB,qBAAqB,IAAI,aAAa,GACtC,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
export { OverdriveProvider } from "./OverdriveProvider.js";
|
|
3
|
+
export { OverdriveProvider, useRuntimeTokens, useTheme } from "./OverdriveProvider.js";
|
|
4
|
+
export { FallbackProvider as ThemeProvider, FallbackProvider as ThemeOverrideProvider } from "./FallbackProvider.js";
|
|
5
|
+
export { ThemeOverrideDebugger, ThemeOverrideDebugger as ThemeAnalyser } from "./ThemeOverrideDebugger.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const colorOverrideKeys: readonly ["primaryBackground", "primaryBackgroundMild", "primaryBackgroundStrong", "primaryBorder", "primaryForeground"];
|
|
2
|
+
export type ColorOverrides = Record<(typeof colorOverrideKeys)[number], string>;
|
|
3
|
+
export declare const useColorOverrides: (overrides: Partial<ColorOverrides> | undefined, themeMode: string) => {
|
|
4
|
+
[cssVarName: string]: string;
|
|
5
|
+
};
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=useColorOverrides.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useColorOverrides.d.ts","sourceRoot":"","sources":["../../../lib/components/OverdriveProvider/useColorOverrides.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,iBAAiB,0HAMb,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AAQhF,eAAO,MAAM,iBAAiB,GAC7B,WAAW,OAAO,CAAC,cAAc,CAAC,GAAG,SAAS,EAC9C,WAAW,MAAM;;CAgEjB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { assignInlineVars } from '@vanilla-extract/dynamic';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { shadedColour } from "../../themes/helpers.js";
|
|
6
|
+
import { themeContractVars } from "../../themes/theme.css.js";
|
|
7
|
+
const colorOverrideKeys = ['primaryBackground', 'primaryBackgroundMild', 'primaryBackgroundStrong', 'primaryBorder', 'primaryForeground'];
|
|
8
|
+
const isValidColor = color => {
|
|
9
|
+
const s = new Option().style;
|
|
10
|
+
s.color = color;
|
|
11
|
+
return s.color !== '';
|
|
12
|
+
};
|
|
13
|
+
export const useColorOverrides = (overrides, themeMode) => {
|
|
14
|
+
return useMemo(() => {
|
|
15
|
+
var _overrides$primaryBac, _mildPrimary, _strongPrimary, _overrides$primaryFor, _overrides$primaryBor, _overrides$primaryBac2;
|
|
16
|
+
if (!overrides) return {};
|
|
17
|
+
colorOverrideKeys.forEach(key => {
|
|
18
|
+
if (overrides[key] && !isValidColor(overrides[key])) {
|
|
19
|
+
console.warn(`Invalid color value for ${key}: ${overrides[key]}`);
|
|
20
|
+
delete overrides[key];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
let mildPrimary = null;
|
|
24
|
+
let strongPrimary = null;
|
|
25
|
+
if (overrides.primaryBackground) {
|
|
26
|
+
mildPrimary = overrides.primaryBackgroundMild || shadedColour({
|
|
27
|
+
colour: overrides.primaryBackground,
|
|
28
|
+
isDarkTheme: false,
|
|
29
|
+
direction: themeMode === 'light' ? 'forward' : 'backward',
|
|
30
|
+
intensity: 0.1
|
|
31
|
+
});
|
|
32
|
+
strongPrimary = overrides.primaryBackgroundStrong || shadedColour({
|
|
33
|
+
colour: overrides.primaryBackground,
|
|
34
|
+
isDarkTheme: false,
|
|
35
|
+
direction: themeMode === 'light' ? 'forward' : 'backward',
|
|
36
|
+
intensity: 0.1
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return assignInlineVars(themeContractVars, {
|
|
40
|
+
colours: {
|
|
41
|
+
intent: {
|
|
42
|
+
primary: {
|
|
43
|
+
background: {
|
|
44
|
+
standard: (_overrides$primaryBac = overrides.primaryBackground) !== null && _overrides$primaryBac !== void 0 ? _overrides$primaryBac : undefined,
|
|
45
|
+
mild: (_mildPrimary = mildPrimary) !== null && _mildPrimary !== void 0 ? _mildPrimary : undefined,
|
|
46
|
+
strong: (_strongPrimary = strongPrimary) !== null && _strongPrimary !== void 0 ? _strongPrimary : undefined
|
|
47
|
+
},
|
|
48
|
+
foreground: (_overrides$primaryFor = overrides.primaryForeground) !== null && _overrides$primaryFor !== void 0 ? _overrides$primaryFor : undefined,
|
|
49
|
+
border: (_overrides$primaryBor = overrides.primaryBorder) !== null && _overrides$primaryBor !== void 0 ? _overrides$primaryBor : undefined
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
typography: {
|
|
54
|
+
colour: {
|
|
55
|
+
primary: (_overrides$primaryBac2 = overrides.primaryBackground) !== null && _overrides$primaryBac2 !== void 0 ? _overrides$primaryBac2 : undefined
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}, [overrides, themeMode]);
|
|
60
|
+
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
children?: ReactNode;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface PortalProps {
|
|
3
|
+
children?: React.ReactNode;
|
|
5
4
|
container?: HTMLElement;
|
|
6
5
|
noThemedWrapper?: boolean;
|
|
7
6
|
}
|
|
8
|
-
declare function Portal({ children, container, noThemedWrapper }:
|
|
9
|
-
declare const _Portal: React.ForwardRefExoticComponent<
|
|
7
|
+
declare function Portal({ children, container, noThemedWrapper }: PortalProps, ref: React.Ref<typeof container>): React.ReactPortal | null;
|
|
8
|
+
declare const _Portal: React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<HTMLElement | undefined>>;
|
|
10
9
|
export { _Portal as Portal };
|
|
11
10
|
export default Portal;
|
|
12
11
|
//# sourceMappingURL=Portal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../../lib/components/Portal/Portal.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../../lib/components/Portal/Portal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAMhF,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B;AAID,iBAAS,MAAM,CACd,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,WAAW,EACrD,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,SAAS,CAAC,4BA4ChC;AAED,QAAA,MAAM,OAAO,6FAAqB,CAAC;AACnC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAC;AAE7B,eAAe,MAAM,CAAC"}
|