@yakad/ui 2.0.2 → 2.0.3

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 (41) hide show
  1. package/dist/Avatar/Avatar.d.ts +14 -4
  2. package/dist/Avatar/Avatar.js +49 -8
  3. package/dist/Button/Button.d.ts +9 -13
  4. package/dist/Button/Button.js +28 -14
  5. package/dist/ButtonGroup/ButtonGroup.d.ts +12 -0
  6. package/dist/ButtonGroup/ButtonGroup.js +60 -0
  7. package/dist/Card/Card.d.ts +14 -9
  8. package/dist/Card/Card.js +41 -7
  9. package/dist/CheckBox/CheckBox.d.ts +12 -8
  10. package/dist/CheckBox/CheckBox.js +47 -10
  11. package/dist/Field/Field.d.ts +21 -0
  12. package/dist/Field/Field.js +154 -0
  13. package/dist/Label/Label.d.ts +1 -1
  14. package/dist/Navigation/Navigation.d.ts +19 -9
  15. package/dist/Navigation/Navigation.js +158 -11
  16. package/dist/RadioGroup/RadioGroup.d.ts +19 -12
  17. package/dist/RadioGroup/RadioGroup.js +61 -14
  18. package/dist/Table/Table.d.ts +18 -36
  19. package/dist/Table/Table.js +90 -38
  20. package/dist/index.d.ts +0 -4
  21. package/dist/index.js +0 -4
  22. package/package.json +11 -5
  23. package/dist/Avatar/Avatar.module.css +0 -32
  24. package/dist/Avatar/default-avatar.svg +0 -17
  25. package/dist/Button/Button.module.css +0 -190
  26. package/dist/Card/Card.module.css +0 -48
  27. package/dist/CheckBox/CheckBox.module.css +0 -50
  28. package/dist/CodeBox/CodeBox.d.ts +0 -7
  29. package/dist/CodeBox/CodeBox.js +0 -22
  30. package/dist/CodeBox/CodeBox.module.css +0 -0
  31. package/dist/CodeField/CodeField.d.ts +0 -10
  32. package/dist/CodeField/CodeField.js +0 -43
  33. package/dist/CodeField/CodeField.module.css +0 -27
  34. package/dist/Form/Form.d.ts +0 -9
  35. package/dist/Form/Form.js +0 -20
  36. package/dist/Form/Form.module.css +0 -3
  37. package/dist/Navigation/Navigation.module.css +0 -61
  38. package/dist/RadioButton/RadioButton.d.ts +0 -14
  39. package/dist/RadioButton/RadioButton.js +0 -31
  40. package/dist/RadioButton/RadioButton.module.css +0 -22
  41. package/dist/Table/Table.module.css +0 -41
@@ -9,14 +9,161 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import classNames from "classnames";
14
- import boxingStyles from "../boxing.module.css";
15
- import styles from "./Navigation.module.css";
16
- export function Navigation(_a) {
17
- var { align, anchor = "auto", open = false, className, children } = _a, restProps = __rest(_a, ["align", "anchor", "open", "className", "children"]);
18
- const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, { [boxingStyles.demandChildsToBeFullWidth]: true }, styles.navigation, styles[anchor], {
19
- [styles.open]: open,
20
- }, className);
21
- return (_jsx("nav", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
22
- }
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import * as React from "react";
14
+ import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
15
+ import { cva } from "class-variance-authority";
16
+ const navigationMenuVariants = cva([
17
+ "relative",
18
+ "z-10",
19
+ "flex",
20
+ "max-w-max",
21
+ "flex-1",
22
+ "items-center",
23
+ "justify-center",
24
+ ], {
25
+ variants: {
26
+ orientation: {
27
+ horizontal: "flex-row",
28
+ vertical: "flex-col",
29
+ },
30
+ },
31
+ defaultVariants: {
32
+ orientation: "horizontal",
33
+ },
34
+ });
35
+ const navigationMenuTriggerVariants = cva([
36
+ "group",
37
+ "inline-flex",
38
+ "items-center",
39
+ "justify-center",
40
+ "gap-1",
41
+ "rounded-md",
42
+ "px-4",
43
+ "py-2",
44
+ "text-sm",
45
+ "font-medium",
46
+ "outline-none",
47
+ "transition-colors",
48
+ "hover:bg-slate-100",
49
+ "focus-visible:ring-2",
50
+ "focus-visible:ring-slate-500",
51
+ "disabled:pointer-events-none",
52
+ "disabled:opacity-50",
53
+ "data-[state=open]:bg-slate-100",
54
+ ]);
55
+ const navigationMenuLinkVariants = cva([
56
+ "inline-flex",
57
+ "items-center",
58
+ "justify-center",
59
+ "rounded-md",
60
+ "px-4",
61
+ "py-2",
62
+ "text-sm",
63
+ "font-medium",
64
+ "outline-none",
65
+ "transition-colors",
66
+ "hover:bg-slate-100",
67
+ "focus-visible:ring-2",
68
+ "focus-visible:ring-slate-500",
69
+ "data-[active=true]:bg-slate-100",
70
+ ]);
71
+ const NavigationMenu = React.forwardRef((_a, ref) => {
72
+ var { className, orientation } = _a, props = __rest(_a, ["className", "orientation"]);
73
+ return (_jsx(NavigationMenuPrimitive.Root, Object.assign({ ref: ref, orientation: orientation, className: navigationMenuVariants({
74
+ orientation,
75
+ className,
76
+ }) }, props)));
77
+ });
78
+ NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
79
+ const NavigationMenuList = React.forwardRef((_a, ref) => {
80
+ var { className } = _a, props = __rest(_a, ["className"]);
81
+ return (_jsx(NavigationMenuPrimitive.List, Object.assign({ ref: ref, className: [
82
+ "group",
83
+ "flex",
84
+ "list-none",
85
+ "items-center",
86
+ "justify-center",
87
+ "gap-1",
88
+ className,
89
+ ].filter(Boolean).join(" ") }, props)));
90
+ });
91
+ NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
92
+ const NavigationMenuItem = React.forwardRef((_a, ref) => {
93
+ var props = __rest(_a, []);
94
+ return (_jsx(NavigationMenuPrimitive.Item, Object.assign({ ref: ref }, props)));
95
+ });
96
+ NavigationMenuItem.displayName = NavigationMenuPrimitive.Item.displayName;
97
+ const NavigationMenuTrigger = React.forwardRef((_a, ref) => {
98
+ var { className, children } = _a, props = __rest(_a, ["className", "children"]);
99
+ return (_jsxs(NavigationMenuPrimitive.Trigger, Object.assign({ ref: ref, className: navigationMenuTriggerVariants({ className }) }, props, { children: [children, _jsx("svg", { viewBox: "0 0 24 24", className: "h-4 w-4 transition-transform duration-200 group-data-[state=open]:rotate-180", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "m6 9 6 6 6-6" }) })] })));
100
+ });
101
+ NavigationMenuTrigger.displayName =
102
+ NavigationMenuPrimitive.Trigger.displayName;
103
+ const NavigationMenuContent = React.forwardRef((_a, ref) => {
104
+ var { className } = _a, props = __rest(_a, ["className"]);
105
+ return (_jsx(NavigationMenuPrimitive.Content, Object.assign({ ref: ref, className: [
106
+ "absolute",
107
+ "left-0",
108
+ "top-full",
109
+ "w-full",
110
+ "md:w-auto",
111
+ "rounded-md",
112
+ "border",
113
+ "bg-white",
114
+ "p-4",
115
+ "shadow-md",
116
+ "outline-none",
117
+ "data-[motion=from-start]:animate-in",
118
+ "data-[motion=from-end]:animate-in",
119
+ "data-[motion=to-start]:animate-out",
120
+ "data-[motion=to-end]:animate-out",
121
+ className !== null && className !== void 0 ? className : "",
122
+ ].join(" ") }, props)));
123
+ });
124
+ NavigationMenuContent.displayName =
125
+ NavigationMenuPrimitive.Content.displayName;
126
+ const NavigationMenuLink = React.forwardRef((_a, ref) => {
127
+ var { className } = _a, props = __rest(_a, ["className"]);
128
+ return (_jsx(NavigationMenuPrimitive.Link, Object.assign({ ref: ref, className: navigationMenuLinkVariants({ className }) }, props)));
129
+ });
130
+ NavigationMenuLink.displayName = NavigationMenuPrimitive.Link.displayName;
131
+ const NavigationMenuIndicator = React.forwardRef((_a, ref) => {
132
+ var { className } = _a, props = __rest(_a, ["className"]);
133
+ return (_jsx(NavigationMenuPrimitive.Indicator, Object.assign({ ref: ref, className: [
134
+ "top-full",
135
+ "z-[1]",
136
+ "flex",
137
+ "h-1.5",
138
+ "items-end",
139
+ "justify-center",
140
+ "overflow-hidden",
141
+ "data-[state=visible]:animate-in",
142
+ "data-[state=hidden]:animate-out",
143
+ className !== null && className !== void 0 ? className : "",
144
+ ].join(" ") }, props, { children: _jsx("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-slate-200 shadow-md" }) })));
145
+ });
146
+ NavigationMenuIndicator.displayName =
147
+ NavigationMenuPrimitive.Indicator.displayName;
148
+ const NavigationMenuViewport = React.forwardRef((_a, ref) => {
149
+ var { className } = _a, props = __rest(_a, ["className"]);
150
+ return (_jsx(NavigationMenuPrimitive.Viewport, Object.assign({ ref: ref, className: [
151
+ "origin-top-center",
152
+ "relative",
153
+ "mt-1.5",
154
+ "h-[var(--radix-navigation-menu-viewport-height)]",
155
+ "w-full",
156
+ "overflow-hidden",
157
+ "rounded-md",
158
+ "border",
159
+ "bg-white",
160
+ "shadow-md",
161
+ "md:w-[var(--radix-navigation-menu-viewport-width)]",
162
+ "data-[state=open]:animate-in",
163
+ "data-[state=closed]:animate-out",
164
+ className !== null && className !== void 0 ? className : "",
165
+ ].join(" ") }, props)));
166
+ });
167
+ NavigationMenuViewport.displayName =
168
+ NavigationMenuPrimitive.Viewport.displayName;
169
+ export { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, };
@@ -1,12 +1,19 @@
1
- /// <reference types="react" />
2
- import { RadioButtonProps } from "..";
3
- type RadioButtonElement = React.ReactElement<RadioButtonProps>;
4
- type ExcludedTypes = "defaultValue" | "children";
5
- export interface RadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, ExcludedTypes> {
6
- name: string;
7
- defaultValue?: string;
8
- children?: RadioButtonElement | RadioButtonElement[];
9
- ref?: React.Ref<HTMLDivElement>;
10
- }
11
- export declare function RadioGroup({ name, defaultValue, className, children, ...restProps }: RadioGroupProps): import("react").JSX.Element;
12
- export {};
1
+ import * as React from "react";
2
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
3
+ import { type VariantProps } from "class-variance-authority";
4
+ declare const radioGroupVariants: (props?: ({
5
+ orientation?: "horizontal" | "vertical" | null | undefined;
6
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
7
+ declare const radioGroupItemVariants: (props?: ({
8
+ size?: "small" | "medium" | "large" | null | undefined;
9
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
10
+ type RadioGroupProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> & VariantProps<typeof radioGroupVariants>;
11
+ declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & VariantProps<(props?: ({
12
+ orientation?: "horizontal" | "vertical" | null | undefined;
13
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
14
+ type RadioGroupItemProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> & VariantProps<typeof radioGroupItemVariants>;
15
+ declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
16
+ size?: "small" | "medium" | "large" | null | undefined;
17
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
18
+ export { RadioGroup, RadioGroupItem, radioGroupVariants, radioGroupItemVariants, };
19
+ export type { RadioGroupProps, RadioGroupItemProps, };
@@ -1,4 +1,3 @@
1
- "use client";
2
1
  var __rest = (this && this.__rest) || function (s, e) {
3
2
  var t = {};
4
3
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -11,16 +10,64 @@ var __rest = (this && this.__rest) || function (s, e) {
11
10
  return t;
12
11
  };
13
12
  import { jsx as _jsx } from "react/jsx-runtime";
14
- import { useState, Children } from "react";
15
- import { RadioButton } from "..";
16
- export function RadioGroup(_a) {
17
- var { name, defaultValue, className, children } = _a, restProps = __rest(_a, ["name", "defaultValue", "className", "children"]);
18
- const [selectedValue, setSelectedValue] = useState(defaultValue || null);
19
- const arrayChildren = Children.toArray(children);
20
- const renderChildrens = () => arrayChildren.map((child, index) => (_jsx(RadioButton, Object.assign({}, child.props, { dataFromRadioGroup: {
21
- name: name,
22
- onSelect: () => setSelectedValue(child.props.value),
23
- checked: selectedValue === child.props.value,
24
- } }), index)));
25
- return (_jsx("div", Object.assign({}, restProps, { className: className, children: renderChildrens() })));
26
- }
13
+ import * as React from "react";
14
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
15
+ import { cva } from "class-variance-authority";
16
+ const radioGroupVariants = cva("grid", {
17
+ variants: {
18
+ orientation: {
19
+ horizontal: "grid-flow-col auto-cols-max gap-4",
20
+ vertical: "grid-flow-row gap-3",
21
+ },
22
+ },
23
+ defaultVariants: {
24
+ orientation: "vertical",
25
+ },
26
+ });
27
+ const radioGroupItemVariants = cva([
28
+ "peer",
29
+ "relative",
30
+ "shrink-0",
31
+ "rounded-full",
32
+ "border",
33
+ "border-slate-500",
34
+ "bg-transparent",
35
+ "outline-none",
36
+ "transition-colors",
37
+ "duration-150",
38
+ "ease-out",
39
+ "focus-visible:ring-2",
40
+ "focus-visible:ring-slate-500",
41
+ "focus-visible:ring-offset-2",
42
+ "disabled:pointer-events-none",
43
+ "disabled:opacity-50",
44
+ "data-[state=checked]:border-slate-900",
45
+ ], {
46
+ variants: {
47
+ size: {
48
+ small: "h-4 w-4",
49
+ medium: "h-[18px] w-[18px]",
50
+ large: "h-5 w-5",
51
+ },
52
+ },
53
+ defaultVariants: {
54
+ size: "medium",
55
+ },
56
+ });
57
+ const RadioGroup = React.forwardRef((_a, ref) => {
58
+ var { className, orientation } = _a, props = __rest(_a, ["className", "orientation"]);
59
+ return (_jsx(RadioGroupPrimitive.Root, Object.assign({ ref: ref, orientation: orientation, className: radioGroupVariants({
60
+ orientation,
61
+ className,
62
+ }) }, props)));
63
+ });
64
+ RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
65
+ const RadioGroupItem = React.forwardRef((_a, ref) => {
66
+ var { className, size } = _a, props = __rest(_a, ["className", "size"]);
67
+ return (_jsx(RadioGroupPrimitive.Item, Object.assign({ ref: ref, className: radioGroupItemVariants({
68
+ size,
69
+ className,
70
+ }) }, props, { children: _jsx(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: _jsx("span", { className: "h-2 w-2 rounded-full bg-slate-900" }) }) })));
71
+ });
72
+ RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
73
+ export { RadioGroup, RadioGroupItem, radioGroupVariants, radioGroupItemVariants, };
@@ -1,36 +1,18 @@
1
- /// <reference types="react" />
2
- export interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {
3
- children?: React.ReactNode;
4
- ref?: React.Ref<HTMLTableElement>;
5
- }
6
- export declare function Table({ className, children, ...restProps }: TableProps): import("react").JSX.Element;
7
- export interface TheadProps extends React.HTMLAttributes<HTMLTableSectionElement> {
8
- children?: React.ReactNode;
9
- ref?: React.Ref<HTMLTableSectionElement>;
10
- }
11
- export declare function Thead({ className, children, ...restProps }: TheadProps): import("react").JSX.Element;
12
- export interface TbodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {
13
- children?: React.ReactNode;
14
- ref?: React.Ref<HTMLTableSectionElement>;
15
- }
16
- export declare function Tbody({ className, children, ...restProps }: TbodyProps): import("react").JSX.Element;
17
- export interface TfootProps extends React.HTMLAttributes<HTMLTableSectionElement> {
18
- children?: React.ReactNode;
19
- ref?: React.Ref<HTMLTableSectionElement>;
20
- }
21
- export declare function Tfoot({ className, children, ...restProps }: TfootProps): import("react").JSX.Element;
22
- export interface TrProps extends React.HTMLAttributes<HTMLTableRowElement> {
23
- children?: React.ReactNode;
24
- ref?: React.Ref<HTMLTableRowElement>;
25
- }
26
- export declare function Tr({ className, children, ...restProps }: TrProps): import("react").JSX.Element;
27
- export interface ThProps extends React.HTMLAttributes<HTMLTableCellElement> {
28
- children?: React.ReactNode;
29
- ref?: React.Ref<HTMLTableCellElement>;
30
- }
31
- export declare function Th({ className, children, ...restProps }: ThProps): import("react").JSX.Element;
32
- export interface TdProps extends React.HTMLAttributes<HTMLTableCellElement> {
33
- children?: React.ReactNode;
34
- ref?: React.Ref<HTMLTableCellElement>;
35
- }
36
- export declare function Td({ className, children, ...restProps }: TdProps): import("react").JSX.Element;
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const tableVariants: (props?: ({
4
+ size?: "small" | "medium" | "large" | null | undefined;
5
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
6
+ type TableProps = React.ComponentPropsWithoutRef<"table"> & VariantProps<typeof tableVariants>;
7
+ declare const Table: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, "ref"> & VariantProps<(props?: ({
8
+ size?: "small" | "medium" | "large" | null | undefined;
9
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLTableElement>>;
10
+ declare const TableHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & React.RefAttributes<HTMLTableSectionElement>>;
11
+ declare const TableBody: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & React.RefAttributes<HTMLTableSectionElement>>;
12
+ declare const TableFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & React.RefAttributes<HTMLTableSectionElement>>;
13
+ declare const TableRow: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, "ref"> & React.RefAttributes<HTMLTableRowElement>>;
14
+ declare const TableHead: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, "ref"> & React.RefAttributes<HTMLTableCellElement>>;
15
+ declare const TableCell: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, "ref"> & React.RefAttributes<HTMLTableCellElement>>;
16
+ declare const TableCaption: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLTableCaptionElement>>;
17
+ export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, tableVariants, };
18
+ export type { TableProps, };
@@ -10,41 +10,93 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import classNames from "classnames";
14
- import boxingStyles from "../boxing.module.css";
15
- import styles from "./Table.module.css";
16
- export function Table(_a) {
17
- var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
18
- const joinedClassNames = classNames({ [boxingStyles.fullWidthOnParentDemand]: true }, styles.table, className);
19
- return (_jsx("table", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
20
- }
21
- export function Thead(_a) {
22
- var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
23
- const joinedClassNames = classNames(styles.thead, className);
24
- return (_jsx("thead", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
25
- }
26
- export function Tbody(_a) {
27
- var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
28
- const joinedClassNames = classNames(styles.tbody, className);
29
- return (_jsx("tbody", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
30
- }
31
- export function Tfoot(_a) {
32
- var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
33
- const joinedClassNames = classNames(styles.tfoot, className);
34
- return (_jsx("tfoot", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
35
- }
36
- export function Tr(_a) {
37
- var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
38
- const joinedClassNames = classNames(styles.tr, className);
39
- return (_jsx("tr", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
40
- }
41
- export function Th(_a) {
42
- var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
43
- const joinedClassNames = classNames(styles.th, className);
44
- return (_jsx("th", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
45
- }
46
- export function Td(_a) {
47
- var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
48
- const joinedClassNames = classNames(styles.td, className);
49
- return (_jsx("td", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
50
- }
13
+ import * as React from "react";
14
+ import { cva } from "class-variance-authority";
15
+ const tableVariants = cva("w-full caption-bottom text-sm", {
16
+ variants: {
17
+ size: {
18
+ small: "[&_th]:h-8 [&_th]:px-3 [&_td]:px-3 [&_td]:py-2",
19
+ medium: "[&_th]:h-10 [&_th]:px-4 [&_td]:px-4 [&_td]:py-3",
20
+ large: "[&_th]:h-12 [&_th]:px-5 [&_td]:px-5 [&_td]:py-4",
21
+ },
22
+ },
23
+ defaultVariants: {
24
+ size: "medium",
25
+ },
26
+ });
27
+ const Table = React.forwardRef((_a, ref) => {
28
+ var { className, size } = _a, props = __rest(_a, ["className", "size"]);
29
+ return (_jsx("div", { className: "relative w-full overflow-auto", children: _jsx("table", Object.assign({ ref: ref, className: tableVariants({
30
+ size,
31
+ className,
32
+ }) }, props)) }));
33
+ });
34
+ Table.displayName = "Table";
35
+ const TableHeader = React.forwardRef((_a, ref) => {
36
+ var { className } = _a, props = __rest(_a, ["className"]);
37
+ return (_jsx("thead", Object.assign({ ref: ref, className: [
38
+ "[&_tr]:border-b",
39
+ className !== null && className !== void 0 ? className : "",
40
+ ].join(" ") }, props)));
41
+ });
42
+ TableHeader.displayName = "TableHeader";
43
+ const TableBody = React.forwardRef((_a, ref) => {
44
+ var { className } = _a, props = __rest(_a, ["className"]);
45
+ return (_jsx("tbody", Object.assign({ ref: ref, className: [
46
+ "[&_tr:last-child]:border-0",
47
+ className !== null && className !== void 0 ? className : "",
48
+ ].join(" ") }, props)));
49
+ });
50
+ TableBody.displayName = "TableBody";
51
+ const TableFooter = React.forwardRef((_a, ref) => {
52
+ var { className } = _a, props = __rest(_a, ["className"]);
53
+ return (_jsx("tfoot", Object.assign({ ref: ref, className: [
54
+ "border-t",
55
+ "font-medium",
56
+ className !== null && className !== void 0 ? className : "",
57
+ ].join(" ") }, props)));
58
+ });
59
+ TableFooter.displayName = "TableFooter";
60
+ const TableRow = React.forwardRef((_a, ref) => {
61
+ var { className } = _a, props = __rest(_a, ["className"]);
62
+ return (_jsx("tr", Object.assign({ ref: ref, className: [
63
+ "border-b",
64
+ "transition-colors",
65
+ "hover:bg-slate-50",
66
+ "data-[state=selected]:bg-slate-100",
67
+ className !== null && className !== void 0 ? className : "",
68
+ ].join(" ") }, props)));
69
+ });
70
+ TableRow.displayName = "TableRow";
71
+ const TableHead = React.forwardRef((_a, ref) => {
72
+ var { className } = _a, props = __rest(_a, ["className"]);
73
+ return (_jsx("th", Object.assign({ ref: ref, className: [
74
+ "text-left",
75
+ "align-middle",
76
+ "font-medium",
77
+ "text-slate-600",
78
+ "[&:has([role=checkbox])]:pr-0",
79
+ className !== null && className !== void 0 ? className : "",
80
+ ].join(" ") }, props)));
81
+ });
82
+ TableHead.displayName = "TableHead";
83
+ const TableCell = React.forwardRef((_a, ref) => {
84
+ var { className } = _a, props = __rest(_a, ["className"]);
85
+ return (_jsx("td", Object.assign({ ref: ref, className: [
86
+ "align-middle",
87
+ "[&:has([role=checkbox])]:pr-0",
88
+ className !== null && className !== void 0 ? className : "",
89
+ ].join(" ") }, props)));
90
+ });
91
+ TableCell.displayName = "TableCell";
92
+ const TableCaption = React.forwardRef((_a, ref) => {
93
+ var { className } = _a, props = __rest(_a, ["className"]);
94
+ return (_jsx("caption", Object.assign({ ref: ref, className: [
95
+ "mt-4",
96
+ "text-sm",
97
+ "text-slate-500",
98
+ className !== null && className !== void 0 ? className : "",
99
+ ].join(" ") }, props)));
100
+ });
101
+ TableCaption.displayName = "TableCaption";
102
+ export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, tableVariants, };
package/dist/index.d.ts CHANGED
@@ -18,13 +18,9 @@ export * from "./Button/Button";
18
18
  export * from "./SvgIcon/SvgIcon";
19
19
  export * from "./Text/Text";
20
20
  export * from "./Label/Label";
21
- export * from "./Form/Form";
22
21
  export * from "./Input/Input";
23
22
  export * from "./CheckBox/CheckBox";
24
- export * from "./CodeField/CodeField";
25
23
  export * from "./RadioGroup/RadioGroup";
26
- export * from "./RadioButton/RadioButton";
27
- export * from "./CodeBox/CodeBox";
28
24
  export * from "./Display/Display";
29
25
  export * from "./RenderByScroll/RenderByScroll";
30
26
  export * from "./ActiveOnVisible/ActiveOnVisible";
package/dist/index.js CHANGED
@@ -22,13 +22,9 @@ export * from "./SvgIcon/SvgIcon";
22
22
  export * from "./Text/Text";
23
23
  export * from "./Label/Label";
24
24
  // Form Components
25
- export * from "./Form/Form";
26
25
  export * from "./Input/Input";
27
26
  export * from "./CheckBox/CheckBox";
28
- export * from "./CodeField/CodeField";
29
27
  export * from "./RadioGroup/RadioGroup";
30
- export * from "./RadioButton/RadioButton";
31
- export * from "./CodeBox/CodeBox";
32
28
  // Utilities
33
29
  export * from "./Display/Display"; // Stack Based
34
30
  export * from "./RenderByScroll/RenderByScroll"; // Stack Based
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yakad/ui",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "private": false,
5
5
  "author": "Natiq",
6
6
  "description": "UI components for NextJS/React",
@@ -34,9 +34,15 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@material/material-color-utilities": "^0.4.0",
37
+ "@radix-ui/react-avatar": "^1.2.6",
38
+ "@radix-ui/react-checkbox": "^1.3.12",
39
+ "@radix-ui/react-label": "^2.1.15",
40
+ "@radix-ui/react-navigation-menu": "^1.3.0",
41
+ "@radix-ui/react-radio-group": "^1.4.8",
37
42
  "@radix-ui/react-separator": "^1.1.15",
38
- "@yakad/lib": "1.0.23",
39
- "@yakad/symbols": "1.0.42",
43
+ "@radix-ui/react-slot": "^1.3.3",
44
+ "@yakad/lib": "1.0.32",
45
+ "@yakad/symbols": "1.0.43",
40
46
  "@yakad/use-interactions": "1.0.0",
41
47
  "class-variance-authority": "^0.7.1",
42
48
  "classnames": "2.5.1",
@@ -51,8 +57,8 @@
51
57
  "@types/css-modules": "1.0.5",
52
58
  "@types/react": "^19.0.0",
53
59
  "@types/react-dom": "^19.0.0",
54
- "react": "^19.0.0",
55
- "react-dom": "^19.0.0",
60
+ "react": "^19.2.0",
61
+ "react-dom": "^19.2.0",
56
62
  "tsx": "^4.23.13"
57
63
  }
58
64
  }
@@ -1,32 +0,0 @@
1
- .profileContainer {
2
- background-image: url("./default-avatar.svg");
3
- position: relative;
4
- width: 60px;
5
- height: 60px;
6
- cursor: pointer;
7
- border-radius: 50%;
8
- overflow: hidden;
9
- display: inline-flex;
10
- align-items: center;
11
- justify-content: center;
12
- background-size: cover;
13
- background-position: center;
14
- transition: all 0.3s ease;
15
- }
16
-
17
-
18
- .editOverlay {
19
- position: absolute;
20
- inset: 0;
21
- background-color: rgba(0, 0, 0, 0.5);
22
- display: flex;
23
- align-items: center;
24
- justify-content: center;
25
- opacity: 0;
26
- transition: opacity 0.3s ease;
27
- color: white;
28
- }
29
-
30
- .profileContainer:hover .editOverlay {
31
- opacity: 1;
32
- }
@@ -1,17 +0,0 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- width="256"
4
- height="256"
5
- viewBox="0 0 256 256"
6
- role="img"
7
- aria-label="Default avatar"
8
- >
9
- <rect width="100%" height="100%" rx="24" fill="#E6EEF8" />
10
- <g transform="translate(48,40)" fill="none" fill-rule="evenodd">
11
- <circle cx="80" cy="56" r="40" fill="#CBDFF6" />
12
- <path
13
- d="M0 152c0-44.18 35.82-80 80-80s80 35.82 80 80v8H0v-8z"
14
- fill="#B6D0FB"
15
- />
16
- </g>
17
- </svg>