@vaneui/ui 0.2.1-alpha.20250810113755.26a118a → 0.2.1-alpha.20250812182914.4e44540

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.
Files changed (34) hide show
  1. package/dist/components/examples/ref-usage-examples.d.ts +29 -0
  2. package/dist/components/examples/theme-types-strictness-compile-check.d.ts +5 -0
  3. package/dist/components/tests/grid2.test.d.ts +1 -0
  4. package/dist/components/tests/ref-support-comprehensive.test.d.ts +1 -0
  5. package/dist/components/tests/ref-support.test.d.ts +1 -0
  6. package/dist/components/tests/theme-types-strictness.test.d.ts +1 -0
  7. package/dist/components/themeContext.d.ts +70 -50
  8. package/dist/components/themedComponent.d.ts +1 -1
  9. package/dist/components/ui/badge.d.ts +2 -2
  10. package/dist/components/ui/button.d.ts +2 -2
  11. package/dist/components/ui/card.d.ts +2 -2
  12. package/dist/components/ui/checkbox.d.ts +83 -3
  13. package/dist/components/ui/chip.d.ts +2 -2
  14. package/dist/components/ui/code.d.ts +121 -3
  15. package/dist/components/ui/col.d.ts +2 -2
  16. package/dist/components/ui/container.d.ts +2 -2
  17. package/dist/components/ui/divider.d.ts +74 -3
  18. package/dist/components/ui/grid.d.ts +4 -3
  19. package/dist/components/ui/img.d.ts +81 -3
  20. package/dist/components/ui/label.d.ts +109 -3
  21. package/dist/components/ui/layout.d.ts +1 -1
  22. package/dist/components/ui/props/keys.d.ts +1 -1
  23. package/dist/components/ui/row.d.ts +2 -2
  24. package/dist/components/ui/section.d.ts +2 -2
  25. package/dist/components/ui/stack.d.ts +2 -2
  26. package/dist/components/ui/theme/gridTheme.d.ts +1 -0
  27. package/dist/components/ui/typography.d.ts +110 -9
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.esm.js +84 -75
  30. package/dist/index.esm.js.map +1 -1
  31. package/dist/index.js +83 -73
  32. package/dist/index.js.map +1 -1
  33. package/dist/ui.css +11 -0
  34. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -94,7 +94,7 @@ const LABEL_CATEGORIES = [...TYPOGRAPHY_FULL, ...LAYOUT_FULL, ...VISUAL_CORE];
94
94
  // Media component categories
95
95
  const IMG_CATEGORIES = [...LAYOUT_CORE, ...VISUAL_CORE, ...VISUAL_DECORATION, ...SHAPE];
96
96
  const COMPONENT = ['button', 'badge', 'chip', 'code', 'card', 'divider', 'container', 'row', 'col', 'stack', 'section',
97
- 'grid3', 'grid4', 'pageTitle', 'sectionTitle', 'title', 'text', 'link', 'list', 'listItem', 'checkbox', 'label', 'img'];
97
+ 'grid2', 'grid3', 'grid4', 'pageTitle', 'sectionTitle', 'title', 'text', 'link', 'list', 'listItem', 'checkbox', 'label', 'img'];
98
98
  const ComponentCategories = {
99
99
  badge: BADGE_CATEGORIES,
100
100
  button: BUTTON_CATEGORIES,
@@ -105,6 +105,7 @@ const ComponentCategories = {
105
105
  col: COL_CATEGORIES,
106
106
  container: CONTAINER_CATEGORIES,
107
107
  divider: DIVIDER_CATEGORIES,
108
+ grid2: GRID_CATEGORIES,
108
109
  grid3: GRID_CATEGORIES,
109
110
  grid4: GRID_CATEGORIES,
110
111
  img: IMG_CATEGORIES,
@@ -4643,6 +4644,9 @@ const gridSubThemes = {
4643
4644
  flexDirection: new DirectionTheme(),
4644
4645
  },
4645
4646
  };
4647
+ const defaultGrid2Theme = new ComponentTheme("div", "grid-cols-1 md:grid-cols-2", gridSubThemes, gridDefaults, GRID_CATEGORIES, (props, defaults) => {
4648
+ return props.href ? "a" : "div";
4649
+ });
4646
4650
  const defaultGrid3Theme = new ComponentTheme("div", "grid-cols-1 md:grid-cols-3", gridSubThemes, gridDefaults, GRID_CATEGORIES, (props, defaults) => {
4647
4651
  return props.href ? "a" : "div";
4648
4652
  });
@@ -4773,6 +4777,7 @@ const defaultTheme = {
4773
4777
  col: defaultColTheme,
4774
4778
  stack: defaultStackTheme,
4775
4779
  section: defaultSectionTheme,
4780
+ grid2: defaultGrid2Theme,
4776
4781
  grid3: defaultGrid3Theme,
4777
4782
  grid4: defaultGrid4Theme,
4778
4783
  pageTitle: pageTitleTheme,
@@ -4882,41 +4887,41 @@ function useTheme() {
4882
4887
  return react.useContext(ThemeContext);
4883
4888
  }
4884
4889
 
4885
- function ThemedComponent(allProps) {
4890
+ const ThemedComponent = react.forwardRef(function ThemedComponent(allProps, ref) {
4886
4891
  const { theme, ...props } = allProps;
4887
4892
  const { Tag, finalClasses, finalProps } = react.useMemo(() => {
4888
4893
  // Pass the full allProps and let getComponentConfig handle filtering
4889
4894
  return theme.getComponentConfig(allProps);
4890
4895
  }, [theme, allProps]);
4891
- return (jsxRuntime.jsx(Tag, { className: finalClasses, ...finalProps, children: props.children }));
4892
- }
4896
+ return (jsxRuntime.jsx(Tag, { ref: ref, className: finalClasses, ...finalProps, children: props.children }));
4897
+ });
4893
4898
 
4894
- const Button = (props) => {
4899
+ const Button = react.forwardRef(function Button(props, ref) {
4895
4900
  const theme = useTheme();
4896
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.button, ...props });
4897
- };
4901
+ return jsxRuntime.jsx(ThemedComponent, { ref: ref, theme: theme.button, ...props });
4902
+ });
4898
4903
 
4899
- const Badge = (props) => {
4904
+ const Badge = react.forwardRef(function Badge(props, ref) {
4900
4905
  const theme = useTheme();
4901
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.badge, ...props });
4902
- };
4906
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.badge, ref: ref, ...props });
4907
+ });
4903
4908
 
4904
- const Divider = (props) => {
4909
+ const Divider = react.forwardRef(function Divider(props, ref) {
4905
4910
  const theme = useTheme();
4906
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.divider, ...props });
4907
- };
4911
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.divider, ref: ref, ...props });
4912
+ });
4908
4913
 
4909
- const Chip = (props) => {
4914
+ const Chip = react.forwardRef(function Chip(props, ref) {
4910
4915
  const theme = useTheme();
4911
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.chip, ...props });
4912
- };
4916
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.chip, ref: ref, ...props });
4917
+ });
4913
4918
 
4914
- const Code = (props) => {
4919
+ const Code = react.forwardRef(function Code(props, ref) {
4915
4920
  const theme = useTheme();
4916
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.code, ...props });
4917
- };
4921
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.code, ref: ref, ...props });
4922
+ });
4918
4923
 
4919
- const Checkbox = (props) => {
4924
+ const Checkbox = react.forwardRef(function Checkbox(props, ref) {
4920
4925
  const theme = useTheme();
4921
4926
  // Extract only theme-relevant props for wrapper and check components
4922
4927
  const {
@@ -4936,87 +4941,91 @@ const Checkbox = (props) => {
4936
4941
  filled, outline,
4937
4942
  pill, sharp, rounded
4938
4943
  };
4939
- return (jsxRuntime.jsxs(ThemedComponent, { theme: theme.checkbox.wrapper, ...themeProps, children: [jsxRuntime.jsx(ThemedComponent, { theme: theme.checkbox.input, ...props, type: "checkbox" }), jsxRuntime.jsx(ThemedComponent, { theme: theme.checkbox.check, ...themeProps, children: theme.checkbox.check.themes.checkElement() })] }));
4940
- };
4944
+ return (jsxRuntime.jsxs(ThemedComponent, { theme: theme.checkbox.wrapper, ref: ref, ...themeProps, children: [jsxRuntime.jsx(ThemedComponent, { theme: theme.checkbox.input, ...props, type: "checkbox" }), jsxRuntime.jsx(ThemedComponent, { theme: theme.checkbox.check, ...themeProps, children: theme.checkbox.check.themes.checkElement() })] }));
4945
+ });
4941
4946
 
4942
- const Label = (props) => {
4947
+ const Label = react.forwardRef(function Label(props, ref) {
4943
4948
  const theme = useTheme();
4944
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.label, ...props });
4945
- };
4949
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.label, ref: ref, ...props });
4950
+ });
4946
4951
 
4947
- const Img = (props) => {
4952
+ const Img = react.forwardRef(function Img(props, ref) {
4948
4953
  const theme = useTheme();
4949
- return (jsxRuntime.jsx(ThemedComponent, { theme: theme.img, ...props }));
4950
- };
4954
+ return (jsxRuntime.jsx(ThemedComponent, { theme: theme.img, ref: ref, ...props }));
4955
+ });
4951
4956
 
4952
- const Section = (props) => {
4957
+ const Section = react.forwardRef(function Section(props, ref) {
4953
4958
  const theme = useTheme();
4954
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.section, ...props });
4955
- };
4959
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.section, ref: ref, ...props });
4960
+ });
4956
4961
 
4957
- const Container = (props) => {
4962
+ const Container = react.forwardRef(function Container(props, ref) {
4958
4963
  const theme = useTheme();
4959
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.container, ...props });
4960
- };
4964
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.container, ref: ref, ...props });
4965
+ });
4961
4966
 
4962
- const Col = (props) => {
4967
+ const Col = react.forwardRef(function Col(props, ref) {
4963
4968
  const theme = useTheme();
4964
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.col, ...props });
4965
- };
4969
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.col, ref: ref, ...props });
4970
+ });
4966
4971
 
4967
- const Row = (props) => {
4972
+ const Row = react.forwardRef(function Row(props, ref) {
4968
4973
  const theme = useTheme();
4969
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.row, ...props });
4970
- };
4974
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.row, ref: ref, ...props });
4975
+ });
4971
4976
 
4972
- const Grid3 = (props) => {
4977
+ const Grid2 = react.forwardRef(function Grid2(props, ref) {
4973
4978
  const theme = useTheme();
4974
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.grid3, ...props });
4975
- };
4976
- const Grid4 = (props) => {
4979
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.grid2, ref: ref, ...props });
4980
+ });
4981
+ const Grid3 = react.forwardRef(function Grid3(props, ref) {
4977
4982
  const theme = useTheme();
4978
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.grid4, ...props });
4979
- };
4983
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.grid3, ref: ref, ...props });
4984
+ });
4985
+ const Grid4 = react.forwardRef(function Grid4(props, ref) {
4986
+ const theme = useTheme();
4987
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.grid4, ref: ref, ...props });
4988
+ });
4980
4989
 
4981
- const Card = (props) => {
4990
+ const Card = react.forwardRef(function Card(props, ref) {
4982
4991
  const theme = useTheme();
4983
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.card, ...props });
4984
- };
4992
+ return jsxRuntime.jsx(ThemedComponent, { ref: ref, theme: theme.card, ...props });
4993
+ });
4985
4994
 
4986
- const Stack = (props) => {
4995
+ const Stack = react.forwardRef(function Stack(props, ref) {
4987
4996
  const theme = useTheme();
4988
4997
  const stackTheme = theme.stack;
4989
- return jsxRuntime.jsx(ThemedComponent, { theme: stackTheme, ...props });
4990
- };
4998
+ return jsxRuntime.jsx(ThemedComponent, { theme: stackTheme, ref: ref, ...props });
4999
+ });
4991
5000
 
4992
- const PageTitle = (props) => {
5001
+ const PageTitle = react.forwardRef(function PageTitle(props, ref) {
4993
5002
  const theme = useTheme();
4994
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.pageTitle, ...props });
4995
- };
4996
- const SectionTitle = (props) => {
5003
+ return jsxRuntime.jsx(ThemedComponent, { ref: ref, theme: theme.pageTitle, ...props });
5004
+ });
5005
+ const SectionTitle = react.forwardRef(function SectionTitle(props, ref) {
4997
5006
  const theme = useTheme();
4998
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.sectionTitle, ...props });
4999
- };
5000
- const Title = (props) => {
5007
+ return jsxRuntime.jsx(ThemedComponent, { ref: ref, theme: theme.sectionTitle, ...props });
5008
+ });
5009
+ const Title = react.forwardRef(function Title(props, ref) {
5001
5010
  const theme = useTheme();
5002
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.title, ...props });
5003
- };
5004
- const Text = (props) => {
5011
+ return jsxRuntime.jsx(ThemedComponent, { ref: ref, theme: theme.title, ...props });
5012
+ });
5013
+ const Text = react.forwardRef(function Text(props, ref) {
5005
5014
  const theme = useTheme();
5006
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.text, ...props });
5007
- };
5008
- const Link = (props) => {
5015
+ return jsxRuntime.jsx(ThemedComponent, { ref: ref, theme: theme.text, ...props });
5016
+ });
5017
+ const Link = react.forwardRef(function Link(props, ref) {
5009
5018
  const theme = useTheme();
5010
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.link, ...props });
5011
- };
5012
- const ListItem = (props) => {
5019
+ return jsxRuntime.jsx(ThemedComponent, { ref: ref, theme: theme.link, ...props });
5020
+ });
5021
+ const ListItem = react.forwardRef(function ListItem(props, ref) {
5013
5022
  const theme = useTheme();
5014
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.listItem, ...props });
5015
- };
5016
- const List = (props) => {
5023
+ return jsxRuntime.jsx(ThemedComponent, { ref: ref, theme: theme.listItem, ...props });
5024
+ });
5025
+ const List = react.forwardRef(function List(props, ref) {
5017
5026
  const theme = useTheme();
5018
- return jsxRuntime.jsx(ThemedComponent, { theme: theme.list, ...props });
5019
- };
5027
+ return jsxRuntime.jsx(ThemedComponent, { ref: ref, theme: theme.list, ...props });
5028
+ });
5020
5029
 
5021
5030
  exports.BADGE_CATEGORIES = BADGE_CATEGORIES;
5022
5031
  exports.BREAKPOINT = BREAKPOINT;
@@ -5042,6 +5051,7 @@ exports.Container = Container;
5042
5051
  exports.DIVIDER_CATEGORIES = DIVIDER_CATEGORIES;
5043
5052
  exports.Divider = Divider;
5044
5053
  exports.GRID_CATEGORIES = GRID_CATEGORIES;
5054
+ exports.Grid2 = Grid2;
5045
5055
  exports.Grid3 = Grid3;
5046
5056
  exports.Grid4 = Grid4;
5047
5057
  exports.IMG_CATEGORIES = IMG_CATEGORIES;