@optiaxiom/react 0.1.0-next.7 → 0.1.0-next.8

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.
@@ -5,6 +5,7 @@
5
5
  cursor: pointer;
6
6
  position: relative;
7
7
  text-decoration: none;
8
+ user-select: none;
8
9
  }
9
10
  ._1gqmi2d3:active:not([data-disabled="true"]) {
10
11
  box-shadow: var(--ax-boxShadow-inner);
@@ -12,7 +13,7 @@
12
13
  ._1gqmi2d3:focus-visible {
13
14
  outline-offset: 1px;
14
15
  outline-style: solid;
15
- outline-width: 1px;
16
+ outline-width: 2px;
16
17
  }
17
18
  ._1gqmi2d3[data-disabled="true"] {
18
19
  cursor: not-allowed;
@@ -52,7 +53,7 @@
52
53
  --_1gqmi2d2: var(--ax-colors-bg-error-subtle);
53
54
  }
54
55
  ._1gqmi2d4:focus-visible {
55
- outline-color: red.200;
56
+ outline-color: var(--ax-colors-red-200);
56
57
  }
57
58
  ._1gqmi2d5 {
58
59
  --_1gqmi2d0: var(--ax-colors-bg-brand-solid);
@@ -1,10 +1,10 @@
1
1
  import './../assets/src/styles/layers.css.ts.vanilla-D5zCXZwe.css';
2
2
  import './../assets/src/styles/theme.css.ts.vanilla-BftJbjRk.css';
3
3
  import './../assets/src/button-group/ButtonGroup.css.ts.vanilla-4BGjgIuZ.css';
4
- import './../assets/src/button/Button.css.ts.vanilla-DJjt3whH.css';
4
+ import './../assets/src/button/Button.css.ts.vanilla-BopXGX13.css';
5
5
  import { recipeRuntime } from '../vanilla-extract/recipeRuntime.js';
6
6
 
7
7
  var button = recipeRuntime({base:[{alignItems:'center',display:'inline-flex',flexDirection:'row',gap:'4',justifyContent:'center',overflow:'hidden',transition:'colors'},'_1gqmi2d3'],variants:{colorScheme:{danger:'_1gqmi2d4',primary:'_1gqmi2d5',secondary:'_1gqmi2d6'},disabled:{false:{},true:{}},iconOnly:{false:{},true:{}},size:{sm:{fontSize:'sm',h:'sm'},md:{fontSize:'md',h:'md'},lg:{fontSize:'lg',h:'lg'}},variant:{ghost:'_1gqmi2d7',outline:'_1gqmi2d8',solid:'_1gqmi2d9'}},variantsCompounded:[{style:'_1gqmi2da',variants:{colorScheme:'secondary',variant:'outline'}},{style:{px:'2'},variants:{iconOnly:true,size:'sm'}},{style:{px:'4'},variants:{iconOnly:false,size:'sm'}},{style:{px:'1'},variants:{iconOnly:true,size:'sm',variant:'outline'}},{style:{px:'1'},variants:{disabled:true,iconOnly:true,size:'sm',variant:'solid'}},{style:{px:'3'},variants:{iconOnly:false,size:'sm',variant:'outline'}},{style:{px:'3'},variants:{disabled:true,iconOnly:false,size:'sm',variant:'solid'}},{style:{px:'6'},variants:{iconOnly:true,size:'md'}},{style:{px:'8'},variants:{iconOnly:false,size:'md'}},{style:{px:'5'},variants:{iconOnly:true,size:'md',variant:'outline'}},{style:{px:'5'},variants:{disabled:true,iconOnly:true,size:'md',variant:'solid'}},{style:{px:'7'},variants:{iconOnly:false,size:'md',variant:'outline'}},{style:{px:'7'},variants:{disabled:true,iconOnly:false,size:'md',variant:'solid'}},{style:{px:'10'},variants:{iconOnly:true,size:'lg'}},{style:{px:'12'},variants:{iconOnly:false,size:'lg'}},{style:{px:'9'},variants:{iconOnly:true,size:'lg',variant:'outline'}},{style:{px:'9'},variants:{disabled:true,iconOnly:true,size:'lg',variant:'solid'}},{style:{px:'11'},variants:{iconOnly:false,size:'lg',variant:'outline'}},{style:{px:'11'},variants:{disabled:true,iconOnly:false,size:'lg',variant:'solid'}}]});
8
- var section = recipeRuntime({variants:{position:{end:{},start:{}},size:{sm:{w:'20'},md:{w:'20'},lg:{w:'20'}}},variantsCompounded:[{style:{ml:'2'},variants:{position:'end',size:'md'}},{style:{mr:'2'},variants:{position:'start',size:'md'}},{style:{ml:'4'},variants:{position:'end',size:'lg'}},{style:{mr:'4'},variants:{position:'start',size:'lg'}}]});
8
+ var icon = recipeRuntime({variants:{position:{end:{},start:{}},size:{sm:{w:'20'},md:{w:'20'},lg:{w:'20'}}},variantsCompounded:[{style:{ml:'2'},variants:{position:'end',size:'md'}},{style:{mr:'2'},variants:{position:'start',size:'md'}},{style:{ml:'4'},variants:{position:'end',size:'lg'}},{style:{mr:'4'},variants:{position:'start',size:'lg'}}]});
9
9
 
10
- export { button, section };
10
+ export { button, icon };
@@ -2,7 +2,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { Slottable, Slot } from '@radix-ui/react-slot';
3
3
  import { forwardRef } from 'react';
4
4
  import { Box } from '../box/Box.js';
5
- import { button, section } from './Button-css.js';
5
+ import { button, icon } from './Button-css.js';
6
6
 
7
7
  const appearances = {
8
8
  danger: { colorScheme: "danger", variant: "solid" },
@@ -19,7 +19,7 @@ const Button = forwardRef(
19
19
  className,
20
20
  colorScheme,
21
21
  disabled,
22
- icon,
22
+ icon: icon$1,
23
23
  iconPosition = "start",
24
24
  isLoading,
25
25
  size = "md",
@@ -31,7 +31,7 @@ const Button = forwardRef(
31
31
  const finalColorScheme = colorScheme ?? presetProps.colorScheme;
32
32
  const finalVariant = variant ?? presetProps.variant;
33
33
  const isDisabled = Boolean(disabled || isLoading);
34
- const isIconOnly = Boolean(!children && icon);
34
+ const isIconOnly = Boolean(!children && icon$1);
35
35
  return /* @__PURE__ */ jsx(
36
36
  Box,
37
37
  {
@@ -53,23 +53,23 @@ const Button = forwardRef(
53
53
  Box,
54
54
  {
55
55
  asChild: true,
56
- ...section({
56
+ ...icon({
57
57
  position: "start",
58
- size: icon && iconPosition === "start" ? size : void 0
58
+ size: icon$1 && iconPosition === "start" ? size : void 0
59
59
  }),
60
- children: icon && iconPosition === "start" ? icon : /* @__PURE__ */ jsx("div", {})
60
+ children: icon$1 && iconPosition === "start" ? icon$1 : /* @__PURE__ */ jsx("div", {})
61
61
  }
62
62
  ),
63
- /* @__PURE__ */ jsx(Slottable, { children: isIconOnly ? /* @__PURE__ */ jsx(Box, { asChild: true, ...section({ size }), children: icon }) : children }),
63
+ /* @__PURE__ */ jsx(Slottable, { children: isIconOnly ? /* @__PURE__ */ jsx(Box, { asChild: true, ...icon({ size }), children: icon$1 }) : children }),
64
64
  !isIconOnly && /* @__PURE__ */ jsx(
65
65
  Box,
66
66
  {
67
67
  asChild: true,
68
- ...section({
68
+ ...icon({
69
69
  position: "end",
70
- size: icon && iconPosition === "end" ? size : void 0
70
+ size: icon$1 && iconPosition === "end" ? size : void 0
71
71
  }),
72
- children: icon && iconPosition === "end" ? icon : /* @__PURE__ */ jsx("div", {})
72
+ children: icon$1 && iconPosition === "end" ? icon$1 : /* @__PURE__ */ jsx("div", {})
73
73
  }
74
74
  )
75
75
  ] })
package/dist/index.d.ts CHANGED
@@ -499,9 +499,9 @@ type WrapperVariants = RecipeVariants<typeof wrapper>;
499
499
 
500
500
  type InputProps = ExtendProps<ComponentPropsWithRef<"input">, ComponentPropsWithRef<typeof Box>, {
501
501
  disabled?: boolean;
502
+ endDecorator?: ReactNode;
502
503
  error?: boolean;
503
- leftSection?: ReactNode;
504
- rightSection?: ReactNode;
504
+ startDecorator?: ReactNode;
505
505
  } & WrapperVariants>;
506
506
  declare const Input: react.ForwardRefExoticComponent<Omit<InputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
507
507
 
@@ -10,11 +10,11 @@ const Input = forwardRef(
10
10
  ({
11
11
  className,
12
12
  disabled,
13
+ endDecorator,
13
14
  error,
14
15
  id,
15
- leftSection,
16
- rightSection,
17
16
  size = "md",
17
+ startDecorator,
18
18
  variant = "default",
19
19
  ...props
20
20
  }, ref) => {
@@ -29,9 +29,9 @@ const Input = forwardRef(
29
29
  ...wrapper({ size, variant }, className),
30
30
  ...sprinkleProps,
31
31
  children: [
32
- leftSection && /* @__PURE__ */ jsx(Flex, { gap: "0", mr: "8", children: leftSection }),
32
+ startDecorator && /* @__PURE__ */ jsx(Flex, { gap: "0", mr: "8", children: startDecorator }),
33
33
  /* @__PURE__ */ jsx(Box, { asChild: true, ...input({ variant }), children: /* @__PURE__ */ jsx("input", { id, readOnly: disabled, ref, ...restProps }) }),
34
- rightSection && /* @__PURE__ */ jsx(Flex, { gap: "0", ml: "8", children: rightSection })
34
+ endDecorator && /* @__PURE__ */ jsx(Flex, { gap: "0", ml: "8", children: endDecorator })
35
35
  ]
36
36
  }
37
37
  );
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.7",
9
+ "version": "0.1.0-next.8",
10
10
  "files": [
11
11
  "dist/**",
12
12
  "LICENSE"