@optiaxiom/react 0.1.0-next.5 → 0.1.0-next.7
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/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-DJjt3whH.css} +40 -37
- package/dist/assets/src/button-group/ButtonGroup.css.ts.vanilla-4BGjgIuZ.css +4 -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-Cj5eURGG.css} +2308 -1652
- package/dist/assets/src/styles/{theme.css.ts.vanilla-Cb0QJvUK.css → theme.css.ts.vanilla-BftJbjRk.css} +28 -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 +4 -6
- package/dist/avatar/Avatar.js +2 -3
- package/dist/box/Box-css.js +4 -3
- package/dist/box/Box.js +2 -2
- package/dist/button/Button-css.js +7 -5
- package/dist/button/Button.js +41 -28
- package/dist/button-group/ButtonGroup-css.js +7 -0
- package/dist/button-group/ButtonGroup.js +24 -0
- package/dist/code/Code-css.js +3 -2
- package/dist/code/Code.js +2 -3
- package/dist/index.d.ts +326 -375
- package/dist/index.js +4 -0
- package/dist/input/Input-css.js +5 -5
- package/dist/input/Input.js +2 -3
- package/dist/kbd/Kbd-css.js +4 -3
- package/dist/kbd/Kbd.js +3 -4
- package/dist/progress/Progress.js +18 -16
- package/dist/separator/Separator-css.js +4 -4
- package/dist/separator/Separator.js +1 -5
- package/dist/skeleton/Skeleton-css.js +3 -2
- package/dist/skeleton/Skeleton.js +2 -3
- package/dist/sprinkles/sprinkles-css.js +3 -3
- package/dist/styles/theme-css.js +2 -2
- package/dist/text/Text-css.js +4 -4
- package/dist/text/Text.js +3 -8
- package/dist/tokens/borderRadius.js +1 -1
- package/dist/tokens/spacing.js +6 -0
- package/dist/tokens/zIndex.js +2 -1
- package/dist/tooltip/Tooltip.js +16 -5
- package/dist/transition/Transition-css.js +5 -4
- package/dist/transition/Transition.js +9 -19
- package/dist/vanilla-extract/recipeRuntime.js +51 -0
- package/package.json +1 -2
- package/dist/assets/src/avatar/Avatar.css.ts.vanilla-DdarHYxU.css +0 -11
- package/dist/assets/src/input/Input.css.ts.vanilla-CucST5E4.css +0 -67
package/dist/text/Text-css.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './../assets/src/styles/layers.css.ts.vanilla-D5zCXZwe.css';
|
|
2
|
-
import './../assets/src/text/Text.css.ts.vanilla-
|
|
2
|
+
import './../assets/src/text/Text.css.ts.vanilla-DK_dMlGe.css';
|
|
3
|
+
import { recipeRuntime } from '../vanilla-extract/recipeRuntime.js';
|
|
3
4
|
|
|
4
|
-
var
|
|
5
|
-
var truncate = '_13y7bdy6 _13y7bdy0';
|
|
5
|
+
var text = recipeRuntime((function(){var x={variants:{lineClamp:{'1':[{overflow:'hidden'},'_13y7bdy0','_13y7bdy1','_13y7bdy2'],'2':[undefined,'_13y7bdy0','_13y7bdy1','_13y7bdy3'],'3':[undefined,'_13y7bdy0','_13y7bdy1','_13y7bdy4'],'4':[undefined,'_13y7bdy0','_13y7bdy1','_13y7bdy5']},truncate:{true:[undefined,'_13y7bdy0',{whiteSpace:'nowrap'}]}}};x.variants.lineClamp['2'][0]=x.variants.lineClamp['1'][0];x.variants.lineClamp['3'][0]=x.variants.lineClamp['1'][0];x.variants.lineClamp['4'][0]=x.variants.lineClamp['1'][0];x.variants.truncate.true[0]=x.variants.lineClamp['1'][0];return x;}()));
|
|
6
6
|
|
|
7
|
-
export {
|
|
7
|
+
export { text };
|
package/dist/text/Text.js
CHANGED
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
3
|
import { forwardRef } from 'react';
|
|
5
4
|
import { Box } from '../box/Box.js';
|
|
6
|
-
import {
|
|
5
|
+
import { text } from './Text-css.js';
|
|
7
6
|
|
|
8
7
|
const Text = forwardRef(
|
|
9
|
-
({ as = "p", asChild, children, className, lineClamp
|
|
8
|
+
({ as = "p", asChild, children, className, lineClamp, truncate, ...props }, ref) => {
|
|
10
9
|
const Comp = asChild ? Slot : as;
|
|
11
10
|
return /* @__PURE__ */ jsx(
|
|
12
11
|
Box,
|
|
13
12
|
{
|
|
14
13
|
asChild: true,
|
|
15
|
-
className: clsx(
|
|
16
|
-
lineClamp$1 && lineClamp[lineClamp$1],
|
|
17
|
-
truncate$1 && truncate,
|
|
18
|
-
className
|
|
19
|
-
),
|
|
20
14
|
fontSize: "md",
|
|
21
15
|
ref,
|
|
16
|
+
...text({ lineClamp, truncate }, className),
|
|
22
17
|
...props,
|
|
23
18
|
children: /* @__PURE__ */ jsx(Comp, { children })
|
|
24
19
|
}
|
package/dist/tokens/spacing.js
CHANGED
|
@@ -7,11 +7,17 @@ const spacing = {
|
|
|
7
7
|
lg: rem("24px"),
|
|
8
8
|
xl: rem("32px"),
|
|
9
9
|
"0": "0",
|
|
10
|
+
"1": rem("1px"),
|
|
10
11
|
"2": rem("2px"),
|
|
12
|
+
"3": rem("3px"),
|
|
11
13
|
"4": rem("4px"),
|
|
14
|
+
"5": rem("5px"),
|
|
12
15
|
"6": rem("6px"),
|
|
16
|
+
"7": rem("7px"),
|
|
13
17
|
"8": rem("8px"),
|
|
18
|
+
"9": rem("9px"),
|
|
14
19
|
"10": rem("10px"),
|
|
20
|
+
"11": rem("11px"),
|
|
15
21
|
"12": rem("12px"),
|
|
16
22
|
"16": rem("16px"),
|
|
17
23
|
"20": rem("20px"),
|
package/dist/tokens/zIndex.js
CHANGED
package/dist/tooltip/Tooltip.js
CHANGED
|
@@ -8,14 +8,25 @@ import { Text } from '../text/Text.js';
|
|
|
8
8
|
import { Transition } from '../transition/Transition.js';
|
|
9
9
|
|
|
10
10
|
const Tooltip = forwardRef(
|
|
11
|
-
({ children, content, delayDuration, withArrow, ...props }, ref) => {
|
|
11
|
+
({ children, content, delayDuration, withArrow, z = "popover", ...props }, ref) => {
|
|
12
12
|
const [open, setOpen] = useState(false);
|
|
13
13
|
return /* @__PURE__ */ jsx(RadixTooltip.Provider, { delayDuration, children: /* @__PURE__ */ jsxs(RadixTooltip.Root, { onOpenChange: setOpen, open, children: [
|
|
14
14
|
/* @__PURE__ */ jsx(RadixTooltip.Trigger, { asChild: true, ref, children }),
|
|
15
|
-
/* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsx(RadixTooltip.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(Transition, { type: "pop", children: /* @__PURE__ */ jsx(RadixTooltip.Content, { asChild: true, sideOffset: 5, ...props, children: /* @__PURE__ */ jsxs(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsx(RadixTooltip.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(Transition, { type: "pop", children: /* @__PURE__ */ jsx(RadixTooltip.Content, { asChild: true, sideOffset: 5, ...props, children: /* @__PURE__ */ jsxs(
|
|
16
|
+
Box,
|
|
17
|
+
{
|
|
18
|
+
bg: "dark.600",
|
|
19
|
+
color: "white",
|
|
20
|
+
px: "6",
|
|
21
|
+
py: "4",
|
|
22
|
+
rounded: "sm",
|
|
23
|
+
z,
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ jsx(Text, { fontSize: "sm", children: content }),
|
|
26
|
+
withArrow && /* @__PURE__ */ jsx(RadixTooltip.Arrow, {})
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
) }) }) }) })
|
|
19
30
|
] }) });
|
|
20
31
|
}
|
|
21
32
|
);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import './../assets/src/styles/layers.css.ts.vanilla-D5zCXZwe.css';
|
|
2
|
-
import './../assets/src/transition/Transition.css.ts.vanilla-
|
|
2
|
+
import './../assets/src/transition/Transition.css.ts.vanilla-COX8x_Bo.css';
|
|
3
|
+
import { recipeRuntime } from '../vanilla-extract/recipeRuntime.js';
|
|
3
4
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
5
|
+
var transition = recipeRuntime({base:'_1p67mhc0',variants:{duration:{sm:'_1p67mhc1',md:'_1p67mhc2',lg:'_1p67mhc3'},type:{fade:'_1p67mhc4','fade-down':'_1p67mhc5','fade-left':'_1p67mhc6','fade-right':'_1p67mhc7','fade-up':'_1p67mhc8',pop:'_1p67mhc9','pop-down':'_1p67mhca','pop-left':'_1p67mhcb','pop-right':'_1p67mhcc','pop-up':'_1p67mhcd'}}});
|
|
6
|
+
var transitionDuration = {sm:250,md:400,lg:550};
|
|
6
7
|
|
|
7
|
-
export {
|
|
8
|
+
export { transition, transitionDuration };
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
2
|
import { forwardRef, useState, useEffect } from 'react';
|
|
5
3
|
import '../animate-presence/PresenceContext.js';
|
|
6
4
|
import { usePresence } from '../animate-presence/usePresence.js';
|
|
7
|
-
import {
|
|
5
|
+
import { Box } from '../box/Box.js';
|
|
6
|
+
import { transitionDuration, transition } from './Transition-css.js';
|
|
8
7
|
|
|
9
|
-
const transitionDuration = {
|
|
10
|
-
sm: 250,
|
|
11
|
-
md: 400,
|
|
12
|
-
lg: 550
|
|
13
|
-
};
|
|
14
8
|
const Transition = forwardRef(
|
|
15
|
-
({ children, className, duration = "sm",
|
|
9
|
+
({ children, className, duration = "sm", type = "fade", ...props }, ref) => {
|
|
16
10
|
const [isPresent, safeToRemove] = usePresence();
|
|
17
11
|
const [enter, setEnter] = useState(false);
|
|
18
12
|
useEffect(() => {
|
|
@@ -22,18 +16,14 @@ const Transition = forwardRef(
|
|
|
22
16
|
!isPresent && setTimeout(safeToRemove, transitionDuration[duration]);
|
|
23
17
|
}, [isPresent]);
|
|
24
18
|
return /* @__PURE__ */ jsx(
|
|
25
|
-
|
|
19
|
+
Box,
|
|
26
20
|
{
|
|
27
|
-
|
|
28
|
-
className,
|
|
29
|
-
base,
|
|
30
|
-
enter !== isPresent && transitions[type]
|
|
31
|
-
),
|
|
21
|
+
asChild: true,
|
|
32
22
|
ref,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
...transition(
|
|
24
|
+
{ duration, type: enter !== isPresent ? type : void 0 },
|
|
25
|
+
className
|
|
26
|
+
),
|
|
37
27
|
...props,
|
|
38
28
|
children
|
|
39
29
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const recipeRuntime = ({
|
|
2
|
+
base = {},
|
|
3
|
+
variants,
|
|
4
|
+
variantsCompounded = []
|
|
5
|
+
}) => {
|
|
6
|
+
return (options, className) => {
|
|
7
|
+
const selections = options ?? {};
|
|
8
|
+
const classNames = className ? [className] : [];
|
|
9
|
+
const sprinkleProps = {};
|
|
10
|
+
function process(rule) {
|
|
11
|
+
for (const item of Array.isArray(rule) ? rule : [rule]) {
|
|
12
|
+
if (typeof item === "string") {
|
|
13
|
+
classNames.push(item);
|
|
14
|
+
} else {
|
|
15
|
+
for (const [name, value] of Object.entries(item)) {
|
|
16
|
+
sprinkleProps[name] = value;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
process(base);
|
|
22
|
+
for (const variantName in variants) {
|
|
23
|
+
if (!selections[variantName]) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
const variant = variants[variantName];
|
|
27
|
+
const selection = typeof selections[variantName] === "boolean" ? selections[variantName] ? "true" : "false" : selections[variantName];
|
|
28
|
+
process(variant[selection]);
|
|
29
|
+
}
|
|
30
|
+
for (const { style, variants: variants2 } of variantsCompounded) {
|
|
31
|
+
if (!shouldApplyCompound(variants2, selections)) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
process(style);
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
...sprinkleProps,
|
|
38
|
+
className: classNames.join(" ")
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
const shouldApplyCompound = (compoundCheck, selections) => {
|
|
43
|
+
for (const key of Object.keys(compoundCheck)) {
|
|
44
|
+
if (compoundCheck[key] !== selections[key]) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return true;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export { recipeRuntime };
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://github.com/optimizely-axiom/optiaxiom.git"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
|
-
"version": "0.1.0-next.
|
|
9
|
+
"version": "0.1.0-next.7",
|
|
10
10
|
"files": [
|
|
11
11
|
"dist/**",
|
|
12
12
|
"LICENSE"
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"@radix-ui/react-slot": "^1.0.2",
|
|
29
29
|
"@radix-ui/react-tooltip": "^1.0.7",
|
|
30
30
|
"@reach/auto-id": "^0.18.0",
|
|
31
|
-
"@vanilla-extract/recipes": "^0.5.3",
|
|
32
31
|
"@vanilla-extract/sprinkles": "^1.6.2",
|
|
33
32
|
"clsx": "^2.1.1",
|
|
34
33
|
"inter-ui": "^4.0.2"
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
@layer optiaxiom._1kfj4ga1;
|
|
2
|
-
@layer optiaxiom._1kfj4ga1 {
|
|
3
|
-
._5j10wf0 {
|
|
4
|
-
align-items: center;
|
|
5
|
-
border: 1px;
|
|
6
|
-
border-color: var(--ax-colors-border-default);
|
|
7
|
-
border-radius: var(--ax-borderRadius-sm);
|
|
8
|
-
border-style: solid;
|
|
9
|
-
color: var(--ax-colors-fg-default);
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: row;
|
|
12
|
-
}
|
|
13
|
-
._5j10wf0:focus-within:is([data-invalid="true"]) {
|
|
14
|
-
outline-color: var(--ax-colors-red-200);
|
|
15
|
-
outline-offset: 1px;
|
|
16
|
-
outline-style: solid;
|
|
17
|
-
outline-width: 2px;
|
|
18
|
-
}
|
|
19
|
-
._5j10wf0:focus-within:not([data-invalid="true"]) {
|
|
20
|
-
outline-color: var(--ax-colors-brand-200);
|
|
21
|
-
outline-offset: 1px;
|
|
22
|
-
outline-style: solid;
|
|
23
|
-
outline-width: 2px;
|
|
24
|
-
}
|
|
25
|
-
._5j10wf0:hover {
|
|
26
|
-
border-color: var(--ax-colors-border-brand);
|
|
27
|
-
}
|
|
28
|
-
._5j10wf0[data-disabled="true"] {
|
|
29
|
-
background-color: var(--ax-colors-bg-disabled);
|
|
30
|
-
border-color: var(--ax-colors-border-secondary);
|
|
31
|
-
pointer-events: none;
|
|
32
|
-
}
|
|
33
|
-
._5j10wf0[data-invalid="true"] {
|
|
34
|
-
border-color: var(--ax-colors-border-error);
|
|
35
|
-
}
|
|
36
|
-
._5j10wf1 {
|
|
37
|
-
font-size: var(--ax-fontSize-sm-fontSize);
|
|
38
|
-
height: 24px;
|
|
39
|
-
line-height: var(--ax-fontSize-sm-lineHeight);
|
|
40
|
-
padding: 8px 8px;
|
|
41
|
-
}
|
|
42
|
-
._5j10wf2 {
|
|
43
|
-
font-size: var(--ax-fontSize-md-fontSize);
|
|
44
|
-
height: 32px;
|
|
45
|
-
line-height: var(--ax-fontSize-md-lineHeight);
|
|
46
|
-
padding: 8px 8px;
|
|
47
|
-
}
|
|
48
|
-
._5j10wf3 {
|
|
49
|
-
font-size: var(--ax-fontSize-lg-fontSize);
|
|
50
|
-
height: 40px;
|
|
51
|
-
line-height: var(--ax-fontSize-lg-lineHeight);
|
|
52
|
-
padding: 4px 8px;
|
|
53
|
-
}
|
|
54
|
-
._5j10wf6 {
|
|
55
|
-
background: var(--ax-colors-transparent);
|
|
56
|
-
width: 100%;
|
|
57
|
-
}
|
|
58
|
-
._5j10wf6:focus-visible {
|
|
59
|
-
outline-width: 0px;
|
|
60
|
-
}
|
|
61
|
-
._5j10wf7 {
|
|
62
|
-
text-align: start;
|
|
63
|
-
}
|
|
64
|
-
._5j10wf8 {
|
|
65
|
-
text-align: end;
|
|
66
|
-
}
|
|
67
|
-
}
|