@optiaxiom/react 0.1.0-next.4 → 0.1.0-next.6
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/animate-presence/AnimatePresence.js +36 -0
- package/dist/animate-presence/PresenceContext.js +11 -0
- package/dist/animate-presence/usePresence.js +13 -0
- package/dist/assets/src/avatar/Avatar.css.ts.vanilla-CihLlW6Z.css +6 -0
- package/dist/assets/src/button/{Button.css.ts.vanilla-VaFYcYGO.css → Button.css.ts.vanilla-CAppQRyC.css} +10 -37
- package/dist/assets/src/button-group/ButtonGroup.css.ts.vanilla-xsXT6MRu.css +28 -0
- package/dist/assets/src/input/Input.css.ts.vanilla-X0R-SsOp.css +32 -0
- package/dist/assets/src/separator/{Separator.css.ts.vanilla-DYzKo87M.css → Separator.css.ts.vanilla-C_EYtori.css} +8 -14
- package/dist/assets/src/sprinkles/{sprinkles.css.ts.vanilla-NXW-pecy.css → sprinkles.css.ts.vanilla-CDl96MYc.css} +1659 -1651
- package/dist/assets/src/styles/layers.css.ts.vanilla-D5zCXZwe.css +4 -0
- package/dist/assets/src/styles/{theme.css.ts.vanilla-Cb0QJvUK.css → theme.css.ts.vanilla-0B4GnT52.css} +4 -2
- package/dist/assets/src/text/{Text.css.ts.vanilla-BtaUGYv3.css → Text.css.ts.vanilla-DK_dMlGe.css} +0 -4
- package/dist/assets/src/transition/{Transition.css.ts.vanilla-qjeQECVe.css → Transition.css.ts.vanilla-COX8x_Bo.css} +18 -9
- package/dist/avatar/Avatar-css.js +5 -7
- package/dist/avatar/Avatar.js +2 -3
- package/dist/box/Box-css.js +5 -4
- package/dist/box/Box.js +2 -2
- package/dist/button/Button-css.js +5 -5
- package/dist/button/Button.js +9 -19
- package/dist/button-group/ButtonGroup-css.js +7 -0
- package/dist/button-group/ButtonGroup.js +54 -0
- package/dist/code/Code-css.js +4 -3
- package/dist/code/Code.js +2 -3
- package/dist/field/Field.js +41 -0
- package/dist/index.d.ts +304 -371
- package/dist/index.js +5 -0
- package/dist/input/Input-css.js +6 -6
- package/dist/input/Input.js +2 -3
- package/dist/kbd/Kbd-css.js +5 -4
- package/dist/kbd/Kbd.js +3 -4
- package/dist/progress/Progress.js +18 -16
- package/dist/separator/Separator-css.js +5 -5
- package/dist/separator/Separator.js +1 -5
- package/dist/skeleton/Skeleton-css.js +4 -3
- package/dist/skeleton/Skeleton.js +2 -3
- package/dist/sprinkles/sprinkles-css.js +4 -4
- package/dist/styles/layers-css.js +3 -2
- package/dist/styles/theme-css.js +2 -2
- package/dist/text/Text-css.js +5 -5
- package/dist/text/Text.js +3 -8
- package/dist/tokens/borderRadius.js +1 -1
- package/dist/tokens/zIndex.js +2 -1
- package/dist/tooltip/Tooltip.js +18 -6
- package/dist/transition/Transition-css.js +6 -5
- package/dist/transition/Transition.js +11 -20
- package/dist/vanilla-extract/recipeRuntime.js +51 -0
- package/package.json +4 -5
- package/dist/assets/src/avatar/Avatar.css.ts.vanilla-DdarHYxU.css +0 -11
- package/dist/assets/src/input/Input.css.ts.vanilla-CICpzaz6.css +0 -68
- package/dist/assets/src/styles/layers.css.ts.vanilla-D6EvK_O8.css +0 -3
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
3
|
+
import { PresenceContext } from './PresenceContext.js';
|
|
4
|
+
|
|
5
|
+
const AnimatePresence = ({
|
|
6
|
+
children
|
|
7
|
+
}) => {
|
|
8
|
+
const [exiting, setExiting] = useState(
|
|
9
|
+
/* @__PURE__ */ new Map()
|
|
10
|
+
);
|
|
11
|
+
const lastChildren = useRef(children);
|
|
12
|
+
if (children) {
|
|
13
|
+
lastChildren.current = children;
|
|
14
|
+
}
|
|
15
|
+
const isPresent = !!children;
|
|
16
|
+
const onExitComplete = useCallback((id) => {
|
|
17
|
+
setExiting((state) => {
|
|
18
|
+
state.delete(id);
|
|
19
|
+
return new Map(state.entries());
|
|
20
|
+
});
|
|
21
|
+
}, []);
|
|
22
|
+
const register = useCallback((id) => {
|
|
23
|
+
setExiting((state) => {
|
|
24
|
+
state.set(id, true);
|
|
25
|
+
return new Map(state.entries());
|
|
26
|
+
});
|
|
27
|
+
}, []);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!isPresent && [...exiting.values()].some(Boolean)) {
|
|
30
|
+
lastChildren.current = false;
|
|
31
|
+
}
|
|
32
|
+
}, [exiting, isPresent]);
|
|
33
|
+
return /* @__PURE__ */ jsx(PresenceContext.Provider, { value: { isPresent, onExitComplete, register }, children: children || ([...exiting.values()].some(Boolean) ? lastChildren.current : null) });
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { AnimatePresence };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useContext, useRef, useEffect } from 'react';
|
|
2
|
+
import { PresenceContext } from './PresenceContext.js';
|
|
3
|
+
|
|
4
|
+
const usePresence = () => {
|
|
5
|
+
const { isPresent, onExitComplete, register } = useContext(PresenceContext);
|
|
6
|
+
const id = useRef();
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
return register(id);
|
|
9
|
+
}, [id, register]);
|
|
10
|
+
return !isPresent ? [false, () => onExitComplete(id)] : [true];
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { usePresence };
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
@layer optiaxiom._1kfj4ga1;
|
|
2
2
|
@layer optiaxiom._1kfj4ga1 {
|
|
3
3
|
._1gqmi2d3 {
|
|
4
|
-
align-items: center;
|
|
5
|
-
border: 0;
|
|
6
4
|
border-radius: var(--ax-borderRadius-sm);
|
|
7
5
|
cursor: pointer;
|
|
8
|
-
display: inline-flex;
|
|
9
|
-
flex-direction: row;
|
|
10
|
-
gap: var(--ax-spacing-xs);
|
|
11
|
-
justify-content: center;
|
|
12
|
-
overflow: hidden;
|
|
13
6
|
position: relative;
|
|
14
|
-
|
|
15
|
-
transition-property: background-color, border-color, color;
|
|
16
|
-
transition-timing-function: ease;
|
|
7
|
+
text-decoration: none;
|
|
17
8
|
}
|
|
18
9
|
._1gqmi2d3:active:not([data-disabled="true"]) {
|
|
19
10
|
box-shadow: var(--ax-boxShadow-inner);
|
|
@@ -51,59 +42,41 @@
|
|
|
51
42
|
outline-color: var(--ax-colors-neutral-500);
|
|
52
43
|
}
|
|
53
44
|
._1gqmi2d7 {
|
|
54
|
-
font-size: var(--ax-fontSize-sm-fontSize);
|
|
55
|
-
height: 24px;
|
|
56
|
-
line-height: var(--ax-fontSize-sm-lineHeight);
|
|
57
|
-
padding-inline: 10px;
|
|
58
|
-
}
|
|
59
|
-
._1gqmi2d8 {
|
|
60
|
-
font-size: var(--ax-fontSize-md-fontSize);
|
|
61
|
-
height: 32px;
|
|
62
|
-
line-height: var(--ax-fontSize-md-lineHeight);
|
|
63
|
-
padding-inline: 12px;
|
|
64
|
-
}
|
|
65
|
-
._1gqmi2d9 {
|
|
66
|
-
font-size: var(--ax-fontSize-lg-fontSize);
|
|
67
|
-
height: 40px;
|
|
68
|
-
line-height: var(--ax-fontSize-lg-lineHeight);
|
|
69
|
-
padding-inline: 16px;
|
|
70
|
-
}
|
|
71
|
-
._1gqmi2da {
|
|
72
45
|
background-color: transparent;
|
|
73
46
|
color: var(--_1gqmi2d0);
|
|
74
47
|
}
|
|
75
|
-
.
|
|
48
|
+
._1gqmi2d7:hover:not([data-disabled="true"]) {
|
|
76
49
|
background-color: var(--_1gqmi2d2);
|
|
77
50
|
}
|
|
78
|
-
.
|
|
51
|
+
._1gqmi2d7[data-disabled="true"] {
|
|
79
52
|
background-color: var(--ax-colors-bg-disabled);
|
|
80
53
|
color: var(--ax-colors-fg-disabled);
|
|
81
54
|
}
|
|
82
|
-
.
|
|
55
|
+
._1gqmi2d8 {
|
|
83
56
|
background-color: transparent;
|
|
84
57
|
border: 1px solid var(--_1gqmi2d0);
|
|
85
58
|
color: var(--_1gqmi2d0);
|
|
86
59
|
}
|
|
87
|
-
.
|
|
60
|
+
._1gqmi2d8:hover:not([data-disabled="true"]) {
|
|
88
61
|
background-color: var(--_1gqmi2d2);
|
|
89
62
|
}
|
|
90
|
-
.
|
|
63
|
+
._1gqmi2d8[data-disabled="true"] {
|
|
91
64
|
border-color: var(--ax-colors-border-disabled);
|
|
92
65
|
color: var(--ax-colors-fg-disabled);
|
|
93
66
|
}
|
|
94
|
-
.
|
|
67
|
+
._1gqmi2d9 {
|
|
95
68
|
background-color: var(--_1gqmi2d0);
|
|
96
69
|
color: var(--ax-colors-fg-default-inverse);
|
|
97
70
|
}
|
|
98
|
-
.
|
|
71
|
+
._1gqmi2d9:hover:not([data-disabled="true"]) {
|
|
99
72
|
background-color: var(--_1gqmi2d1);
|
|
100
73
|
}
|
|
101
|
-
.
|
|
74
|
+
._1gqmi2d9[data-disabled="true"] {
|
|
102
75
|
background-color: var(--ax-colors-bg-disabled);
|
|
103
76
|
border: 1px solid var(--ax-colors-border-disabled);
|
|
104
77
|
color: var(--ax-colors-fg-disabled);
|
|
105
78
|
}
|
|
106
|
-
.
|
|
79
|
+
._1gqmi2da {
|
|
107
80
|
border-color: var(--ax-colors-border-default);
|
|
108
81
|
}
|
|
109
82
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@layer optiaxiom._1kfj4ga1;
|
|
2
|
+
@layer optiaxiom._1kfj4ga1 {
|
|
3
|
+
._1sewcgl0:not(:first-child):not(:last-child) {
|
|
4
|
+
border-radius: 0;
|
|
5
|
+
}
|
|
6
|
+
._1sewcgl1:first-child {
|
|
7
|
+
border-bottom-right-radius: 0;
|
|
8
|
+
border-top-right-radius: 0;
|
|
9
|
+
}
|
|
10
|
+
._1sewcgl1:last-child {
|
|
11
|
+
border-bottom-left-radius: 0;
|
|
12
|
+
border-top-left-radius: 0;
|
|
13
|
+
}
|
|
14
|
+
._1sewcgl2:first-child {
|
|
15
|
+
border-bottom-left-radius: 0;
|
|
16
|
+
border-bottom-right-radius: 0;
|
|
17
|
+
}
|
|
18
|
+
._1sewcgl2:last-child {
|
|
19
|
+
border-top-left-radius: 0;
|
|
20
|
+
border-top-right-radius: 0;
|
|
21
|
+
}
|
|
22
|
+
._1sewcgl3:not(:first-child) {
|
|
23
|
+
border-left: none;
|
|
24
|
+
}
|
|
25
|
+
._1sewcgl4:not(:first-child) {
|
|
26
|
+
border-top: none;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
@layer optiaxiom._1kfj4ga1;
|
|
2
|
+
@layer optiaxiom._1kfj4ga1 {
|
|
3
|
+
._5j10wf0 {
|
|
4
|
+
border-color: var(--ax-colors-border-default);
|
|
5
|
+
}
|
|
6
|
+
._5j10wf0:focus-within:is([data-invalid="true"]) {
|
|
7
|
+
outline-color: var(--ax-colors-red-200);
|
|
8
|
+
outline-offset: 1px;
|
|
9
|
+
outline-style: solid;
|
|
10
|
+
outline-width: 2px;
|
|
11
|
+
}
|
|
12
|
+
._5j10wf0:focus-within:not([data-invalid="true"]) {
|
|
13
|
+
outline-color: var(--ax-colors-brand-200);
|
|
14
|
+
outline-offset: 1px;
|
|
15
|
+
outline-style: solid;
|
|
16
|
+
outline-width: 2px;
|
|
17
|
+
}
|
|
18
|
+
._5j10wf0:hover {
|
|
19
|
+
border-color: var(--ax-colors-border-brand);
|
|
20
|
+
}
|
|
21
|
+
._5j10wf0[data-disabled="true"] {
|
|
22
|
+
background-color: var(--ax-colors-bg-disabled);
|
|
23
|
+
border-color: var(--ax-colors-border-secondary);
|
|
24
|
+
pointer-events: none;
|
|
25
|
+
}
|
|
26
|
+
._5j10wf0[data-invalid="true"] {
|
|
27
|
+
border-color: var(--ax-colors-border-error);
|
|
28
|
+
}
|
|
29
|
+
._5j10wf1:focus-visible {
|
|
30
|
+
outline-width: 0px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1,46 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
.tlk8154 {
|
|
1
|
+
.tlk8153 {
|
|
3
2
|
height: 1px;
|
|
4
3
|
width: auto;
|
|
5
4
|
}
|
|
6
|
-
.
|
|
5
|
+
.tlk8157 {
|
|
7
6
|
align-self: stretch;
|
|
8
7
|
height: auto;
|
|
9
8
|
width: 1px;
|
|
10
9
|
}
|
|
11
|
-
@layer optiaxiom._1kfj4ga1 {
|
|
12
|
-
.tlk8150 {
|
|
13
|
-
background-color: var(--ax-colors-border-default);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
10
|
@media screen and (min-width: 37.5rem) {
|
|
17
|
-
.
|
|
11
|
+
.tlk8150 {
|
|
18
12
|
height: 1px;
|
|
19
13
|
width: auto;
|
|
20
14
|
}
|
|
21
|
-
.
|
|
15
|
+
.tlk8154 {
|
|
22
16
|
align-self: stretch;
|
|
23
17
|
height: auto;
|
|
24
18
|
width: 1px;
|
|
25
19
|
}
|
|
26
20
|
}
|
|
27
21
|
@media screen and (min-width: 56.25rem) {
|
|
28
|
-
.
|
|
22
|
+
.tlk8151 {
|
|
29
23
|
height: 1px;
|
|
30
24
|
width: auto;
|
|
31
25
|
}
|
|
32
|
-
.
|
|
26
|
+
.tlk8155 {
|
|
33
27
|
align-self: stretch;
|
|
34
28
|
height: auto;
|
|
35
29
|
width: 1px;
|
|
36
30
|
}
|
|
37
31
|
}
|
|
38
32
|
@media screen and (min-width: 75rem) {
|
|
39
|
-
.
|
|
33
|
+
.tlk8152 {
|
|
40
34
|
height: 1px;
|
|
41
35
|
width: auto;
|
|
42
36
|
}
|
|
43
|
-
.
|
|
37
|
+
.tlk8156 {
|
|
44
38
|
align-self: stretch;
|
|
45
39
|
height: auto;
|
|
46
40
|
width: 1px;
|