@yakad/ui 2.0.1 → 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 (54) 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 +8 -0
  14. package/dist/{Spacer/Spacer.js → Label/Label.js} +9 -6
  15. package/dist/Navigation/Navigation.d.ts +19 -9
  16. package/dist/Navigation/Navigation.js +158 -11
  17. package/dist/RadioGroup/RadioGroup.d.ts +19 -12
  18. package/dist/RadioGroup/RadioGroup.js +61 -14
  19. package/dist/Separator/Separator.d.ts +9 -0
  20. package/dist/Separator/Separator.js +24 -0
  21. package/dist/Table/Table.d.ts +18 -36
  22. package/dist/Table/Table.js +90 -38
  23. package/dist/index.d.ts +2 -8
  24. package/dist/index.js +2 -8
  25. package/package.json +12 -5
  26. package/dist/Avatar/Avatar.module.css +0 -32
  27. package/dist/Avatar/default-avatar.svg +0 -17
  28. package/dist/Button/Button.module.css +0 -190
  29. package/dist/Card/Card.module.css +0 -48
  30. package/dist/CheckBox/CheckBox.module.css +0 -50
  31. package/dist/CodeBox/CodeBox.d.ts +0 -7
  32. package/dist/CodeBox/CodeBox.js +0 -22
  33. package/dist/CodeBox/CodeBox.module.css +0 -0
  34. package/dist/CodeField/CodeField.d.ts +0 -10
  35. package/dist/CodeField/CodeField.js +0 -43
  36. package/dist/CodeField/CodeField.module.css +0 -27
  37. package/dist/Dropdown/Dropdown.d.ts +0 -8
  38. package/dist/Dropdown/Dropdown.js +0 -99
  39. package/dist/Dropdown/Dropdown.module.css +0 -39
  40. package/dist/Form/Form.d.ts +0 -9
  41. package/dist/Form/Form.js +0 -20
  42. package/dist/Form/Form.module.css +0 -3
  43. package/dist/Navigation/Navigation.module.css +0 -61
  44. package/dist/Popup/Popup.d.ts +0 -8
  45. package/dist/Popup/Popup.js +0 -40
  46. package/dist/Popup/Popup.module.css +0 -15
  47. package/dist/RadioButton/RadioButton.d.ts +0 -14
  48. package/dist/RadioButton/RadioButton.js +0 -31
  49. package/dist/RadioButton/RadioButton.module.css +0 -22
  50. package/dist/Spacer/Spacer.d.ts +0 -5
  51. package/dist/Spacer/Spacer.module.css +0 -5
  52. package/dist/Table/Table.module.css +0 -41
  53. package/dist/WithOverlay/WithOverlay.d.ts +0 -15
  54. package/dist/WithOverlay/WithOverlay.js +0 -40
@@ -1,9 +1,19 @@
1
- /// <reference types="react" />
2
- export interface NavigationProps extends React.HTMLAttributes<HTMLElement> {
3
- align?: "start" | "space" | "center" | "end";
4
- anchor?: "left" | "right" | "top" | "bottom" | "auto";
5
- open: boolean;
6
- children?: React.ReactNode;
7
- ref?: React.Ref<HTMLDivElement>;
8
- }
9
- export declare function Navigation({ align, anchor, open, className, children, ...restProps }: NavigationProps): import("react").JSX.Element;
1
+ import * as React from "react";
2
+ import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
3
+ import { type VariantProps } from "class-variance-authority";
4
+ declare const navigationMenuVariants: (props?: ({
5
+ orientation?: "horizontal" | "vertical" | null | undefined;
6
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
7
+ type NavigationMenuProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root> & VariantProps<typeof navigationMenuVariants>;
8
+ declare const NavigationMenu: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuProps & React.RefAttributes<HTMLElement>, "ref"> & VariantProps<(props?: ({
9
+ orientation?: "horizontal" | "vertical" | null | undefined;
10
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLElement>>;
11
+ declare const NavigationMenuList: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuListProps & React.RefAttributes<HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
12
+ declare const NavigationMenuItem: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
13
+ declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
14
+ declare const NavigationMenuContent: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
15
+ declare const NavigationMenuLink: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
16
+ declare const NavigationMenuIndicator: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
17
+ declare const NavigationMenuViewport: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
+ export { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, };
19
+ export type { NavigationMenuProps, };
@@ -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, };
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
3
+ import { type VariantProps } from "class-variance-authority";
4
+ declare const separatorVariants: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
5
+ export interface SeparatorProps extends React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>, VariantProps<typeof separatorVariants> {
6
+ ref?: React.Ref<React.ElementRef<typeof SeparatorPrimitive.Root>>;
7
+ }
8
+ export declare function Separator({ orientation, decorative, className, ref, ...restProps }: SeparatorProps): React.JSX.Element;
9
+ export {};
@@ -0,0 +1,24 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
14
+ import { cva } from "class-variance-authority";
15
+ const separatorVariants = cva("shrink-0 bg-border");
16
+ export function Separator(_a) {
17
+ var { orientation = "horizontal", decorative = true, className, ref } = _a, restProps = __rest(_a, ["orientation", "decorative", "className", "ref"]);
18
+ return (_jsx(SeparatorPrimitive.Root, Object.assign({ ref: ref, orientation: orientation, decorative: decorative, className: separatorVariants({
19
+ className: [
20
+ orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
21
+ className,
22
+ ],
23
+ }) }, restProps)));
24
+ }
@@ -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
@@ -9,7 +9,7 @@ export * from "./Stack/Stack";
9
9
  export * from "./GridContainer/GridContainer";
10
10
  export * from "./GridItem/GridItem";
11
11
  export * from "./Card/Card";
12
- export * from "./Spacer/Spacer";
12
+ export * from "./Separator/Separator";
13
13
  export * from "./Hr/Hr";
14
14
  export * from "./List/List";
15
15
  export * from "./ListItem/ListItem";
@@ -17,17 +17,11 @@ export * from "./Table/Table";
17
17
  export * from "./Button/Button";
18
18
  export * from "./SvgIcon/SvgIcon";
19
19
  export * from "./Text/Text";
20
- export * from "./Form/Form";
20
+ export * from "./Label/Label";
21
21
  export * from "./Input/Input";
22
22
  export * from "./CheckBox/CheckBox";
23
- export * from "./CodeField/CodeField";
24
23
  export * from "./RadioGroup/RadioGroup";
25
- export * from "./RadioButton/RadioButton";
26
- export * from "./CodeBox/CodeBox";
27
24
  export * from "./Display/Display";
28
- export * from "./WithOverlay/WithOverlay";
29
25
  export * from "./RenderByScroll/RenderByScroll";
30
26
  export * from "./ActiveOnVisible/ActiveOnVisible";
31
- export * from "./Dropdown/Dropdown";
32
- export * from "./Popup/Popup";
33
27
  export * from "./Avatar/Avatar";
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ export * from "./GridContainer/GridContainer";
11
11
  export * from "./GridItem/GridItem";
12
12
  export * from "./Card/Card"; // Stack Based
13
13
  // Theme & Styling
14
- export * from "./Spacer/Spacer";
14
+ export * from "./Separator/Separator";
15
15
  export * from "./Hr/Hr";
16
16
  // UI Components
17
17
  export * from "./List/List";
@@ -20,20 +20,14 @@ export * from "./Table/Table";
20
20
  export * from "./Button/Button";
21
21
  export * from "./SvgIcon/SvgIcon";
22
22
  export * from "./Text/Text";
23
+ export * from "./Label/Label";
23
24
  // Form Components
24
- export * from "./Form/Form";
25
25
  export * from "./Input/Input";
26
26
  export * from "./CheckBox/CheckBox";
27
- export * from "./CodeField/CodeField";
28
27
  export * from "./RadioGroup/RadioGroup";
29
- export * from "./RadioButton/RadioButton";
30
- export * from "./CodeBox/CodeBox";
31
28
  // Utilities
32
29
  export * from "./Display/Display"; // Stack Based
33
- export * from "./WithOverlay/WithOverlay";
34
30
  export * from "./RenderByScroll/RenderByScroll"; // Stack Based
35
31
  export * from "./ActiveOnVisible/ActiveOnVisible"; // Stack Based
36
32
  // Overlays
37
- export * from "./Dropdown/Dropdown"; // Card Based
38
- export * from "./Popup/Popup"; // Card Based
39
33
  export * from "./Avatar/Avatar";